Bug #46975 | Thaw crashes with error SerialLog::findWindowGivenOffset -- can't find window | ||
---|---|---|---|
Submitted: | 28 Aug 2009 13:36 | Modified: | 26 May 2010 17:46 |
Reporter: | Olav Sandstå | Email Updates: | |
Status: | Unsupported | Impact on me: | |
Category: | MySQL Server: Falcon storage engine | Severity: | S2 (Serious) |
Version: | 6.0.12-alpha | OS: | Any |
Assigned to: | Kevin Lewis | CPU Architecture: | Any |
[28 Aug 2009 13:36]
Olav Sandstå
[28 Aug 2009 16:25]
Kevin Lewis
This is a new code path that showed an existing inconsistency. SerialLog::findWindowGivenOffset() was written to assert if the given virtualOffset was not found. But it was called assuming that it could fail. The reason that it never failed before was that RecordVersion::thaw only tried to thaw from the serial log if Transaction::writePending was false. But the following recent change by me for Bug#46377 changed the priority of where we try to thaw by eliminating the writePending check. The idea is that if there is a virtualOffset in the record, always try to thaw from the serial log. This is the right approach since what is in the page is only one version of the record, but all versions are in the serial log. So the correct fix is to delete the assert and allow SerialLog::findWindowGivenOffset() to just return NULL if the window is no longer found. And all callers should handle that NULL, as SRLUpdateRecords::thaw() would have done if the assert was not there. This is the change that exposed the bug; === modified file 'storage/falcon/RecordVersion.cpp' --- a/storage/falcon/RecordVersion.cpp 2009-07-14 14:09:58 +0000 +++ b/storage/falcon/RecordVersion.cpp 2009-08-20 14:59:55 +0000 @@ -419,17 +419,17 @@ char *RecordVersion::thaw() if (recordData != recordIsChilled) return recordData; - // First, try to thaw from the serial log. If transaction->writePending is - // true, then the record data can be restored from the serial log. If writePending - // is false, then the record data has been written to the data pages. - - Transaction *trans = findTransaction(); - if (trans) + // First, try to thaw from the serial log if there is a virtual offset. + + if (virtualOffset) { - if (trans->writePending && virtualOffset) + Transaction *trans = findTransaction(); + if (trans) + { recordData = trans->thaw(this, &bytesReallocated); - trans->release(); + trans->release(); + } }
[28 Aug 2009 17:10]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/81902 2775 Kevin Lewis 2009-08-28 Bug#46975 - SerialLog::findWindowGivenOffset() is expected by its callers to return NULL if the virtualOffset is not within the current portion of the serial log. But instead, it asserts that the woindow could not be read. This assert needs to be deleted. In addition, if this happens for a deferredIndex, SRLUpdateIndex::thaw() should issue a FATAL message instead of continuing with an unthawed index.