List:Commits« Previous MessageNext Message »
From:U-ROWVWADEjas Date:November 1 2007 3:59pm
Subject:bk commit into 6.0 tree (jas:1.2671)
View as plain text  
Below is the list of changes that have just been committed into a local
6.0 repository of . When  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, 2007-11-01 11:59:25-04:00, jas@rowvwade. +3 -0
  Enable record locator page space management validation to
  catch bug.

  storage/falcon/RecordLocatorPage.cpp@stripped, 2007-11-01 11:59:17-04:00, jas@rowvwade. +9 -18
    Recover from space management structure corruption on the
    record locator page if necessary.

  storage/falcon/SRLIndexDelete.cpp@stripped, 2007-11-01 11:59:17-04:00, jas@rowvwade. +2 -0
    Validate index version number to catch bug.

  storage/falcon/Section.cpp@stripped, 2007-11-01 11:59:18-04:00, jas@rowvwade. +7 -4
    Enable record locator page space management validation to
    catch bug.

diff -Nrup a/storage/falcon/RecordLocatorPage.cpp b/storage/falcon/RecordLocatorPage.cpp
--- a/storage/falcon/RecordLocatorPage.cpp	2007-09-20 11:42:14 -04:00
+++ b/storage/falcon/RecordLocatorPage.cpp	2007-11-01 11:59:17 -04:00
@@ -387,7 +387,15 @@ void RecordLocatorPage::unlinkSpaceSlot(
 	
 	for (priorSlot = -1; (nextSlot = nextSpaceSlot(priorSlot)) >= 0 && nextSlot < slot; priorSlot = nextSlot)
 		;
-	
+
+	if (slot < nextSlot)
+		{
+		Log::log("RecordLocatorPage: transient corruption corrected\n");
+		elements[slot].spaceAvailable = 0;
+		
+		return;
+		}
+
 	VALIDIF(nextSlot == slot);
 	nextSlot = nextSpaceSlot(slot);
 	elements[slot].spaceAvailable = 0;
@@ -416,23 +424,6 @@ void RecordLocatorPage::expungeDataPage(
 
 void RecordLocatorPage::deleteDataPages(Dbb* dbb, TransId transId)
 {
-	/***
-	for (int slot = -1; (slot = nextSpaceSlot(slot)) >= 0;)
-		{
-		int32 pageNumber = elements[slot].page;
-		
-		if (pageNumber == 149)
-			printf("page %d\n", pageNumber);
-			
-		Bdb *bdb = dbb->fetchPage(pageNumber, PAGE_data, Exclusive);
-		BDB_HISTORY(bdb);
-		bdb->mark(transId);
-		DataPage *dataPage = (DataPage*) bdb->buffer;
-		dataPage->deletePage(dbb, transId);
-		dbb->freePage(bdb, transId);
-		}
-	***/
-	
 	for (int slot; (slot = nextSpaceSlot(-1)) >= 0;)
 		{
 		int pageNumber = elements[slot].page;
diff -Nrup a/storage/falcon/SRLIndexDelete.cpp b/storage/falcon/SRLIndexDelete.cpp
--- a/storage/falcon/SRLIndexDelete.cpp	2007-10-24 12:30:38 -04:00
+++ b/storage/falcon/SRLIndexDelete.cpp	2007-11-01 11:59:17 -04:00
@@ -48,6 +48,7 @@ SRLIndexDelete::~SRLIndexDelete()
 
 void SRLIndexDelete::append(Dbb *dbb, int32 indexId, int idxVersion, IndexKey *key, int32 recordNumber, TransId transactionId)
 {
+	ASSERT(idxVersion <= INDEX_CURRENT_VERSION);
 	START_RECORD(srlIndexDelete, "SRLIndexDelete::append");
 	putInt(dbb->tableSpaceId);
 	putInt(indexId);
@@ -69,6 +70,7 @@ void SRLIndexDelete::read()
 	recordId = getInt();
 	length = getInt();
 	data = getData(length);
+	ASSERT(indexVersion <= INDEX_CURRENT_VERSION);
 }
 
 
diff -Nrup a/storage/falcon/Section.cpp b/storage/falcon/Section.cpp
--- a/storage/falcon/Section.cpp	2007-10-31 10:50:30 -04:00
+++ b/storage/falcon/Section.cpp	2007-11-01 11:59:18 -04:00
@@ -534,7 +534,7 @@ void Section::updateRecord(int32 recordN
 			int spaceAvailable = deleteLine(dataBdb, index->line, bdb->pageNumber, transId, locatorPage, line);
 			locatorPage->deleteLine(line, spaceAvailable);
 			ASSERT(index->page == 0 && index->line == 0);
-			//locatorPage->validateSpaceSlots();
+			locatorPage->validateSpaceSlots();
 			bdb->release(REL_HISTORY);
 
 			if (flags & SECTION_FULL)
@@ -678,7 +678,7 @@ void Section::storeRecord(RecordLocatorP
 				}
 
 			bdb->release(REL_HISTORY);
-			//recordLocatorPage->validateSpaceSlots();
+			recordLocatorPage->validateSpaceSlots();
 			}
 		}
 		
@@ -688,7 +688,7 @@ void Section::storeRecord(RecordLocatorP
 	BDB_HISTORY(bdb);
 	DataPage *page = (DataPage*) bdb->buffer;
 	page->maxLine = 0;
-	//recordLocatorPage->validateSpaceSlots();
+	recordLocatorPage->validateSpaceSlots();
 	RecordIndex temp;
 	int spaceAvailable = page->storeRecord(dbb, bdb, &temp, length, stream, overflowPageNumber, transId, earlyWrite);
 	
@@ -1323,7 +1323,8 @@ void Section::redoDataPage(int32 pageNum
 	Bdb *locatorBdb = dbb->fetchPage(locatorPageNumber, PAGE_record_locator, Shared);
 	BDB_HISTORY(locatorBdb);
 	RecordLocatorPage *locatorPage = (RecordLocatorPage*) locatorBdb->buffer;
-
+	locatorPage->validateSpaceSlots();
+	
 	for (int n = 0; n < locatorPage->maxLine; ++n)
 		if (locatorPage->elements[n].page == pageNumber)
 			{
@@ -1336,6 +1337,7 @@ void Section::redoDataPage(int32 pageNum
 			dataPage->lineIndex[line].length = 0;
 			}
 	
+	locatorPage->validateSpaceSlots();
 	locatorBdb->release(REL_HISTORY);
 	bdb->release(REL_HISTORY);
 }
@@ -1375,6 +1377,7 @@ void Section::redoSectionLine(Dbb* dbb, 
 	BDB_HISTORY(bdb);
 	bdb->mark(NO_TRANSACTION);
 	RecordLocatorPage *page = (RecordLocatorPage*) bdb->buffer;
+	//page->validateSpaceSlots();
 	page->expungeDataPage(dataPageNumber);
 	bdb->release(REL_HISTORY);
 }
Thread
bk commit into 6.0 tree (jas:1.2671)U-ROWVWADEjas1 Nov