MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Martin Skold Date:August 28 2006 9:27am
Subject:bk commit into 5.1 tree (mskold:1.2037) BUG#20892
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of marty. When marty does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-08-28 11:27:11+02:00, mskold@stripped +2 -0
  ndb - bug#20892 Fix bug in tup buddy allocator, which made it make invalid access to cfreepagelist[16] (which is not defined)

  storage/ndb/src/kernel/blocks/dbtup/DbtupPagMan.cpp@stripped, 2006-08-28 11:17:51+02:00, mskold@stripped +17 -13
    loop from firstListToCheck -1 (as firstListToCheck has already been checked), when looking for less than requested pages dd if-statement for firtListToCheck == 0

  storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp@stripped, 2006-08-28 11:22:01+02:00, mskold@stripped +2 -2
    Dont grow noOfPagesToGrow with more than was actually allocated (as it will then grow indefinitly)

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	mskold
# Host:	linux.site
# Root:	/windows/Linux_space/MySQL/mysql-5.1-wl2325-5.0

--- 1.8/storage/ndb/src/kernel/blocks/dbtup/DbtupPagMan.cpp	2006-08-28 11:27:18 +02:00
+++ 1.9/storage/ndb/src/kernel/blocks/dbtup/DbtupPagMan.cpp	2006-08-28 11:27:18 +02:00
@@ -230,24 +230,28 @@ void Dbtup::allocConsPages(Uint32 noOfPa
 /*       PROPER AMOUNT OF PAGES WERE NOT FOUND. FIND AS MUCH AS     */
 /*       POSSIBLE.                                                  */
 /* ---------------------------------------------------------------- */
-  for (Uint32 j = firstListToCheck; (Uint32)~j; j--) {
+  if (firstListToCheck)
+  {
     ljam();
-    if (cfreepageList[j] != RNIL) {
+    for (Uint32 j = firstListToCheck; (Uint32)~j; j--) {
       ljam();
+      if (cfreepageList[j] != RNIL) {
+	ljam();
 /* ---------------------------------------------------------------- */
 /*       SOME AREA WAS FOUND, ALLOCATE ALL OF IT.                   */
 /* ---------------------------------------------------------------- */
-      allocPageRef = cfreepageList[j];
-      removeCommonArea(allocPageRef, j);
-      noOfPagesAllocated = 1 << j;
-      findFreeLeftNeighbours(allocPageRef, noOfPagesAllocated, 
-			     noOfPagesToAllocate);
-      findFreeRightNeighbours(allocPageRef, noOfPagesAllocated, 
-			      noOfPagesToAllocate);
-
-      return;
-    }//if
-  }//for
+	allocPageRef = cfreepageList[j];
+	removeCommonArea(allocPageRef, j);
+	noOfPagesAllocated = 1 << j;
+	findFreeLeftNeighbours(allocPageRef, noOfPagesAllocated, 
+			       noOfPagesToAllocate);
+	findFreeRightNeighbours(allocPageRef, noOfPagesAllocated, 
+				noOfPagesToAllocate);
+	
+	return;
+      }//if
+    }//for
+  }
 /* ---------------------------------------------------------------- */
 /*       NO FREE AREA AT ALL EXISTED. RETURN ZERO PAGES             */
 /* ---------------------------------------------------------------- */

--- 1.4/storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp	2006-08-28 11:27:18 +02:00
+++ 1.5/storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp	2006-08-28 11:27:18 +02:00
@@ -397,7 +397,6 @@ void Dbtup::allocMoreFragPages(Fragrecor
   Uint32 noAllocPages = regFragPtr->noOfPagesToGrow >> 3; // 12.5%
   noAllocPages += regFragPtr->noOfPagesToGrow >> 4; // 6.25%
   noAllocPages += 2;
-  regFragPtr->noOfPagesToGrow += noAllocPages;
 /* -----------------------------------------------------------------*/
 // We will grow by 18.75% plus two more additional pages to grow
 // a little bit quicker in the beginning.
@@ -405,7 +404,8 @@ void Dbtup::allocMoreFragPages(Fragrecor
 // that anymore to prevent over-agressive allocation 
 /* -----------------------------------------------------------------*/
   if (noAllocPages > 1024) noAllocPages = 1024; 
-  allocFragPages(regFragPtr, noAllocPages);
+  Uint32 allocated = allocFragPages(regFragPtr, noAllocPages);
+  regFragPtr->noOfPagesToGrow += allocated;
 }//Dbtup::allocMoreFragPages()
 
 Uint32 Dbtup::leafPageRangeFull(Fragrecord*  const regFragPtr, PageRangePtr currPageRangePtr)
Thread
bk commit into 5.1 tree (mskold:1.2037) BUG#20892Martin Skold28 Aug