Below is the list of changes that have just been committed into a local
6.0 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-10-11 10:32:43-04:00, jas@rowvwade. +8 -0
Changed serial log checkpoint order of battle to accomodate
synchronous flushes.
storage/falcon/Cache.cpp@stripped, 2007-10-11 10:32:33-04:00, jas@rowvwade. +4 -3
Changed serial log checkpoint order of battle to accomodate
synchronous flushes.
storage/falcon/Cache.h@stripped, 2007-10-11 10:32:33-04:00, jas@rowvwade. +5 -5
Changed serial log checkpoint order of battle to accomodate
synchronous flushes.
storage/falcon/Database.cpp@stripped, 2007-10-11 10:32:33-04:00, jas@rowvwade. +10 -5
Changed serial log checkpoint order of battle to accomodate
synchronous flushes.
storage/falcon/Database.h@stripped, 2007-10-11 10:32:34-04:00, jas@rowvwade. +2 -2
Changed serial log checkpoint order of battle to accomodate
synchronous flushes.
storage/falcon/Dbb.cpp@stripped, 2007-10-11 10:32:34-04:00, jas@rowvwade. +1 -1
Changed serial log checkpoint order of battle to accomodate
synchronous flushes.
storage/falcon/SerialLog.cpp@stripped, 2007-10-11 10:32:34-04:00, jas@rowvwade. +25 -17
Changed serial log checkpoint order of battle to accomodate
synchronous flushes.
storage/falcon/SerialLog.h@stripped, 2007-10-11 10:32:35-04:00, jas@rowvwade. +1 -1
Changed serial log checkpoint order of battle to accomodate
synchronous flushes.
storage/falcon/Transaction.cpp@stripped, 2007-10-11 10:32:35-04:00, jas@rowvwade. +1 -0
Trivial edit for consistency.
diff -Nrup a/storage/falcon/Cache.cpp b/storage/falcon/Cache.cpp
--- a/storage/falcon/Cache.cpp 2007-10-10 12:21:22 -04:00
+++ b/storage/falcon/Cache.cpp 2007-10-11 10:32:33 -04:00
@@ -333,12 +333,13 @@ Bdb* Cache::fakePage(Dbb *dbb, int32 pag
return bdb;
}
-void Cache::flush()
+void Cache::flush(int64 arg)
{
Sync flushLock(&syncFlush, "Cache::ioThread");
Sync sync(&syncDirty, "Cache::ioThread");
flushLock.lock(Exclusive);
sync.lock(Shared);
+ flushArg = arg;
for (Bdb *bdb = firstDirty; bdb; bdb = bdb->nextDirty)
{
@@ -827,7 +828,7 @@ void Cache::setPageWriter(PageWriter *wr
pageWriter = writer;
}
-void Cache::shutdownNow()
+void Cache::shutdownNow(void)
{
panicShutdown = true;
Sync sync (&syncDirty, "Cache::shutdownNow");
@@ -1004,7 +1005,7 @@ void Cache::ioThread(void)
{
flushing = false;
flushLock.unlock();
- database->pageCacheFlushed();
+ database->pageCacheFlushed(flushArg);
}
else
flushLock.unlock();
diff -Nrup a/storage/falcon/Cache.h b/storage/falcon/Cache.h
--- a/storage/falcon/Cache.h 2007-10-10 12:21:23 -04:00
+++ b/storage/falcon/Cache.h 2007-10-11 10:32:33 -04:00
@@ -41,7 +41,8 @@ class Bitmap;
class Cache
{
public:
- void shutdownNow();
+ void shutdownNow(void);
+ void shutdown(void);
Bdb* probePage(Dbb *dbb, int32 pageNumber);
void setPageWriter (PageWriter *writer);
bool hasDirtyPages (Dbb *dbb);
@@ -56,7 +57,7 @@ public:
void markDirty (Bdb *bdb);
void validate();
void moveToHead (Bdb *bdb);
- void flush();
+ void flush(int64 arg);
void validateCache(void);
//void purifier(void);
void syncFile(Dbb *dbb, const char *text);
@@ -77,6 +78,7 @@ public:
Database *database;
int numberBuffers;
bool panicShutdown;
+ bool flushing;
protected:
Bdb* findBuffer (Dbb *dbb, int pageNumber, LockType lockType);
@@ -100,10 +102,8 @@ protected:
int numberHunks;
int numberDirtyPages;
int numberIoThreads;
+ int64 flushArg;
volatile int bufferAge;
- bool flushing;
-public:
- void shutdown(void);
};
#endif // !defined(AFX_CACHE_H__6A019C1F_A340_11D2_AB5A_0000C01D2301__INCLUDED_)
diff -Nrup a/storage/falcon/Database.cpp b/storage/falcon/Database.cpp
--- a/storage/falcon/Database.cpp 2007-10-10 12:21:23 -04:00
+++ b/storage/falcon/Database.cpp 2007-10-11 10:32:33 -04:00
@@ -1199,10 +1199,15 @@ Transaction* Database::startTransaction(
}
-void Database::flush()
+bool Database::flush(int64 arg)
{
+ if (cache->flushing)
+ return false;
+
serialLog->preFlush();
- cache->flush();
+ cache->flush(arg);
+
+ return true;
}
void Database::commitSystemTransaction()
@@ -1457,7 +1462,7 @@ void Database::shutdown()
if (repositoryManager)
repositoryManager->close();
- flush();
+ flush(0);
if (scheduler)
scheduler->shutdown(false);
@@ -2297,7 +2302,7 @@ void Database::debugTrace(void)
falcon_debug_trace = 0;
}
-void Database::pageCacheFlushed(void)
+void Database::pageCacheFlushed(int64 flushArg)
{
- serialLog->pageCacheFlushed();
+ serialLog->pageCacheFlushed(flushArg);
}
diff -Nrup a/storage/falcon/Database.h b/storage/falcon/Database.h
--- a/storage/falcon/Database.h 2007-10-10 12:21:23 -04:00
+++ b/storage/falcon/Database.h 2007-10-11 10:32:34 -04:00
@@ -179,7 +179,7 @@ public:
void clearDebug();
void setDebug();
void commitSystemTransaction();
- void flush();
+ bool flush(int64 arg);
Transaction* startTransaction(Connection *connection);
CompiledStatement* getCompiledStatement (Connection *connection, const char *sqlString);
@@ -212,7 +212,7 @@ public:
void setRecordScavengeFloor(int value);
void forceRecordScavenge(void);
void debugTrace(void);
- void pageCacheFlushed(void);
+ void pageCacheFlushed(int64 flushArg);
Dbb *dbb;
Cache *cache;
diff -Nrup a/storage/falcon/Dbb.cpp b/storage/falcon/Dbb.cpp
--- a/storage/falcon/Dbb.cpp 2007-10-10 12:21:24 -04:00
+++ b/storage/falcon/Dbb.cpp 2007-10-11 10:32:34 -04:00
@@ -875,7 +875,7 @@ Section* Dbb::getSequenceSection(TransId
Hdr *headerPage = (Hdr*) bdb->buffer;
headerPage->sequenceSectionId = sequenceSectionId;
bdb->release(REL_HISTORY);
- cache->flush();
+ cache->flush((int64) 0);
}
// Find action section
diff -Nrup a/storage/falcon/SerialLog.cpp b/storage/falcon/SerialLog.cpp
--- a/storage/falcon/SerialLog.cpp 2007-10-10 12:21:25 -04:00
+++ b/storage/falcon/SerialLog.cpp 2007-10-11 10:32:34 -04:00
@@ -978,12 +978,36 @@ void SerialLog::checkpoint(bool force)
sync.lock(Shared);
int64 blockNumber = writeBlock->blockNumber;
sync.unlock();
- database->flush();
+ database->flush(blockNumber);
+ /*** moved to pageCacheFlushed()
database->sync(0);
logControl->checkpoint.append(blockNumber);
+ ***/
}
}
+void SerialLog::pageCacheFlushed(int64 blockNumber)
+{
+ if (blockNumber)
+ {
+ database->sync(0);
+ logControl->checkpoint.append(blockNumber);
+ }
+
+ lastFlushBlock = preFlushBlock;
+ Sync sync(&pending.syncObject, "SerialLog::pageCacheFlushed"); // pending.syncObject
use for both
+ sync.lock(Exclusive);
+
+ for (SerialLogTransaction *transaction, **ptr = &inactions.first; (transaction =
*ptr);)
+ if (transaction->flushing && transaction->maxBlockNumber <
lastFlushBlock)
+ {
+ inactions.remove(transaction);
+ delete transaction;
+ }
+ else
+ ptr = &transaction->next;
+}
+
void SerialLog::initializeWriteBlock(SerialLogBlock *block)
{
writeBlock = block;
@@ -1174,22 +1198,6 @@ void SerialLog::preFlush(void)
for (SerialLogTransaction *action = inactions.first; action; action = action->next)
action->flushing = true;
-}
-
-void SerialLog::pageCacheFlushed()
-{
- lastFlushBlock = preFlushBlock;
- Sync sync(&pending.syncObject, "SerialLog::pageCacheFlushed"); // pending.syncObject
use for both
- sync.lock(Exclusive);
-
- for (SerialLogTransaction *transaction, **ptr = &inactions.first; (transaction =
*ptr);)
- if (transaction->flushing && transaction->maxBlockNumber <
lastFlushBlock)
- {
- inactions.remove(transaction);
- delete transaction;
- }
- else
- ptr = &transaction->next;
}
int SerialLog::recoverLimboTransactions(void)
diff -Nrup a/storage/falcon/SerialLog.h b/storage/falcon/SerialLog.h
--- a/storage/falcon/SerialLog.h 2007-10-04 16:45:27 -04:00
+++ b/storage/falcon/SerialLog.h 2007-10-11 10:32:35 -04:00
@@ -81,7 +81,7 @@ public:
virtual ~SerialLog();
void putVersion();
- void pageCacheFlushed();
+ void pageCacheFlushed(int64 flushArg);
void releaseBuffer (UCHAR *buffer);
UCHAR* allocBuffer();
diff -Nrup a/storage/falcon/Transaction.cpp b/storage/falcon/Transaction.cpp
--- a/storage/falcon/Transaction.cpp 2007-10-05 18:14:30 -04:00
+++ b/storage/falcon/Transaction.cpp 2007-10-11 10:32:35 -04:00
@@ -411,6 +411,7 @@ void Transaction::rollback()
record->nextInTrans = stack;
stack = record;
}
+
lastRecord = NULL;
while (stack)
| Thread |
|---|
| • bk commit into 6.0 tree (jas:1.2637) | U-ROWVWADEjas | 11 Oct |