List:Commits« Previous MessageNext Message »
From:Vladislav Vaintroub Date:April 7 2009 5:43pm
Subject:bzr commit into mysql-6.0-falcon-team branch (vvaintroub:3105)
Bug#44114
View as plain text  
#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). 
      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 17:42:58 +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,26 @@ 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.
+
+		if (falcon_use_sectorcache && page->pageType == 0)
+			{
+			//All zero pages possible when using sector cache
+			ASSERT(page->pageNumber == 0);
+			}
+		else if(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, page->pageType);
+			}
+
+
 		if (falcon_checksums)
 			page->checksum = computeChecksum(page, pageSize);
  		else


Attachment: [text/bzr-bundle] bzr/vvaintroub@mysql.com-20090407174258-kb4putkvr9gn30n9.bundle
Thread
bzr commit into mysql-6.0-falcon-team branch (vvaintroub:3105)Bug#44114Vladislav Vaintroub7 Apr