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-11 19:37:03-04:00, jas@rowvwade. +28 -0
Found and fixed "freed page" call to page cache manager
resolving to incorrect table space.
storage/falcon/Cache.cpp@stripped, 2007-06-11 19:36:44-04:00, jas@rowvwade. +22 -7
Make sure we have Bdb for right table space when marking
a page freed (Cache::freePage).
storage/falcon/Cache.h@stripped, 2007-06-11 19:36:45-04:00, jas@rowvwade. +1 -1
Make sure we have Bdb for right table space when marking
a page freed (Cache::freePage).
storage/falcon/DataPage.cpp@stripped, 2007-06-11 19:36:45-04:00, jas@rowvwade. +2 -0
Stylistic edit for consistency.
storage/falcon/Dbb.cpp@stripped, 2007-06-11 19:36:45-04:00, jas@rowvwade. +4 -4
Make sure we have Bdb for right table space when marking
a page freed (Cache::freePage).
storage/falcon/SRLBlobUpdate.cpp@stripped, 2007-06-11 19:36:46-04:00, jas@rowvwade. +1 -1
Correct serial log record version number for logging
table space ids.
storage/falcon/SRLCreateIndex.cpp@stripped, 2007-06-11 19:36:46-04:00, jas@rowvwade. +1 -1
Correct serial log record version number for logging
table space ids.
storage/falcon/SRLData.cpp@stripped, 2007-06-11 19:36:46-04:00, jas@rowvwade. +1 -1
Correct serial log record version number for logging
table space ids.
storage/falcon/SRLDelete.cpp@stripped, 2007-06-11 19:36:47-04:00, jas@rowvwade. +1 -1
Correct serial log record version number for logging
table space ids.
storage/falcon/SRLDeleteIndex.cpp@stripped, 2007-06-11 19:36:47-04:00, jas@rowvwade. +1 -1
Correct serial log record version number for logging
table space ids.
storage/falcon/SRLDropTable.cpp@stripped, 2007-06-11 19:36:47-04:00, jas@rowvwade. +1 -1
Correct serial log record version number for logging
table space ids.
storage/falcon/SRLFreePage.cpp@stripped, 2007-06-11 19:36:48-04:00, jas@rowvwade. +8 -1
Correct serial log record version number for logging
table space ids.
storage/falcon/SRLFreePage.h@stripped, 2007-06-11 19:36:49-04:00, jas@rowvwade. +9 -6
Correct serial log record version number for logging
table space ids.
storage/falcon/SRLIndexAdd.cpp@stripped, 2007-06-11 19:36:49-04:00, jas@rowvwade. +1 -1
Correct serial log record version number for logging
table space ids.
storage/falcon/SRLIndexPage.cpp@stripped, 2007-06-11 19:36:49-04:00, jas@rowvwade. +1 -1
Correct serial log record version number for logging
table space ids.
storage/falcon/SRLInversionPage.cpp@stripped, 2007-06-11 19:36:50-04:00, jas@rowvwade. +1 -1
Correct serial log record version number for logging
table space ids.
storage/falcon/SRLOverflowPages.cpp@stripped, 2007-06-11 19:36:50-04:00, jas@rowvwade. +1 -1
Correct serial log record version number for logging
table space ids.
storage/falcon/SRLRecordLocator.cpp@stripped, 2007-06-11 19:36:50-04:00, jas@rowvwade. +1 -1
Correct serial log record version number for logging
table space ids.
storage/falcon/SRLRecordStub.cpp@stripped, 2007-06-11 19:36:51-04:00, jas@rowvwade. +1 -1
Correct serial log record version number for logging
table space ids.
storage/falcon/SRLSectionLine.cpp@stripped, 2007-06-11 19:36:51-04:00, jas@rowvwade. +1 -1
Correct serial log record version number for logging
table space ids.
storage/falcon/SRLSectionPage.cpp@stripped, 2007-06-11 19:36:51-04:00, jas@rowvwade. +1 -1
Correct serial log record version number for logging
table space ids.
storage/falcon/SRLSectionPromotion.cpp@stripped, 2007-06-11 19:36:52-04:00, jas@rowvwade. +1
-1
Correct serial log record version number for logging
table space ids.
storage/falcon/SRLSequencePage.cpp@stripped, 2007-06-11 19:36:52-04:00, jas@rowvwade. +1 -1
Correct serial log record version number for logging
table space ids.
storage/falcon/SRLUpdateIndex.cpp@stripped, 2007-06-11 19:36:52-04:00, jas@rowvwade. +1 -1
Correct serial log record version number for logging
table space ids.
storage/falcon/SRLUpdateRecords.cpp@stripped, 2007-06-11 19:36:53-04:00, jas@rowvwade. +5 -5
Correct serial log record version number for logging
table space ids.
storage/falcon/Section.cpp@stripped, 2007-06-11 19:36:54-04:00, jas@rowvwade. +40 -18
Add some validation code to track down bug.
storage/falcon/Section.h@stripped, 2007-06-11 19:36:54-04:00, jas@rowvwade. +6 -5
Add some validation code to track down bug.
storage/falcon/SerialLog.cpp@stripped, 2007-06-11 19:36:55-04:00, jas@rowvwade. +1 -0
Initialize variable "recoveryPhase" for newly created
databaess.
storage/falcon/SerialLogRecord.cpp@stripped, 2007-06-11 19:36:55-04:00, jas@rowvwade. +4 -1
Streamlined diagnostic logging in serial log.
# 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.32/storage/falcon/SRLUpdateIndex.cpp 2007-06-11 19:37:27 -04:00
+++ 1.33/storage/falcon/SRLUpdateIndex.cpp 2007-06-11 19:37:27 -04:00
@@ -93,7 +93,7 @@
void SRLUpdateIndex::read(void)
{
- if (control->version >= srlVersion7)
+ if (control->version >= srlVersion8)
tableSpaceId = getInt();
else
tableSpaceId = 0;
--- 1.37/storage/falcon/SRLUpdateRecords.cpp 2007-06-11 19:37:27 -04:00
+++ 1.38/storage/falcon/SRLUpdateRecords.cpp 2007-06-11 19:37:27 -04:00
@@ -79,7 +79,7 @@
int tableSpaceId;
- if (control->version >= srlVersion7)
+ if (control->version >= srlVersion8)
tableSpaceId = control->getInt();
else
tableSpaceId = 0;
@@ -256,7 +256,7 @@
if (transaction->state == sltCommitted)
for (const UCHAR *p = data, *end = data + dataLength; p < end;)
{
- if (control->version >= srlVersion7)
+ if (control->version >= srlVersion8)
tableSpaceId = getInt(&p);
else
tableSpaceId = 0;
@@ -296,7 +296,7 @@
for (const UCHAR *p = data, *end = data + dataLength; p < end;)
{
- if (control->version >= srlVersion7)
+ if (control->version >= srlVersion8)
tableSpaceId = getInt(&p);
else
tableSpaceId = 0;
@@ -322,7 +322,7 @@
for (const UCHAR *p = data, *end = data + dataLength; p < end;)
{
- if (control->version >= srlVersion7)
+ if (control->version >= srlVersion8)
tableSpaceId = getInt(&p);
else
tableSpaceId = 0;
@@ -357,7 +357,7 @@
for (const UCHAR *p = data, *end = data + dataLength; p < end;)
{
- if (control->version >= srlVersion7)
+ if (control->version >= srlVersion8)
tableSpaceId = getInt(&p);
else
tableSpaceId = 0;
--- 1.10/storage/falcon/SRLCreateIndex.cpp 2007-06-11 19:37:27 -04:00
+++ 1.11/storage/falcon/SRLCreateIndex.cpp 2007-06-11 19:37:27 -04:00
@@ -52,7 +52,7 @@
void SRLCreateIndex::read()
{
- if (control->version >= srlVersion7)
+ if (control->version >= srlVersion8)
tableSpaceId = getInt();
else
tableSpaceId = 0;
--- 1.11/storage/falcon/SRLDeleteIndex.cpp 2007-06-11 19:37:27 -04:00
+++ 1.12/storage/falcon/SRLDeleteIndex.cpp 2007-06-11 19:37:27 -04:00
@@ -59,7 +59,7 @@
void SRLDeleteIndex::read()
{
- if (control->version >= srlVersion7)
+ if (control->version >= srlVersion8)
tableSpaceId = getInt();
else
tableSpaceId = 0;
--- 1.9/storage/falcon/SRLFreePage.cpp 2007-06-11 19:37:27 -04:00
+++ 1.10/storage/falcon/SRLFreePage.cpp 2007-06-11 19:37:27 -04:00
@@ -23,6 +23,7 @@
#include "SerialLog.h"
#include "Dbb.h"
#include "SerialLogControl.h"
+#include ".\srlfreepage.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
@@ -48,7 +49,7 @@
void SRLFreePage::read()
{
- if (control->version >= srlVersion7)
+ if (control->version >= srlVersion8)
tableSpaceId = getInt();
else
tableSpaceId = 0;
@@ -83,4 +84,10 @@
void SRLFreePage::print()
{
logPrint("Free Page %d/%d\n", pageNumber, tableSpaceId);
+}
+
+void SRLFreePage::commit(void)
+{
+ if (pageNumber == log->tracePage)
+ print();
}
--- 1.5/storage/falcon/SRLFreePage.h 2007-06-11 19:37:27 -04:00
+++ 1.6/storage/falcon/SRLFreePage.h 2007-06-11 19:37:27 -04:00
@@ -29,18 +29,21 @@
class SRLFreePage : public SerialLogRecord
{
public:
- virtual void print();
- virtual void pass1();
- virtual void redo();
- void read();
- virtual void append (Dbb *dbb, int32 pageNumber);
SRLFreePage();
virtual ~SRLFreePage();
+ virtual void print();
+ virtual void pass1();
+ virtual void redo();
+ virtual void read();
+ virtual void pass2(void);
+ virtual void commit(void);
+
+ void append (Dbb *dbb, int32 pageNumber);
+
int tableSpaceId;
int32 pageNumber;
int incarnation;
- virtual void pass2(void);
};
#endif // !defined(AFX_SRLFREEPAGE_H__FB37FC48_BFFA_43CE_83E0_A1F1327E170D__INCLUDED_)
--- 1.13/storage/falcon/SRLIndexAdd.cpp 2007-06-11 19:37:27 -04:00
+++ 1.14/storage/falcon/SRLIndexAdd.cpp 2007-06-11 19:37:27 -04:00
@@ -61,7 +61,7 @@
void SRLIndexAdd::read()
{
- if (control->version >= srlVersion7)
+ if (control->version >= srlVersion8)
tableSpaceId = getInt();
else
tableSpaceId = 0;
--- 1.15/storage/falcon/SRLIndexPage.cpp 2007-06-11 19:37:27 -04:00
+++ 1.16/storage/falcon/SRLIndexPage.cpp 2007-06-11 19:37:27 -04:00
@@ -63,7 +63,7 @@
void SRLIndexPage::read()
{
- if (control->version >= srlVersion7)
+ if (control->version >= srlVersion8)
tableSpaceId = getInt();
else
tableSpaceId = 0;
--- 1.7/storage/falcon/SRLInversionPage.cpp 2007-06-11 19:37:27 -04:00
+++ 1.8/storage/falcon/SRLInversionPage.cpp 2007-06-11 19:37:27 -04:00
@@ -63,7 +63,7 @@
void SRLInversionPage::read()
{
- if (control->version >= srlVersion7)
+ if (control->version >= srlVersion8)
tableSpaceId = getInt();
else
tableSpaceId = 0;
--- 1.5/storage/falcon/SRLOverflowPages.cpp 2007-06-11 19:37:27 -04:00
+++ 1.6/storage/falcon/SRLOverflowPages.cpp 2007-06-11 19:37:27 -04:00
@@ -58,7 +58,7 @@
void SRLOverflowPages::read(void)
{
- if (control->version >= srlVersion7)
+ if (control->version >= srlVersion8)
tableSpaceId = getInt();
else
tableSpaceId = 0;
--- 1.16/storage/falcon/SRLRecordLocator.cpp 2007-06-11 19:37:27 -04:00
+++ 1.17/storage/falcon/SRLRecordLocator.cpp 2007-06-11 19:37:27 -04:00
@@ -59,7 +59,7 @@
void SRLRecordLocator::read()
{
- if (control->version >= srlVersion7)
+ if (control->version >= srlVersion8)
tableSpaceId = getInt();
else
tableSpaceId = 0;
--- 1.8/storage/falcon/SRLSectionLine.cpp 2007-06-11 19:37:27 -04:00
+++ 1.9/storage/falcon/SRLSectionLine.cpp 2007-06-11 19:37:27 -04:00
@@ -40,7 +40,7 @@
void SRLSectionLine::read(void)
{
- if (control->version >= srlVersion7)
+ if (control->version >= srlVersion8)
tableSpaceId = getInt();
else
tableSpaceId = 0;
--- 1.14/storage/falcon/SRLSectionPage.cpp 2007-06-11 19:37:27 -04:00
+++ 1.15/storage/falcon/SRLSectionPage.cpp 2007-06-11 19:37:27 -04:00
@@ -41,7 +41,7 @@
void SRLSectionPage::read()
{
- if (control->version >= srlVersion7)
+ if (control->version >= srlVersion8)
tableSpaceId = getInt();
else
tableSpaceId = 0;
--- 1.8/storage/falcon/SRLSectionPromotion.cpp 2007-06-11 19:37:27 -04:00
+++ 1.9/storage/falcon/SRLSectionPromotion.cpp 2007-06-11 19:37:27 -04:00
@@ -45,7 +45,7 @@
void SRLSectionPromotion::read(void)
{
- if (control->version >= srlVersion7)
+ if (control->version >= srlVersion8)
tableSpaceId = getInt();
else
tableSpaceId = 0;
--- 1.7/storage/falcon/SRLSequencePage.cpp 2007-06-11 19:37:27 -04:00
+++ 1.8/storage/falcon/SRLSequencePage.cpp 2007-06-11 19:37:27 -04:00
@@ -42,7 +42,7 @@
void SRLSequencePage::read(void)
{
- if (control->version >= srlVersion7)
+ if (control->version >= srlVersion8)
tableSpaceId = getInt();
else
tableSpaceId = 0;
--- 1.32/storage/falcon/Cache.cpp 2007-06-11 19:37:27 -04:00
+++ 1.33/storage/falcon/Cache.cpp 2007-06-11 19:37:27 -04:00
@@ -36,6 +36,8 @@
#include "Thread.h"
#include "DatabaseCopy.h"
+//#define STOP_PAGE 114
+
static const uint64 cacheHunkSize = 1024 * 1024 * 128;
#ifdef _DEBUG
@@ -187,7 +189,7 @@
{
sync.unlock();
actual = Exclusive;
- sync.lock (Exclusive, "Cache::fetchPage 2");
+ sync.lock(Exclusive, "Cache::fetchPage 2");
for (bdb = hashTable [slot]; bdb; bdb = bdb->hash)
if (bdb->pageNumber == pageNumber && bdb->dbb == dbb)
@@ -203,13 +205,19 @@
if (!bdb)
{
- bdb = findBuffer (dbb, pageNumber, actual, &sync);
+ bdb = findBuffer(dbb, pageNumber, actual, &sync);
moveToHead(bdb);
sync.unlock();
- dbb->readPage (bdb);
+
+#ifdef STOP_PAGE
+ if (bdb->pageNumber == STOP_PAGE)
+ printf("reading page %d/%d\n", bdb->pageNumber, dbb->tableSpaceId);
+#endif
+
+ dbb->readPage(bdb);
if (actual != lockType)
- bdb->downGrade (lockType);
+ bdb->downGrade(lockType);
}
}
@@ -235,6 +243,7 @@
}
ASSERT (bdb->pageNumber == pageNumber);
+ ASSERT (bdb->dbb == dbb);
ASSERT (bdb->useCount > 0);
return bdb;
@@ -481,7 +490,13 @@
Dbb *database = bdb->dbb;
ASSERT(database);
markClean (bdb);
- database->writePage (bdb);
+ database->writePage(bdb);
+
+#ifdef STOP_PAGE
+ if (bdb->pageNumber == STOP_PAGE)
+ printf("writing page %d/%d\n", bdb->pageNumber, dbb->tableSpaceId);
+#endif
+
bdb->flags &= ~(BDB_dirty | BDB_new);
if (pageWriter && (bdb->flags & BDB_writer))
@@ -648,7 +663,7 @@
freePrecedence = precedence;
}
-void Cache::freePage(int32 pageNumber)
+void Cache::freePage(Dbb *dbb, int32 pageNumber)
{
Sync sync (&syncObject, "Cache::freePage");
sync.lock (Shared);
@@ -657,7 +672,7 @@
// If page exists in cache (usual case), clean it up
for (Bdb *bdb = hashTable [slot]; bdb; bdb = bdb->hash)
- if (bdb->pageNumber == pageNumber)
+ if (bdb->pageNumber == pageNumber && bdb->dbb == dbb)
{
if (bdb->flags & BDB_dirty)
{
--- 1.12/storage/falcon/Cache.h 2007-06-11 19:37:27 -04:00
+++ 1.13/storage/falcon/Cache.h 2007-06-11 19:37:27 -04:00
@@ -43,7 +43,7 @@
void setPageWriter (PageWriter *writer);
bool hasDirtyPages (Dbb *dbb);
void flush (Dbb *dbb);
- void freePage (int32 pageNumber);
+ void freePage (Dbb *dbb, int32 pageNumber);
void clearPrecedence (PagePrecedence *precedence);
void setPrecedence (Bdb *lower, int32 highPageNumber);
void validateUnique (Bdb *bdb);
--- 1.21/storage/falcon/DataPage.cpp 2007-06-11 19:37:27 -04:00
+++ 1.22/storage/falcon/DataPage.cpp 2007-06-11 19:37:27 -04:00
@@ -387,12 +387,14 @@
{
++analysis->records;
int length = lineIndex [n].length;
+
if (length < 0)
{
spaceUsed -= length;
char *ptr = (char*) this + lineIndex[n].offset;
int32 overflowPageNumber;
memcpy (&overflowPageNumber, ptr, sizeof (int32));
+
while (overflowPageNumber)
{
++analysis->overflowPages;
--- 1.74/storage/falcon/Dbb.cpp 2007-06-11 19:37:27 -04:00
+++ 1.75/storage/falcon/Dbb.cpp 2007-06-11 19:37:27 -04:00
@@ -561,7 +561,7 @@
void Dbb::freePage(int32 pageNumber)
{
- cache->freePage (pageNumber);
+ cache->freePage(this, pageNumber);
}
void Dbb::freePage(Bdb * bdb, TransId transId)
@@ -574,13 +574,13 @@
if (serialLog && !serialLog->recovering)
serialLog->logControl->freePage.append(this, pageNumber);
- PageInventoryPage::freePage (this, pageNumber, transId);
+ PageInventoryPage::freePage(this, pageNumber, transId);
}
void Dbb::redoFreePage(int32 pageNumber)
{
- cache->freePage (pageNumber);
- PageInventoryPage::freePage (this, pageNumber, NO_TRANSACTION);
+ cache->freePage(this, pageNumber);
+ PageInventoryPage::freePage(this, pageNumber, NO_TRANSACTION);
}
void Dbb::deleteSection(int32 sectionId, TransId transId)
--- 1.10/storage/falcon/SRLBlobUpdate.cpp 2007-06-11 19:37:27 -04:00
+++ 1.11/storage/falcon/SRLBlobUpdate.cpp 2007-06-11 19:37:27 -04:00
@@ -59,7 +59,7 @@
void SRLBlobUpdate::read()
{
- if (control->version >= srlVersion7)
+ if (control->version >= srlVersion8)
tableSpaceId = getInt();
else
tableSpaceId = 0;
--- 1.10/storage/falcon/SRLData.cpp 2007-06-11 19:37:27 -04:00
+++ 1.11/storage/falcon/SRLData.cpp 2007-06-11 19:37:27 -04:00
@@ -56,7 +56,7 @@
void SRLData::read()
{
- if (control->version >= srlVersion7)
+ if (control->version >= srlVersion8)
tableSpaceId = getInt();
else
tableSpaceId = 0;
--- 1.8/storage/falcon/SRLDelete.cpp 2007-06-11 19:37:27 -04:00
+++ 1.9/storage/falcon/SRLDelete.cpp 2007-06-11 19:37:27 -04:00
@@ -54,7 +54,7 @@
void SRLDelete::read()
{
- if (control->version >= srlVersion7)
+ if (control->version >= srlVersion8)
tableSpaceId = getInt();
else
tableSpaceId = 0;
--- 1.22/storage/falcon/SRLDropTable.cpp 2007-06-11 19:37:27 -04:00
+++ 1.23/storage/falcon/SRLDropTable.cpp 2007-06-11 19:37:27 -04:00
@@ -59,7 +59,7 @@
void SRLDropTable::read()
{
- if (control->version >= srlVersion7)
+ if (control->version >= srlVersion8)
tableSpaceId = getInt();
else
tableSpaceId = 0;
--- 1.11/storage/falcon/SRLRecordStub.cpp 2007-06-11 19:37:27 -04:00
+++ 1.12/storage/falcon/SRLRecordStub.cpp 2007-06-11 19:37:27 -04:00
@@ -51,7 +51,7 @@
void SRLRecordStub::read()
{
- if (control->version >= srlVersion7)
+ if (control->version >= srlVersion8)
tableSpaceId = getInt();
else
tableSpaceId = 0;
--- 1.51/storage/falcon/Section.cpp 2007-06-11 19:37:28 -04:00
+++ 1.52/storage/falcon/Section.cpp 2007-06-11 19:37:28 -04:00
@@ -41,6 +41,8 @@
#include "Transaction.h"
#include "PageInventoryPage.h"
+//#define STOP_PAGE 114
+
#ifdef _DEBUG
static char THIS_FILE[]=__FILE__;
#endif
@@ -462,9 +464,9 @@
// We've found the section index page. Mark it
bdb->mark(transId);
- RecordLocatorPage *indexPage = (RecordLocatorPage*) bdb->buffer;
+ RecordLocatorPage *locatorPage = (RecordLocatorPage*) bdb->buffer;
int line = recordNumber % dbb->linesPerPage;
- RecordIndex *index = indexPage->elements + line;
+ RecordIndex *index = locatorPage->elements + line;
// If the data page exits, and the record fits on the page, update it.
@@ -472,17 +474,19 @@
{
Bdb *dataBdb = dbb->fetchPage (index->page, PAGE_data, Exclusive);
DataPage *dataPage = (DataPage*) dataBdb->buffer;
+ //validate(locatorPage, dataBdb);
dataBdb->mark(transId);
if (!stream)
{
- int spaceAvailable = deleteLine (dataBdb, index->line, bdb->pageNumber,
transId);
+ int spaceAvailable = deleteLine(dataBdb, index->line, bdb->pageNumber, transId,
locatorPage, line);
if (spaceAvailable == 0)
spaceAvailable = dataPage->computeSpaceAvailable(dbb->pageSize);
- indexPage->deleteLine (line, spaceAvailable);
- //indexPage->validateSpaceSlots();
+ locatorPage->deleteLine(line, spaceAvailable);
+ ASSERT(index->page == 0 && index->line == 0);
+ //locatorPage->validateSpaceSlots();
bdb->release();
if (flags & SECTION_FULL)
@@ -495,7 +499,7 @@
if (spaceAvailable)
{
- indexPage->setIndexSlot(line, index->page, index->line, spaceAvailable);
+ locatorPage->setIndexSlot(line, index->page, index->line, spaceAvailable);
dataBdb->release();
dbb->setPrecedence(bdb, index->page);
bdb->release();
@@ -503,14 +507,14 @@
return;
}
- deleteLine (dataBdb, index->line, bdb->pageNumber, transId);
+ deleteLine(dataBdb, index->line, bdb->pageNumber, transId, locatorPage, line);
}
else if (!stream)
- indexPage->deleteLine (line, false); // deleting unfulfilled stub
+ locatorPage->deleteLine(line, false); // deleting unfulfilled stub
if (stream)
{
- storeRecord(indexPage, bdb->pageNumber, index, stream, transId, earlyWrite);
+ storeRecord(locatorPage, bdb->pageNumber, index, stream, transId, earlyWrite);
dbb->setPrecedence(bdb, index->page);
}
@@ -534,11 +538,12 @@
return dbb->handoffPage (bdb, pageNumber, PAGE_record_locator, lockType);
}
-int Section::deleteLine(Bdb * bdb, int line, int32 sectionPageNumber, TransId transId)
+int Section::deleteLine(Bdb * bdb, int line, int32 sectionPageNumber, TransId transId,
RecordLocatorPage *locatorPage, int locatorLine)
{
bdb->mark(transId);
DataPage *page = (DataPage*) bdb->buffer;
- int spaceAvailable = page->deleteLine (dbb, line, transId);
+ //validate(locatorPage, bdb);
+ int spaceAvailable = page->deleteLine(dbb, line, transId);
// Unless the page is empty, return the amount of space remaining
@@ -550,10 +555,14 @@
return spaceAvailable;
}
+ for (int n = 0; n <= locatorPage->maxLine; ++n)
+ if (n != locatorLine && locatorPage->elements[n].page == bdb->pageNumber)
+ ASSERT(false);
+
if (!dbb->serialLog->recovering)
dbb->serialLog->logControl->sectionLine.append(dbb, sectionPageNumber,
bdb->pageNumber);
- dbb->freePage (bdb, transId);
+ dbb->freePage(bdb, transId);
return 0;
}
@@ -583,6 +592,7 @@
{
Bdb *bdb = dbb->fetchPage (recordLocator->page, PAGE_data, Exclusive);
DataPage *page = (DataPage*) bdb->buffer;
+
RecordIndex temp;
int spaceAvailable = page->storeRecord(dbb, bdb, &temp, length, stream,
overflowPageNumber, transId, earlyWrite);
@@ -685,24 +695,24 @@
bool Section::fetchRecord(int32 recordNumber, Stream *stream, TransId transId)
{
- Bdb *bdb = fetchIndexPage (root, recordNumber, Shared, transId);
+ Bdb *bdb = fetchIndexPage(root, recordNumber, Shared, transId);
if (!bdb)
return false;
- RecordLocatorPage *indexPage = (RecordLocatorPage*) bdb->buffer;
+ RecordLocatorPage *locatorPage = (RecordLocatorPage*) bdb->buffer;
int slot = recordNumber % dbb->linesPerPage;
/* If line isn't allocated, record doesn't exist */
- if (slot > indexPage->maxLine)
+ if (slot > locatorPage->maxLine)
{
bdb->release();
return false;
}
- RecordIndex *index = indexPage->elements + slot;
+ RecordIndex *index = locatorPage->elements + slot;
/* If there isn't a page number, there isn't a record */
@@ -716,9 +726,9 @@
/* OK, go get the data page */
slot = index->line;
- bdb = dbb->handoffPage (bdb, index->page, PAGE_data, Shared);
+ bdb = dbb->handoffPage(bdb, index->page, PAGE_data, Shared);
DataPage *dataPage = (DataPage*) bdb->buffer;
- bool ret = dataPage->fetchRecord (dbb, slot, stream);
+ bool ret = dataPage->fetchRecord(dbb, slot, stream);
bdb->release();
return ret;
@@ -1272,4 +1282,16 @@
page->setIndexSlot(locatorLine, dataPage, dataLine, dbb->pageSize);
bdb->release();
+}
+
+void Section::validate(RecordLocatorPage* locatorPage, Bdb *dataPageBdb)
+{
+ DataPage* dataPage = (DataPage*) dataPageBdb->buffer;
+
+ for (int n = 0; n < locatorPage->maxLine; ++n)
+ if (locatorPage->elements[n].page == dataPageBdb->pageNumber)
+ {
+ int l = locatorPage->elements[n].line;
+ ASSERT(l < dataPage->maxLine && dataPage->lineIndex[l].length != 0);
+ }
}
--- 1.20/storage/falcon/Section.h 2007-06-11 19:37:28 -04:00
+++ 1.21/storage/falcon/Section.h 2007-06-11 19:37:28 -04:00
@@ -55,7 +55,7 @@
int32 findNextRecord (int32 pageNumber, int32 startingRecord, Stream *stream);
bool fetchRecord (int32 recordNumber, Stream *stream, TransId transId);
void storeRecord (RecordLocatorPage *recordLocatorPage, int32 indexPageNumber,
RecordIndex *index, Stream *stream, TransId transId, bool earlyWrite);
- int deleteLine (Bdb *bdb, int line, int32 sectionPageNumber, TransId transId);
+ int deleteLine (Bdb *bdb, int line, int32 sectionPageNumber, TransId transId,
RecordLocatorPage *locatorPage, int locatorLine);
void updateRecord (int32 recordId, Stream *stream, TransId transId, bool earlyWrite);
int32 insertStub (TransId transId);
int32 getSectionRoot();
@@ -69,10 +69,7 @@
static Bdb* getSectionPage (Dbb *dbb, int32 root, int32 sequence, LockType lockType,
TransId transId);
static int32 createSection (Dbb *dbb, TransId transId);
static bool decomposeSequence (Dbb *dbb, int32 sequence, int level, int *slots);
- static void validateIndexes (Dbb *dbb, Validation *validation);
- static void validate (Dbb *dbb, Validation *validation, int sectionId, int rootPage);
static int32 getMaxPage (int32 root, Dbb *dbb);
- static void validateSections (Dbb *dbb, Validation *validation);
static void deleteSectionLevel (Dbb *dbb, int32 pageNumber, TransId transId);
static void deleteSection (Dbb *dbb, int32 sectionId, TransId transId);
static void createSection (Dbb *dbb, int32 sectionId, TransId transId);
@@ -80,10 +77,14 @@
static bool dataPageInUse(Dbb* dbb, int32 recordLocatorPage, int32 dataPage);
static void redoBlobUpdate(Dbb* dbb, int32 locatorPage, int locatorLine, int32
dataPage, int dataLine);
+ static void validate(RecordLocatorPage* locatorPage, Bdb *dataPageBdb);
+ static void validateIndexes (Dbb *dbb, Validation *validation);
+ static void validate (Dbb *dbb, Validation *validation, int sectionId, int rootPage);
+ static void validateSections (Dbb *dbb, Validation *validation);
+
SyncObject syncObject;
int32 sectionId;
int32 nextLine;
- //int32 dataPage;
int32 root;
Section *hash;
Dbb *dbb;
--- 1.81/storage/falcon/SerialLog.cpp 2007-06-11 19:37:28 -04:00
+++ 1.82/storage/falcon/SerialLog.cpp 2007-06-11 19:37:28 -04:00
@@ -392,6 +392,7 @@
}
Log::log("Recovery complete\n");
+ recoveryPhase = 0;
}
void SerialLog::overflowFlush(void)
--- 1.15/storage/falcon/SerialLogRecord.cpp 2007-06-11 19:37:28 -04:00
+++ 1.16/storage/falcon/SerialLogRecord.cpp 2007-06-11 19:37:28 -04:00
@@ -320,5 +320,8 @@
if (vsnprintf (temp, sizeof (temp) - 1, text, args) < 0)
temp [sizeof (temp) - 1] = 0;
- printf("Recovery phase %d %s", log->recoveryPhase, temp);
+ if (log->recoveryPhase)
+ printf("Recovery phase %d %s", log->recoveryPhase, temp);
+ else
+ printf("Log %s", temp);
}
| Thread |
|---|
| • bk commit into 6.0-falcon tree (jas:1.2566) | U-ROWVWADEjas | 12 Jun |