List:Falcon Storage Engine« Previous MessageNext Message »
From:Christopher Powers Date:January 15 2009 1:03am
Subject:More on Scavenge vs DDL
View as plain text  
I decoupled updateCardinalities() from the Scavenger and moved it on to 
its own thread. Now, each scavenge simply signals it and moves on, no 
waiting on syncSysDDL.

BUT...

Database::scavengeRecords() commits pending system transactions, which 
of course requires a lock syncSysDDL. In the old code, this was done 
only inside of syncScavenge AND if the scavenge was not 'forced'.

Load-based scavenges are the current equivalent of forced scavenges, and 
also should not commit pending system transactions.


// NEW CODE

void Database::scavengeRecords(void)
{
    // Commit pending system transactions before proceeding

    if (systemConnection->transaction)
       commitSystemTransaction();

    Sync syncScavenger(&syncScavenge, 
"Database::scavengeRecords(Scavenge)");
    syncScavenger.lock(Exclusive)
[...]


// OLD CODE

void Database::retireRecords(bool forced)
{
     int cycle = scavengeCycle;
	
     Sync syncScavenger(&syncScavenge, "Database::retireRecords(1)");
     syncScavenger.lock(Exclusive);

     if (forced && scavengeCycle > cycle)
        return;
	
     // Commit pending system transactions before proceeding
	
     if (!forced && systemConnection->transaction)
        commitSystemTransaction();
Thread
More on Scavenge vs DDLChristopher Powers15 Jan
  • RE: More on Scavenge vs DDLVladislav Vaintroub15 Jan
    • Re: More on Scavenge vs DDLChristopher Powers15 Jan
      • RE: More on Scavenge vs DDLVladislav Vaintroub15 Jan
        • Re: More on Scavenge vs DDLChristopher Powers15 Jan
  • Re: More on Scavenge vs DDLChristopher Powers15 Jan