#At file:///C:/Work/bzr/Merge/mysql-6.0-falcon-team/ based on revid:kevin.lewis@stripped
2725 Kevin Lewis 2009-06-10
Bug#36631 - Make sure all serial log windows are almost 1 Mb even when the falcon-record-chill-threshold is set below 1 Mb.
SRLUpdateRecords::append() steps through the records in a transaction with two embedded loops. The inner loop has two places where execution can break out. When it does, and there are still more records to process, writeWindow will be flushed and a new writeWindow will be created. One of these break conditions is appropriate for starting a new window and the other is not.
The first condition has this comnment.
// If this is a different savepoint, break out of the inner loop
// and start another serial log record
There should be a different serial log record for each savepoint, but it does not need to start a new writeWindow. When large transactions must chill records changed at different savepoints, this code path was causing the serial log windows to use less that the full 1 Mb available in the buffer. This waisted space and increased the chances that the previous patch for this bug occurred.
The second break in the inner loop has this comment;
// Ensure record fits within current window
The code is designed to predict if a record will not fit in the current window. If not, it would explicitly flush the old writeWindow, start a new writeWindow, and put the current record there. The ability to break to a new window at any time is built into putdata, but for the purposes af thawing, we need to be able to thaw an entire record from the same serialLogRecord.
To distinguish between thew two purposes of breaking out of the inner loop, the code now uses a boolean called forceNewWindow.
=== modified file 'storage/falcon/SRLUpdateRecords.cpp'
--- a/storage/falcon/SRLUpdateRecords.cpp 2009-06-10 07:36:02 +0000
+++ b/storage/falcon/SRLUpdateRecords.cpp 2009-06-10 23:54:03 +0000
@@ -142,6 +142,7 @@ void SRLUpdateRecords::append(Transactio
uint32 chilledRecordsWindow = 0;
SerialLogTransaction *srlTrans = NULL;
+ bool forceNewWindow = false;
// Generate one serial log record per write window. To ensure that
// chilled records are grouped by savepoint, start a new serial
@@ -240,7 +241,10 @@ void SRLUpdateRecords::append(Transactio
byteCount(stream.totalLength) + stream.totalLength >= end)
+ forceNewWindow = true;
ASSERT(record->recordNumber >= 0);
ASSERT(log->writePtr > (UCHAR *)log->writeWindow->buffer);
@@ -270,10 +274,14 @@ void SRLUpdateRecords::append(Transactio
if (len > 0)
- // Flush record data, if any, and force the creation of a new serial log window
+ // If the current record does not fit in the window,
+ // flush this writeWindow and create a new serial log window.
- if (record && len > 0)
+ if (forceNewWindow)
log->flush(true, 0, &sync);
+ forceNewWindow = false;
Attachment: [text/bzr-bundle] firstname.lastname@example.org
|• bzr commit into mysql-6.0-falcon-team branch (kevin.lewis:2725)Bug#36631||Kevin Lewis||11 Jun|