#At file:///G:/bzr/mysql-6.0-falcon-team/ based on revid:vvaintroub@stripped
2985 Vladislav Vaintroub 2009-01-29
Bug #42448 assertion in IO::writePage in recovery
Problem:
If a log record SRLSectionPage is processed , redoSectionPage assumes it needs to create a new Section page. It is not always true, pageNumber 0 indicates section will be deleted. Currently, redoSectionPage will create a new section page 0 and mark it dirty. However, page number 0 is reserved for tablespace header, and IO::writePage has corresponding assertion for it. recovery will crash in this assertion ,once newly created section page 0 is written to disk.
Fix : do not create section page 0 in recovery.
modified:
storage/falcon/Section.cpp
=== modified file 'storage/falcon/Section.cpp'
--- a/storage/falcon/Section.cpp 2009-01-28 11:01:08 +0000
+++ b/storage/falcon/Section.cpp 2009-01-29 13:30:26 +0000
@@ -1203,6 +1203,7 @@ bool Section::isCleanupRequired()
}
***/
+
void Section::redoSectionPage(Dbb *dbb, int32 parentPage, int32 pageNumber, int slot, int sectionId, int sequence, int level)
{
Bdb *bdb = dbb->fetchPage (parentPage, PAGE_sections, Exclusive);
@@ -1210,20 +1211,24 @@ void Section::redoSectionPage(Dbb *dbb,
SectionPage *page = (SectionPage*) bdb->buffer;
- Bdb *sectionBdb = dbb->fakePage(pageNumber, PAGE_any, 0);
- BDB_HISTORY(bdb);
- SectionPage *sectionPage = (SectionPage*) sectionBdb->buffer;
- memset(sectionPage, 0, dbb->pageSize);
- sectionBdb->setPageHeader(PAGE_sections);
- sectionPage->section = sectionId;
- sectionPage->sequence = sequence;
- sectionPage->level = level;
-
- PageInventoryPage::markPageInUse(dbb, pageNumber, NO_TRANSACTION);
- sectionBdb->release(REL_HISTORY);
+ // If page number != 0, we are creating a new section page
+ // Otherwise, the log record comes from deleteSection and we just need to
+ // clear the slot in the parent pade
+ if (pageNumber != 0)
+ {
+ Bdb *sectionBdb = dbb->fakePage(pageNumber, PAGE_any, 0);
+ BDB_HISTORY(bdb);
+ SectionPage *sectionPage = (SectionPage*) sectionBdb->buffer;
+ memset(sectionPage, 0, dbb->pageSize);
+ sectionBdb->setPageHeader(PAGE_sections);
+ sectionPage->section = sectionId;
+ sectionPage->sequence = sequence;
+ sectionPage->level = level;
- // Now store it in the right place
+ PageInventoryPage::markPageInUse(dbb, pageNumber, NO_TRANSACTION);
+ sectionBdb->release(REL_HISTORY);
+ }
if (page->pages[slot] != pageNumber)
{