Below is the list of changes that have just been committed into a local
6.0 repository of cpowers. When cpowers 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, 2008-04-26 22:13:23-05:00, cpowers@stripped +4 -0
Bug#36330: Falcon DBT2 crash in Transaction::needToLock
"Forced" scavenges are performed immediately free record cache memory, and
should therefore be less constrained than the periodic scavenges peformed by
the Scavenger thread.
Streamlined forced record scavenging:
- Don't call Table::inventoryRecords() for forced scavenges.
- Ignore scavenge generation if scavenge is forced--just scavenge anyway.
storage/falcon/Database.cpp@stripped, 2008-04-26 22:13:21-05:00, cpowers@stripped +3
-2
Database::retireRecords()
- Don't call Table::inventoryRecords() for forced scavenges.
storage/falcon/RecordScavenge.cpp@stripped, 2008-04-26 22:13:21-05:00, cpowers@stripped
+3 -3
Renamed RecordScavenge::wasForced to forced.
storage/falcon/RecordScavenge.h@stripped, 2008-04-26 22:13:21-05:00, cpowers@stripped
+2 -2
Renamed RecordScavenge::wasForced to forced.
storage/falcon/RecordVersion.cpp@stripped, 2008-04-26 22:13:21-05:00, cpowers@stripped
+4 -2
RecordVersion::scavenge() - Ignore scavengeGeneration if scavenge is forced.
diff -Nrup a/storage/falcon/Database.cpp b/storage/falcon/Database.cpp
--- a/storage/falcon/Database.cpp 2008-04-22 18:33:50 -05:00
+++ b/storage/falcon/Database.cpp 2008-04-26 22:13:21 -05:00
@@ -1787,8 +1787,9 @@ void Database::retireRecords(bool forced
Table *table;
time_t scavengeStart = deltaTime;
- for (table = tableList; table; table = table->next)
- table->inventoryRecords(&recordScavenge);
+ if (!forced)
+ for (table = tableList; table; table = table->next)
+ table->inventoryRecords(&recordScavenge);
threshold = recordScavenge.computeThreshold(recordScavengeFloor);
recordScavenge.printRecordMemory();
diff -Nrup a/storage/falcon/RecordScavenge.cpp b/storage/falcon/RecordScavenge.cpp
--- a/storage/falcon/RecordScavenge.cpp 2008-04-25 18:49:59 -05:00
+++ b/storage/falcon/RecordScavenge.cpp 2008-04-26 22:13:21 -05:00
@@ -23,11 +23,11 @@
#include "Sync.h"
-RecordScavenge::RecordScavenge(Database *db, TransId oldestTransaction, bool forced)
+RecordScavenge::RecordScavenge(Database *db, TransId oldestTransaction, bool wasForced)
{
database = db;
transactionId = oldestTransaction;
- wasForced = forced;
+ forced = wasForced;
baseGeneration = database->currentGeneration;
memset(ageGroups, 0, sizeof(ageGroups));
recordsReclaimed = 0;
@@ -83,7 +83,7 @@ int RecordScavenge::computeThreshold(uin
totalSpace += overflowSpace;
- if (wasForced || (scavengeGeneration == 0 && totalSpace > target))
+ if (forced || (scavengeGeneration == 0 && totalSpace > target))
scavengeGeneration = baseGeneration + AGE_GROUPS;
return scavengeGeneration;
diff -Nrup a/storage/falcon/RecordScavenge.h b/storage/falcon/RecordScavenge.h
--- a/storage/falcon/RecordScavenge.h 2008-04-05 13:38:38 -05:00
+++ b/storage/falcon/RecordScavenge.h 2008-04-26 22:13:21 -05:00
@@ -39,9 +39,9 @@ public:
uint64 overflowSpace;
uint64 totalSpace;
uint64 recordSpace;
- bool wasForced;
+ bool forced;
- RecordScavenge(Database *db, TransId oldestTransaction, bool forced);
+ RecordScavenge(Database *db, TransId oldestTransaction, bool wasForced);
~RecordScavenge(void);
void inventoryRecord(Record* record);
diff -Nrup a/storage/falcon/RecordVersion.cpp b/storage/falcon/RecordVersion.cpp
--- a/storage/falcon/RecordVersion.cpp 2008-04-24 23:42:09 -05:00
+++ b/storage/falcon/RecordVersion.cpp 2008-04-26 22:13:21 -05:00
@@ -189,13 +189,15 @@ bool RecordVersion::scavenge(RecordScave
// 2. Record Version is older than the record version that was visible
// to the oldest active transaction AND
// 3. Either the record generation is older than the current generation
+ // OR the scavenge is forced
// OR there is no record data associated with the record version.
if ( useCount == 1
&& !transaction
&& transactionId < recordScavenge->transactionId
&& (!hasRecord()
- || generation <= recordScavenge->scavengeGeneration))
+ || generation <= recordScavenge->scavengeGeneration
+ || recordScavenge->forced))
{
// Expunge all record versions prior to this
@@ -213,7 +215,7 @@ bool RecordVersion::scavenge(RecordScave
// Scavenge criteria not met for this base record, so check prior versions.
- if (priorVersion && recordScavenge->scavengeGeneration != UNDEFINED)
+ if (priorVersion && (recordScavenge->forced ||
recordScavenge->scavengeGeneration != UNDEFINED))
{
// Scavenge prior record versions only if we have an exclusive lock on
| Thread |
|---|
| • bk commit into 6.0 tree (cpowers:1.2651) BUG#36330 | cpowers | 27 Apr 2008 |