List:Commits« Previous MessageNext Message »
From:U-ROWVWADEjas Date:June 13 2007 7:05pm
Subject:bk commit into 6.0-falcon tree (jas:1.2566)
View as plain text  
Below is the list of changes that have just been committed into a local
6.0-falcon 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-06-13 13:05:15-04:00, jas@rowvwade. +9 -0
  Extend database validation to table spaces.

  storage/falcon/DataPage.cpp@stripped, 2007-06-13 13:05:05-04:00, jas@rowvwade. +14 -0
    Speed up deletion of large tables.

  storage/falcon/DataPage.h@stripped, 2007-06-13 13:05:05-04:00, jas@rowvwade. +1 -0
    Speed up deletion of large tables.

  storage/falcon/Database.cpp@stripped, 2007-06-13 13:05:06-04:00, jas@rowvwade. +2 -1
    Extend database validation to table spaces.

  storage/falcon/RecordLocatorPage.cpp@stripped, 2007-06-13 13:05:06-04:00, jas@rowvwade. +14
-0
    Speed up deletion of large tables.

  storage/falcon/RecordLocatorPage.h@stripped, 2007-06-13 13:05:06-04:00, jas@rowvwade. +2 -1
    Speed up deletion of large tables.

  storage/falcon/Section.cpp@stripped, 2007-06-13 13:05:07-04:00, jas@rowvwade. +48 -45
    Speed up deletion of large tables.

  storage/falcon/TableSpaceManager.cpp@stripped, 2007-06-13 13:05:07-04:00, jas@rowvwade. +9
-0
    Extend database validation to table spaces.

  storage/falcon/TableSpaceManager.h@stripped, 2007-06-13 13:05:08-04:00, jas@rowvwade. +1 -0
    Extend database validation to table spaces.

  storage/falcon/TransactionManager.cpp@stripped, 2007-06-13 13:05:08-04:00, jas@rowvwade. +3
-6
    Streamline transaction summary reporting.

# 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:	jas
# Host:	rowvwade.
# Root:	D:/MySQL/mysql-5.1-falcon

--- 1.3/storage/falcon/RecordLocatorPage.cpp	2007-06-13 13:05:37 -04:00
+++ 1.4/storage/falcon/RecordLocatorPage.cpp	2007-06-13 13:05:37 -04:00
@@ -26,6 +26,7 @@
 #include "DataPage.h"
 #include "Bitmap.h"
 #include "Log.h"
+#include ".\recordlocatorpage.h"
 
 #define VALIDIF(expr)		if (!(expr)) corrupt();
 //////////////////////////////////////////////////////////////////////
@@ -404,4 +405,17 @@
 			
 			element->page = 0;
 			}
+}
+
+void RecordLocatorPage::deleteDataPages(Dbb* dbb, TransId transId)
+{
+	for (int slot = -1; (slot = nextSpaceSlot(slot)) >= 0;)
+		{
+		int32 pageNumber = elements[slot].page;
+		Bdb *bdb = dbb->fetchPage(pageNumber, PAGE_data, Exclusive);
+		bdb->mark(transId);
+		DataPage *dataPage = (DataPage*) bdb->buffer;
+		dataPage->deletePage(dbb, transId);
+		dbb->freePage(bdb, transId);
+		}
 }

--- 1.2/storage/falcon/RecordLocatorPage.h	2007-06-13 13:05:37 -04:00
+++ 1.3/storage/falcon/RecordLocatorPage.h	2007-06-13 13:05:37 -04:00
@@ -53,6 +53,8 @@
 	void	corrupt(void);
 	void	printPage(void);
 	void	setIndexSlot(int slot, int32 page, int line, int availableSpace);
+	void	expungeDataPage(int32 pageNumber);
+	void	deleteDataPages(Dbb* dbb, TransId transId);
 
 protected:
 	void	insertSpaceSlot(int slot, int availableSpace);
@@ -69,7 +71,6 @@
 	int			sequence;
 	int			maxLine;
 	RecordIndex elements [1];
-	void expungeDataPage(int32 pageNumber);
 };
 
 #endif //
!defined(AFX_SECTIONINDEXPAGE_H__6A019C23_A340_11D2_AB5A_0000C01D2301__INCLUDED_)

--- 1.9/storage/falcon/TableSpaceManager.cpp	2007-06-13 13:05:37 -04:00
+++ 1.10/storage/falcon/TableSpaceManager.cpp	2007-06-13 13:05:37 -04:00
@@ -281,3 +281,12 @@
 	for (TableSpace *tableSpace = tableSpaces; tableSpace; tableSpace = tableSpace->next)
 		tableSpace->dbb->reportStatistics();
 }
+
+void TableSpaceManager::validate(int optionMask)
+{
+	Sync sync(&syncObject, "TableSpaceManager::validate");
+	sync.lock(Shared);
+
+	for (TableSpace *tableSpace = tableSpaces; tableSpace; tableSpace = tableSpace->next)
+		tableSpace->dbb->validate(optionMask);
+}

--- 1.6/storage/falcon/TableSpaceManager.h	2007-06-13 13:05:38 -04:00
+++ 1.7/storage/falcon/TableSpaceManager.h	2007-06-13 13:05:38 -04:00
@@ -55,6 +55,7 @@
 	TableSpace	*nameHash[TS_HASH_SIZE];
 	TableSpace	*idHash[TS_HASH_SIZE];
 	SyncObject	syncObject;
+	void validate(int optionMask);
 };
 
 #endif //
!defined(AFX_TABLESPACEMANAGER_H__BD1D39F6_2201_4136_899C_7CB106E99B8C__INCLUDED_)

--- 1.11/storage/falcon/TransactionManager.cpp	2007-06-13 13:05:38 -04:00
+++ 1.12/storage/falcon/TransactionManager.cpp	2007-06-13 13:05:38 -04:00
@@ -307,21 +307,18 @@
 	sync.lock (Shared);
 	Transaction *transaction;
 	int active = 0;
-	int pendingCleanup = 0;
 	
 	for (transaction = activeTransactions.first; transaction; transaction =
transaction->next)
 		if (transaction->state == Active)
 			++active;
 			
-	for (transaction = committedTransactions.first; transaction; transaction =
transaction->next)
-		++pendingCleanup;
-	
+	int pendingCleanup = committedTransactions.count;
 	int numberCommitted = committed - priorCommitted;
 	int numberRolledBack = rolledBack - priorRolledBack;
 	priorCommitted = committed;
 	priorRolledBack = rolledBack;
 	
-	if (active || numberCommitted || numberRolledBack)
-		Log::log (LogInfo, "Transaction: %d committed, %d rolled back, %d active, %d
post-commit\n",
+	if (active || numberCommitted || numberRolledBack || pendingCleanup)
+		Log::log (LogInfo, "Transactions: %d committed, %d rolled back, %d active, %d
post-commit\n",
 				  numberCommitted, numberRolledBack, active, pendingCleanup);
 }

--- 1.22/storage/falcon/DataPage.cpp	2007-06-13 13:05:38 -04:00
+++ 1.23/storage/falcon/DataPage.cpp	2007-06-13 13:05:38 -04:00
@@ -421,3 +421,17 @@
 	
 	return pageSize - maxLine * sizeof(LineIndex) - spaceUsed;
 }
+
+void DataPage::deletePage(Dbb *dbb, TransId transId)
+{
+	for (int line = 0; line < maxLine; ++line)
+		if (lineIndex[line].length < 0)
+			{
+			char *ptr = (char*) this + lineIndex[line].offset;
+			int32 overflowPageNumber;
+			memcpy (&overflowPageNumber, ptr, sizeof (int32));
+
+			if (overflowPageNumber && !dbb->serialLog->recovering)
+				deleteOverflowPages (dbb, overflowPageNumber, transId);
+			}
+}

--- 1.10/storage/falcon/DataPage.h	2007-06-13 13:05:38 -04:00
+++ 1.11/storage/falcon/DataPage.h	2007-06-13 13:05:38 -04:00
@@ -52,6 +52,7 @@
 	int		compressPage(Dbb *dbb);
 	int		updateRecord (Section *section, int line, Stream *stream, TransId transId, bool
earlyWrite);
 	int		computeSpaceAvailable(int pageSize);
+	void	deletePage(Dbb *dbb, TransId transId);
 
 	short		maxLine;
 	LineIndex	lineIndex [1];

--- 1.76/storage/falcon/Database.cpp	2007-06-13 13:05:38 -04:00
+++ 1.77/storage/falcon/Database.cpp	2007-06-13 13:05:38 -04:00
@@ -1600,7 +1600,8 @@
 	Sync sync (&syncObject, "Database::validate");
 	sync.lock (Exclusive);
 	dbb->validate (optionMask);
-
+	tableSpaceManager->validate(optionMask);
+	
 	if (optionMask & validateBlobs)
 		{
 		Sync sync2 (&syncSysConnection, "Database::validate");

--- 1.52/storage/falcon/Section.cpp	2007-06-13 13:05:39 -04:00
+++ 1.53/storage/falcon/Section.cpp	2007-06-13 13:05:39 -04:00
@@ -419,16 +419,16 @@
 		//NOT_YET_IMPLEMENTED;
 		return;
 
-	RecordLocatorPage *indexPage = (RecordLocatorPage*) bdb->buffer;
+	RecordLocatorPage *locatorPage = (RecordLocatorPage*) bdb->buffer;
 	int slot = recordNumber % dbb->linesPerPage;
-	RecordIndex *index = indexPage->elements + slot;
+	RecordIndex *index = locatorPage->elements + slot;
 
-	if (slot > indexPage->maxLine || (!index->line && !index->page))
+	if (slot > locatorPage->maxLine || (!index->line && !index->page))
 		{
 		bdb->mark(transId);
-		indexPage->maxLine = MAX (indexPage->maxLine, slot + 1);
+		locatorPage->maxLine = MAX (locatorPage->maxLine, slot + 1);
 		index->line = 1;
-		ASSERT (indexPage->maxLine <= dbb->pagesPerSection);
+		ASSERT (locatorPage->maxLine <= dbb->pagesPerSection);
 		}
 
 	bdb->release();
@@ -742,29 +742,29 @@
 int32 Section::findNextRecord(int32 pageNumber, int32 startingRecord, Stream *stream)
 {
 	Bdb *bdb = dbb->fetchPage (pageNumber, PAGE_any, Shared);
-	RecordLocatorPage *indexPage = (RecordLocatorPage*) bdb->buffer;
+	RecordLocatorPage *locatorPage = (RecordLocatorPage*) bdb->buffer;
 
 	/* If this is a section index page, just look for a line in use */
 
-	if (indexPage->pageType == PAGE_record_locator)
+	if (locatorPage->pageType == PAGE_record_locator)
 		{
-		for (int slot = startingRecord % dbb->linesPerPage; slot < indexPage->maxLine;
++slot)
-			if (indexPage->elements [slot].page)
+		for (int slot = startingRecord % dbb->linesPerPage; slot <
locatorPage->maxLine; ++slot)
+			if (locatorPage->elements [slot].page)
 				{
 				if (stream)
 					{
 					/* OK, go get the data page */
-					int32 line = indexPage->elements [slot].line;
+					int32 line = locatorPage->elements [slot].line;
 					Bdb *dataBdb;
 					
 					try
 						{
-						dataBdb = dbb->handoffPage (bdb, indexPage->elements [slot].page, PAGE_data,
Shared);
+						dataBdb = dbb->handoffPage (bdb, locatorPage->elements [slot].page,
PAGE_data, Shared);
 						}
 					catch (SQLException &exception)
 						{
 						Log::log ("Corrupted data page, section %d, slot %d, index page %d, corrupt page
%d\n",
-								sectionId, slot, bdb->pageNumber, indexPage->elements [slot].page);
+								sectionId, slot, bdb->pageNumber, locatorPage->elements [slot].page);
 						Log::log ("-%s\n", exception.getText());
 						
 						continue;
@@ -777,7 +777,7 @@
 						Log::log("Lost record, page %d, slot %d, data page %d\n", pageNumber, slot,
dataBdb->pageNumber);
 						dataBdb->release();
 						bdb = dbb->fetchPage (pageNumber, PAGE_any, Shared);
-						indexPage = (RecordLocatorPage*) bdb->buffer;
+						locatorPage = (RecordLocatorPage*) bdb->buffer;
 						
 						continue;
 						}
@@ -798,8 +798,8 @@
 
 	/* This is an intermediate page.  Find child page to recurse. */
 
-	ASSERT (indexPage->pageType == PAGE_sections);
-	SectionPage *sectionPage = (SectionPage*) indexPage;
+	ASSERT (locatorPage->pageType == PAGE_sections);
+	SectionPage *sectionPage = (SectionPage*) locatorPage;
 	int factor = dbb->linesPerPage;
 
 	for (int n = 0; n < sectionPage->level; ++n)
@@ -841,7 +841,7 @@
 	SectionPage *sections = (SectionPage*) sectionsBuffer->buffer;
 	int32 pageNumber = sections->pages [slot];
 	sections->pages [slot] = 0;
-	dbb->nextSection = MIN (sectionId, dbb->nextSection);
+	dbb->nextSection = MIN(sectionId, dbb->nextSection);
 
 	if (!dbb->serialLog->recovering)
 		dbb->serialLog->logControl->sectionPage.append(dbb,
sectionsBuffer->pageNumber, 0, slot, sections->section, sections->sequence,
sections->level);
@@ -851,7 +851,7 @@
 	// Section is officially gone.  Now recover the pages
 
 	if (pageNumber)
-		deleteSectionLevel (dbb, pageNumber, transId);
+		deleteSectionLevel(dbb, pageNumber, transId);
 }
 
 void Section::deleteSectionLevel(Dbb * dbb, int32 pageNumber, TransId transId)
@@ -867,7 +867,7 @@
 				dbb->serialLog->logControl->sectionPage.append(dbb, pageNumber, 0, n,
page->section, page->sequence, page->level);
 				
 			if (page->pages [n])
-				deleteSectionLevel (dbb, page->pages [n], transId);
+				deleteSectionLevel(dbb, page->pages [n], transId);
 			}
 		}
 	else
@@ -875,27 +875,30 @@
 		for (int n = 0; n < dbb->pagesPerSection; ++n)
 			if (page->pages [n])
 				{
-				Bdb *sectionIndexBdb = dbb->fetchPage (page->pages [n], PAGE_record_locator,
Exclusive);
-				RecordLocatorPage *indexPage = (RecordLocatorPage*) sectionIndexBdb->buffer;
-
-				for (int line = 0; line < indexPage->maxLine; ++line)
-					{
-					RecordIndex *index = indexPage->elements + line;
+				Bdb *recordLocatorBdb = dbb->fetchPage (page->pages [n], PAGE_record_locator,
Exclusive);
+				RecordLocatorPage *locatorPage = (RecordLocatorPage*) recordLocatorBdb->buffer;
 
-					if (index->page)
+				if (locatorPage->maxLine > 0 &&
locatorPage->elements[0].spaceAvailable != 0)
+					locatorPage->deleteDataPages(dbb, transId);
+				else
+					for (int line = 0; line < locatorPage->maxLine; ++line)
 						{
-						Bdb *bdb = dbb->fetchPage (index->page, PAGE_data, Exclusive);
-						bdb->mark(transId);
-						DataPage *page = (DataPage*) bdb->buffer;
-
-						if (page->deleteLine (dbb, index->line, transId))
-							bdb->release();
-						else
-							dbb->freePage (bdb, transId);
-						}					
-					}
+						RecordIndex *index = locatorPage->elements + line;
+
+						if (index->page)
+							{
+							Bdb *bdb = dbb->fetchPage (index->page, PAGE_data, Exclusive);
+							bdb->mark(transId);
+							DataPage *page = (DataPage*) bdb->buffer;
+
+							if (page->deleteLine(dbb, index->line, transId))
+								bdb->release();
+							else
+								dbb->freePage(bdb, transId);
+							}					
+						}
 
-				dbb->freePage (sectionIndexBdb, transId);
+				dbb->freePage (recordLocatorBdb, transId);
 				}
 		}
 
@@ -1143,21 +1146,21 @@
 	if (pageNumber)
 		{
 		Bdb *indexBdb = dbb->fakePage(pageNumber, PAGE_record_locator, 0);
-		RecordLocatorPage *indexPage = (RecordLocatorPage*) indexBdb->buffer;
+		RecordLocatorPage *locatorPage = (RecordLocatorPage*) indexBdb->buffer;
 
 		/***
 		if (//sectionPage->pages[slot] != pageNumber ||
 			!dbb->trialRead(indexBdb) ||
-			indexPage->pageType != PAGE_record_locator ||
-			indexPage->section != sectionId ||
-			indexPage->sequence != sequence)
+			locatorPage->pageType != PAGE_record_locator ||
+			locatorPage->section != sectionId ||
+			locatorPage->sequence != sequence)
 		***/
 			{
-			memset (indexPage, 0, dbb->pageSize);			// page may have been dirtied by partial
read
-			indexPage->pageType = PAGE_record_locator;
-			indexPage->section = sectionId;
-			indexPage->sequence = sequence;
-			indexPage->maxLine = 0;
+			memset (locatorPage, 0, dbb->pageSize);			// page may have been dirtied by partial
read
+			locatorPage->pageType = PAGE_record_locator;
+			locatorPage->section = sectionId;
+			locatorPage->sequence = sequence;
+			locatorPage->maxLine = 0;
 			}
 
 		indexBdb->release();
Thread
bk commit into 6.0-falcon tree (jas:1.2566)U-ROWVWADEjas13 Jun