2802 Christopher Powers 2008-08-27 [merge]
(no message)
2801 Christopher Powers 2008-08-27
Bug #38566 Falcon crash in RecordVersion::thaw at RecordVersion.cpp:421
Removed unnecessary log messages
Modified assertions to accommodate race condition where two threads thaw the same record
modified:
storage/falcon/RecordVersion.cpp
storage/falcon/SRLUpdateRecords.cpp
2800 Kevin Lewis 2008-08-25
Bug#39025 Wrte pages to the serial log in this order;
1) The new right page first,
2) then the previously existing left page (which is now half full),
3) then the parent page
modified:
storage/falcon/Index2RootPage.cpp
storage/falcon/IndexRootPage.cpp
=== modified file 'storage/falcon/RecordVersion.cpp'
--- a/storage/falcon/RecordVersion.cpp 2008-07-15 18:57:27 +0000
+++ b/storage/falcon/RecordVersion.cpp 2008-08-27 07:08:18 +0000
@@ -416,11 +416,9 @@ int RecordVersion::thaw()
}
}
- if (bytesRestored <= 0)
- Log::debug("RecordVersion::thaw: writePending %d, was %d, recordFetched %d, data %p\n",
- trans->writePending, wasWritePending, recordFetched, data.record);
-
- ASSERT(bytesRestored > 0 || data.record == NULL);
+ if (state == recChilled)
+ ASSERT(bytesRestored > 0 || data.record == NULL);
+
state = recData;
return bytesRestored;
=== modified file 'storage/falcon/SRLUpdateRecords.cpp'
--- a/storage/falcon/SRLUpdateRecords.cpp 2008-04-09 08:23:51 +0000
+++ b/storage/falcon/SRLUpdateRecords.cpp 2008-08-27 07:08:18 +0000
@@ -84,34 +84,39 @@ int SRLUpdateRecords::thaw(RecordVersion
// Get section id, record id and data length written. Input pointer will be at
// beginning of record data.
- int tableSpaceId;
+ int tableSpaceId = 0;
if (control->version >= srlVersion8)
tableSpaceId = control->getInt();
- else
- tableSpaceId = 0;
control->getInt(); // sectionId
int recordNumber = control->getInt();
int dataLength = control->getInt();
- ASSERT(recordNumber == record->recordNumber);
- int bytesReallocated = record->setRecordData(control->input, dataLength);
+ int bytesReallocated = 0;
+
+ // setRecordData() handles race conditions with an interlocked compare and exchange,
+ // but check the state and record number anyway
- if (bytesReallocated > 0)
- bytesReallocated = record->getEncodedSize();
+ if (record->state == recChilled && recordNumber == record->recordNumber)
+ bytesReallocated = record->setRecordData(control->input, dataLength);
window->deactivateWindow();
- if (log->chilledRecords > 0)
- log->chilledRecords--;
+ if (bytesReallocated > 0)
+ {
+ ASSERT(recordNumber == record->recordNumber);
+ bytesReallocated = record->getEncodedSize();
+ *thawed = true;
+
+ if (log->chilledRecords > 0)
+ log->chilledRecords--;
- if (log->chilledBytes > uint64(bytesReallocated))
- log->chilledBytes -= bytesReallocated;
- else
- log->chilledBytes = 0;
-
- *thawed = true;
-
+ if (log->chilledBytes > uint64(bytesReallocated))
+ log->chilledBytes -= bytesReallocated;
+ else
+ log->chilledBytes = 0;
+ }
+
return bytesReallocated;
}
| Thread |
|---|
| • bzr push into mysql-6.0-falcon branch (cpowers:2800 to 2802) | Christopher Powers | 27 Aug |