Below is the list of changes that have just been committed into a local
6.0 repository of jas. When jas 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 16:23:10-04:00, jas@stripped +3 -0
Make record locator space slot validation a conditional
macro to make it easier to turn it on for debugging.
storage/falcon/Section.cpp@stripped, 2007-11-01 16:23:07-04:00, jas@stripped +26 -6
Make record locator space slot validation a conditional
macro to make it easier to turn it on for debugging.
storage/falcon/SerialLogFile.cpp@stripped, 2007-11-01 16:23:07-04:00, jas@stripped +3 -0
Added "stat" for serial log files to get device segment
size. Unfortunately, "stat" lies. Never the less, the
code is there for reference.
storage/falcon/StorageDatabase.cpp@stripped, 2007-11-01 16:23:07-04:00, jas@stripped +3 -2
Move lock on the system transactions for rename table to
include index renaming as well as the table proper.
diff -Nrup a/storage/falcon/Section.cpp b/storage/falcon/Section.cpp
--- a/storage/falcon/Section.cpp 2007-11-01 11:59:18 -04:00
+++ b/storage/falcon/Section.cpp 2007-11-01 16:23:07 -04:00
@@ -48,6 +48,12 @@
static int stopSection = 40;
#endif
+//#define VALIDATE_SPACE_SLOTS(page) page->validateSpaceSlots();
+
+#ifndef VALIDATE_SPACE_SLOTS
+#define VALIDATE_SPACE_SLOTS(page)
+#endif
+
#ifdef _DEBUG
#undef THIS_FILE
static const char THIS_FILE[]=__FILE__;
@@ -379,6 +385,7 @@ int32 Section::insertStub(TransId transI
}
page = (RecordLocatorPage*) bdb->buffer;
+ VALIDATE_SPACE_SLOTS(page);
int slot = line % linesPerPage;
RecordIndex *index = page->elements + slot;
@@ -388,8 +395,13 @@ int32 Section::insertStub(TransId transI
bdb->mark(transId);
index->line = 1;
+
+ for (int n = page->maxLine; n <= slot; ++n)
+ page->elements[n].spaceAvailable = 0;
+
page->maxLine = MAX(page->maxLine, slot + 1);
ASSERT(page->maxLine <= dbb->pagesPerSection);
+ VALIDATE_SPACE_SLOTS(page);
bdb->release(REL_HISTORY);
// We have our line. Find the next potential line, and if it isn't in this
@@ -513,6 +525,7 @@ void Section::updateRecord(int32 recordN
bdb->mark(transId);
RecordLocatorPage *locatorPage = (RecordLocatorPage*) bdb->buffer;
ASSERT(locatorPage->section == sectionId || locatorPage->section == 0);
+ VALIDATE_SPACE_SLOTS(locatorPage);
int line = recordNumber % dbb->linesPerPage;
RecordIndex *index = locatorPage->elements + line;
@@ -534,7 +547,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();
+ VALIDATE_SPACE_SLOTS(locatorPage);
bdb->release(REL_HISTORY);
if (flags & SECTION_FULL)
@@ -548,6 +561,7 @@ void Section::updateRecord(int32 recordN
if (spaceAvailable)
{
locatorPage->setIndexSlot(line, index->page, index->line, spaceAvailable);
+ VALIDATE_SPACE_SLOTS(locatorPage);
dataBdb->release(REL_HISTORY);
dbb->setPrecedence(bdb, index->page);
bdb->release(REL_HISTORY);
@@ -558,7 +572,10 @@ void Section::updateRecord(int32 recordN
deleteLine(dataBdb, index->line, bdb->pageNumber, transId, locatorPage, line);
}
else if (!stream)
+ {
locatorPage->deleteLine(line, false); // deleting unfulfilled stub
+ VALIDATE_SPACE_SLOTS(locatorPage);
+ }
if (stream)
{
@@ -637,6 +654,7 @@ void Section::storeRecord(RecordLocatorP
int effectiveLength = length;
int maxRecord = OVERFLOW_RECORD_SIZE;
int32 overflowPageNumber = 0;
+ VALIDATE_SPACE_SLOTS(recordLocatorPage);
if (length > maxRecord)
{
@@ -656,10 +674,12 @@ void Section::storeRecord(RecordLocatorP
RecordIndex temp;
int spaceAvailable = page->storeRecord(dbb, bdb, &temp, length, stream, overflowPageNumber, transId, earlyWrite);
+ VALIDATE_SPACE_SLOTS(recordLocatorPage);
if (spaceAvailable > 0)
{
recordLocatorPage->setIndexSlot(indexSlot, temp.page, temp.line, spaceAvailable);
+ VALIDATE_SPACE_SLOTS(recordLocatorPage);
if (!dbb->serialLog->recovering)
{
@@ -678,7 +698,7 @@ void Section::storeRecord(RecordLocatorP
}
bdb->release(REL_HISTORY);
- recordLocatorPage->validateSpaceSlots();
+ VALIDATE_SPACE_SLOTS(recordLocatorPage);
}
}
@@ -688,7 +708,7 @@ void Section::storeRecord(RecordLocatorP
BDB_HISTORY(bdb);
DataPage *page = (DataPage*) bdb->buffer;
page->maxLine = 0;
- recordLocatorPage->validateSpaceSlots();
+ VALIDATE_SPACE_SLOTS(recordLocatorPage);
RecordIndex temp;
int spaceAvailable = page->storeRecord(dbb, bdb, &temp, length, stream, overflowPageNumber, transId, earlyWrite);
@@ -1323,7 +1343,7 @@ void Section::redoDataPage(int32 pageNum
Bdb *locatorBdb = dbb->fetchPage(locatorPageNumber, PAGE_record_locator, Shared);
BDB_HISTORY(locatorBdb);
RecordLocatorPage *locatorPage = (RecordLocatorPage*) locatorBdb->buffer;
- locatorPage->validateSpaceSlots();
+ VALIDATE_SPACE_SLOTS(locatorPage);
for (int n = 0; n < locatorPage->maxLine; ++n)
if (locatorPage->elements[n].page == pageNumber)
@@ -1337,7 +1357,7 @@ void Section::redoDataPage(int32 pageNum
dataPage->lineIndex[line].length = 0;
}
- locatorPage->validateSpaceSlots();
+ VALIDATE_SPACE_SLOTS(locatorPage);
locatorBdb->release(REL_HISTORY);
bdb->release(REL_HISTORY);
}
@@ -1377,7 +1397,7 @@ void Section::redoSectionLine(Dbb* dbb,
BDB_HISTORY(bdb);
bdb->mark(NO_TRANSACTION);
RecordLocatorPage *page = (RecordLocatorPage*) bdb->buffer;
- //page->validateSpaceSlots();
+ VALIDATE_SPACE_SLOTS(page);
page->expungeDataPage(dataPageNumber);
bdb->release(REL_HISTORY);
}
diff -Nrup a/storage/falcon/SerialLogFile.cpp b/storage/falcon/SerialLogFile.cpp
--- a/storage/falcon/SerialLogFile.cpp 2007-10-31 13:05:14 -04:00
+++ b/storage/falcon/SerialLogFile.cpp 2007-11-01 16:23:07 -04:00
@@ -127,6 +127,9 @@ void SerialLogFile::open(JString filenam
(const char*) filename, strerror (errno), errno);
fileName = filename;
+ struct stat statBuffer;
+ fstat(handle, &statBuffer);
+ //sectorSize = MAX(statBuffer.st_blksize, database->serialLogBlockSize);
sectorSize = MAX(512, database->serialLogBlockSize);
#endif
diff -Nrup a/storage/falcon/StorageDatabase.cpp b/storage/falcon/StorageDatabase.cpp
--- a/storage/falcon/StorageDatabase.cpp 2007-10-31 02:41:13 -04:00
+++ b/storage/falcon/StorageDatabase.cpp 2007-11-01 16:23:07 -04:00
@@ -641,6 +641,9 @@ int StorageDatabase::renameTable(Storage
++numberIndexes;
}
+ Sync sync(&database->syncSysConnection, "StorageDatabase::renameTable");
+ sync.lock(Exclusive);
+
for (int n = firstIndex; n < numberIndexes; ++n)
{
char indexName[256];
@@ -654,8 +657,6 @@ int StorageDatabase::renameTable(Storage
}
}
- Sync sync(&database->syncSysConnection, "StorageDatabase::renameTable");
- sync.lock(Exclusive);
table->rename(schemaName, tableName);
if (sequence)
| Thread |
|---|
| • bk commit into 6.0 tree (jas:1.2673) | Jim Starkey | 1 Nov |