#At file:///G:/bzr/mysql-6.0-falcon-team/ based on revid:vvaintroub@stripped
3105 Vladislav Vaintroub 2009-04-07
Bug #44114 Falcon recovery Error: page 5342/1 wrong page type, expected 5 got 511
This patch makes sure pages written are valid (at least they have valid page types and page numbers)
Falcon will assert if garbage data is written to the tablespaces. This will make errors like "got page type 511" impossible. The actual error that
causes page corruption will be simpler to find.
modified:
storage/falcon/IO.cpp
=== modified file 'storage/falcon/IO.cpp'
--- a/storage/falcon/IO.cpp 2009-03-07 16:54:22 +0000
+++ b/storage/falcon/IO.cpp 2009-04-07 18:23:23 +0000
@@ -101,6 +101,7 @@ static int getLinuxVersion();
extern uint falcon_direct_io;
extern char falcon_checksums;
+extern char falcon_use_sectorcache;
static const int TRACE_SYNC_START = -1;
static const int TRACE_SYNC_END = -2;
@@ -362,8 +363,23 @@ void IO::writePages(int32 pageNumber, in
Page *page = (Page *)data;
- for (int i = 0;i < length/pageSize; i++ ,page = (Page *)((UCHAR *)page + pageSize))
+ for (int i = 0;i < length/pageSize; i++)
{
+
+ page = (Page *)((UCHAR *)page + pageSize);
+
+ // Do basic page validation before writing to disk, so we don't write garbage.
+ // Note that with check is skipped for "sector cache" because unallocated pages
+ // can be written.
+
+ if(!falcon_use_sectorcache &&
+ (page->pageNumber != pageNumber + i || page->pageType <= 0 || page->pageType >= PAGE_max))
+ {
+ FATAL("IO::writePages(): corrupted page %d (pageNumber = %d, pageType = %d)",
+ pageNumber + i, page->pageNumber, (int)page->pageType);
+ }
+
+
if (falcon_checksums)
page->checksum = computeChecksum(page, pageSize);
else
Attachment: [text/bzr-bundle] bzr/vvaintroub@mysql.com-20090407182323-qohwrke048hvp8hn.bundle
| Thread |
|---|
| • bzr commit into mysql-6.0-falcon-team branch (vvaintroub:3105)Bug#44114 | Vladislav Vaintroub | 7 Apr |