Bug #42824 Falcon assertion (lockType == Exclusive) in Bdb::mark on REPAIR
Submitted: 13 Feb 2009 10:37 Modified: 15 May 2009 15:59
Reporter: Philip Stoev Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Falcon storage engine Severity:S1 (Critical)
Version:6.0-falcon-team OS:Any
Assigned to: Vladislav Vaintroub CPU Architecture:Any
Tags: F_PAGE IO

[13 Feb 2009 10:37] Philip Stoev
Description:
After recovery, executing REPAIR on the attached tablespace causes the following crash:

[Falcon] Error: assertion (lockType == Exclusive) failed at line 84 in file BDB.cpp

./mysqld(Error::assertionFailed(char const*, char const*, int)+0x2d) [0x9e3d13]
./mysqld(Bdb::mark(unsigned int)+0x4e) [0xa86558]
./mysqld(PageInventoryPage::validateInventory(Dbb*, Validation*)+0x1a1) [0xa1a7a1]
./mysqld(Dbb::validate(int)+0xc3) [0x9d8cdd]
./mysqld(TableSpaceManager::validate(int)+0x57) [0x9990c7]
./mysqld(Database::validate(int)+0xb3) [0x9d1e4d]
./mysqld(Connection::validate(int)+0x2c) [0x9c3182]
./mysqld(StorageConnection::validate(int)+0x45) [0x97461b]
./mysqld(StorageInterface::repair(THD*, st_ha_check_opt*)+0x65) [0x96a53f]
./mysqld(handler::ha_repair(THD*, st_ha_check_opt*)+0x3b) [0x816dab]
./mysqld [0x8407e1]
./mysqld(mysql_repair_table(THD*, TABLE_LIST*, st_ha_check_opt*)+0xb1) [0x841a29]
./mysqld(mysql_execute_command(THD*)+0x2a78) [0x6d4896]
./mysqld(mysql_parse(THD*, char const*, unsigned int, char const**)+0x273) [0x6da911]
./mysqld(dispatch_command(enum_server_command, THD*, char*, unsigned int)+0xa54) [0x6db4fc]
./mysqld(do_command(THD*)+0x22b) [0x6dca25]
./mysqld(handle_one_connection+0x11a) [0x6ca9f5]
/lib64/libpthread.so.0 [0x315b0073da]
/lib64/libc.so.6(clone+0x6d) [0x315a4e627d]
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0x42425a0 = repair table table10_falcon_int_autoinc
thd->thread_id=1
thd->killed=NOT_KILLED

How to repeat:
The tablespace will be attached shortly. Note that it appears to be corrupted, since those two equivalent queries return different data:

SELECT count(*) FROM `test`.`table10_falcon_int_autoinc`  WHERE `datetime_key` IS NULL OR `datetime_key` IS NOT NULL;
SELECT count(*) FROM `test`.`table10_falcon_int_autoinc` ;
[13 Feb 2009 10:39] Philip Stoev
The tablespace has been uploaded to

http://fedora10.dyndns.org/bug42824-2.zip
[13 Feb 2009 21:20] 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/66302

3019 Vladislav Vaintroub	2009-02-13
      Bug #42824 Falcon assertion (lockType == Exclusive) in Bdb::mark on REPAIR 
      
      Problem :repairof a Falcon tqable  can crash if it finds orphan pages (PageinventoryPage is marked dirty but not locked exclusively)
      
      Fix :fetch  PageInventoryPage in for exclusive access inshead of shared.
      modified:
        storage/falcon/PageInventoryPage.cpp

=== modified file 'storage/falcon/PageInventoryPage.cpp'
--- a/storage/falcon/PageInventoryPage.cpp	2009-01-27 20:44:30 +0000
+++ b/storage/falcon/PageInventoryPage.cpp	2009-02-13 21:19:58 +0000
@@ -333,7 +333,7 @@ void PageInventoryPage::validateInventor
 							else
 								freePage(dbb, pageNumber, NO_TRANSACTION);
 								
-							pipBdb = dbb->fetchPage (pageNumber, PAGE_any, Shared);
+							pipBdb = dbb->fetchPage (pageNumber, PAGE_any, Exclusive);
 							BDB_HISTORY(pipBdb);
 							page = (PageInventoryPage*) pipBdb->buffer;
 							}

-- 
MySQL Code Commits Mailing List
For list archives: http://lists.mysql.com/commits
To unsubscribe:    http://lists.mysql.com/commits?unsub=commits@bugs.mysql.com
[18 Feb 2009 19:13] Kevin Lewis
I guess the only way to prove that this works is to watch for this same call stack again.  Patch approved.
[2 Mar 2009 14:13] Bugs System
Pushed into 6.0.11-alpha (revid:alik@sun.com-20090302140208-lfdejjbcyezlhhjt) (version source revid:vvaintroub@mysql.com-20090213211958-t4jiz0vyms4zee0s) (merge vers: 6.0.10-alpha) (pib:6)
[15 May 2009 15:59] MC Brown
An update has been added to the 6.0.11 changelog: 

When running REPAIR on a crashed Falcon table can crash mysqld if pages have been incorrectly marked dirty, but not locked, during write