#At file:///C:/Work/bzr/Merge/mysql-6.0-falcon-team/
2859 Kevin Lewis 2008-10-08
Bug#39672 - Using BitMap::nextSet does not work correctly when you
clear the previous set bit. It skips a bit every loop. This caused
half of the RecordLeafs to remain in memory. So use nextSet(0).
Also, do not spread out the numbers in the emptySections bitmap by
setting record numbers. Use section numbers for a tighter bitmap.
modified:
storage/falcon/RecordLeaf.cpp
storage/falcon/Table.cpp
per-file messages:
storage/falcon/RecordLeaf.cpp
Do not spread out the numbers in the emptySections bitmap by
setting record numbers. Use section numbers for a tighter bitmap.
storage/falcon/Table.cpp
Using BitMap::nextSet does not work correctly when you clear
the previous set bit. It skips a bit every loop. This caused
half of the RecordLeafs to remain in memory. So use nextSet(0).
Also, do not spread out the numbers in the emptySections bitmap by
setting record numbers. Use section numbers for a tighter bitmap.
=== modified file 'storage/falcon/RecordLeaf.cpp'
--- a/storage/falcon/RecordLeaf.cpp 2008-07-15 18:57:27 +0000
+++ b/storage/falcon/RecordLeaf.cpp 2008-10-09 04:55:50 +0000
@@ -118,7 +118,7 @@ int RecordLeaf::retireRecords (Table *ta
{
int count = 0;
Record **ptr, **end;
- Sync sync(&syncObject, "RecordLeaf::retireRecords(1)");
+ Sync sync(&syncObject, "RecordLeaf::retireRecords(syncObject)");
sync.lock(Shared);
// Get a shared lock to find at least one record to scavenge
@@ -134,7 +134,7 @@ int RecordLeaf::retireRecords (Table *ta
++count;
else if (record->isVersion())
{
- Sync syncPrior(record->getSyncPrior(), "RecordLeaf::retireRecords(2)");
+ Sync syncPrior(record->getSyncPrior(), "RecordLeaf::retireRecords(prior)");
syncPrior.lock(Shared);
if (record->scavenge(recordScavenge, Shared))
@@ -220,7 +220,7 @@ int RecordLeaf::retireRecords (Table *ta
// identifier when the leaf node is scavenged later.
if (!count && table->emptySections)
- table->emptySections->set(base * RECORD_SLOTS);
+ table->emptySections->set(base);
return count;
}
=== modified file 'storage/falcon/Table.cpp'
--- a/storage/falcon/Table.cpp 2008-10-03 23:56:24 +0000
+++ b/storage/falcon/Table.cpp 2008-10-09 04:55:50 +0000
@@ -162,6 +162,9 @@ Table::~Table()
if (recordBitmap)
recordBitmap->release();
+
+ if (emptySections)
+ emptySections->release();
}
Field* Table::findField(const char * fieldName)
@@ -1875,7 +1878,7 @@ int Table::retireRecords(RecordScavenge
syncObj.lock(Exclusive);
// Confirm that tree is still empty
-
+
count = records->countActiveRecords();
if (count == 0)
@@ -1888,16 +1891,17 @@ int Table::retireRecords(RecordScavenge
{
// Get an exclusive lock only if there are empty leaf nodes. Find and
// delete the empty nodes using the stored record numbers as identifiers.
-
+
if (emptySections->count > 0)
{
syncObj.unlock();
syncObj.lock(Exclusive);
- for (int recordNumber = 0; (recordNumber = emptySections->nextSet(recordNumber)) >= 0;)
+ for (int sectionNumber = 0; (sectionNumber = emptySections->nextSet(0)) >= 0;)
{
+ int recordNumber = sectionNumber * RECORD_SLOTS;
records->retireSections(this, recordNumber);
- emptySections->clear(recordNumber);
+ emptySections->clear(sectionNumber);
}
}
@@ -2117,10 +2121,10 @@ void Table::garbageCollect(Record *leavi
if (!leaving && !staying)
return;
- Sync sync (&syncObject, "Table::garbageCollect(1)");
+ Sync sync (&syncObject, "Table::garbageCollect(Obj)");
sync.lock(Shared);
- Sync syncPrior(getSyncPrior(leaving ? leaving : staying), "Table::garbageCollect(2)");
+ Sync syncPrior(getSyncPrior(leaving ? leaving : staying), "Table::garbageCollect(prior)");
syncPrior.lock(Shared);
// Clean up field indexes
| Thread |
|---|
| • bzr commit into mysql-6.0-falcon-team branch (klewis:2859) Bug#39672 | Kevin Lewis | 9 Oct |