Bug #42542 falcon_bug_28095 crashes in StorageHandler::dropTempTables
Submitted: 2 Feb 2009 12:24 Modified: 7 May 2009 16:59
Reporter: Vladislav Vaintroub Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Falcon storage engine Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: Vladislav Vaintroub CPU Architecture:Any
Tags: F_PAGE IO
Triage: Triaged: D1 (Critical)

[2 Feb 2009 12:24] Vladislav Vaintroub
Description:
Falcon_bug_28095 fails on pushbuild. 
Falcon crashes in StorageHandler::dropTempTables called during database restart.

How to repeat:
see latest pushbuild1
[2 Feb 2009 12:39] Vladislav Vaintroub
Stacktrace

/data0/pushbuild/pb/bzr_mysql-6.0-falcon-team/248/bzr_mysql-6.0-falcon-team-exp/sql/mysqld(Dbb::deleteSection(int, unsigned int)+0xfc) [0xa849ee]
/data0/pushbuild/pb/bzr_mysql-6.0-falcon-team/248/bzr_mysql-6.0-falcon-team-exp/sql/mysqld(Table::expunge(Transaction*)+0x65) [0xa39d1f]
/data0/pushbuild/pb/bzr_mysql-6.0-falcon-team/248/bzr_mysql-6.0-falcon-team-exp/sql/mysqld(Database::dropTable(Table*, Transaction*)+0x3bc) [0xa7a594]
/data0/pushbuild/pb/bzr_mysql-6.0-falcon-team/248/bzr_mysql-6.0-falcon-team-exp/sql/mysqld(Nfs::Statement::dropTable(Syntax*)+0x6d) [0xb16f63]
/data0/pushbuild/pb/bzr_mysql-6.0-falcon-team/248/bzr_mysql-6.0-falcon-team-exp/sql/mysqld(Nfs::Statement::executeDDL()+0x2be) [0xb1ade8]
/data0/pushbuild/pb/bzr_mysql-6.0-falcon-team/248/bzr_mysql-6.0-falcon-team-exp/sql/mysqld(Nfs::Statement::execute(char const*, bool)+0x107) [0xb1c099]
/data0/pushbuild/pb/bzr_mysql-6.0-falcon-team/248/bzr_mysql-6.0-falcon-team-exp/sql/mysqld(Nfs::Statement::execute(char const*)+0x22) [0xb1c124]
/data0/pushbuild/pb/bzr_mysql-6.0-falcon-team/248/bzr_mysql-6.0-falcon-team-exp/sql/mysqld(Nfs::Statement::executeUpdate(char const*)+0x36) [0xb1298c]
/data0/pushbuild/pb/bzr_mysql-6.0-falcon-team/248/bzr_mysql-6.0-falcon-team-exp/sql/mysqld(StorageHandler::dropTempTables()+0x140) [0xa2a7f0]
/data0/pushbuild/pb/bzr_mysql-6.0-falcon-team/248/bzr_mysql-6.0-falcon-team-exp/sql/mysqld(StorageHandler::initialize()+0xae) [0xa2ccc0]
/data0/pushbuild/pb/bzr_mysql-6.0-falcon-team/248/bzr_mysql-6.0-falcon-team-exp/sql/mysqld(StorageInterface::falcon_init(void*)+0x293) [0xa2410d]
/data0/pushbuild/pb/bzr_mysql-6.0-falcon-team/248/bzr_mysql-6.0-falcon-team-exp/sql/mysqld(ha_initialize_handlerton(st_plugin_int*)+0xa0) [0x88377e]
/data0/pushbuild/pb/bzr_mysql-6.0-falcon-team/248/bzr_mysql-6.0-falcon-team-exp/sql/mysqld [0x93f5dc]
/data0/pushbuild/pb/bzr_mysql-6.0-falcon-team/248/bzr_mysql-6.0-falcon-team-exp/sql/mysqld(plugin_init(int*, char**, int)+0x650) [0x940a2a]
/data0/pushbuild/pb/bzr_mysql-6.0-falcon-team/248/bzr_mysql-6.0-falcon-team-exp/sql/mysqld [0x728404]
/data0/pushbuild/pb/bzr_mysql-6.0-falcon-team/248/bzr_mysql-6.0-falcon-team-exp/sql/mysqld(main+0x1f1) [0x72933d
[2 Feb 2009 13:01] 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/64862

2991 Vladislav Vaintroub	2009-02-02
      Bug #42542 falcon_bug_28095 crashes in StorageHandler::dropTempTables 
      
      The reason for the crash is accessing Dbb::sections , which is NULL pointer in this case (temp tablespace is not opened during recovery)
      
      Solution:
      Make Dbb::sections an array instead of pointer, that  is initialized only when tablespace is created or opened. Initialize this array with NULLs in Dbb constructor.
      
      No test case provided,  it seems quite tricky to create one, we should get a serial log that does not try to open temp tablespace during recovery.
      (checkpoint or switching log files twice would do the trick).
[2 Feb 2009 17:46] Kevin Lewis
Vlad, good fix.  To clarify something I did not understand from your description, the sections hash table is still a hash table.  But the bucket array is now a member of the class, initialized in the constructor, instead of allocated when needed.
[2 Feb 2009 17:59] Vladislav Vaintroub
Kevin ,yes, the hashtable remains hashtable. the array of buckets is just always inited during constructor not later
[13 Feb 2009 7:24] Bugs System
Pushed into 6.0.10-alpha (revid:alik@sun.com-20090211182317-uagkyj01fk30p1f8) (version source revid:vvaintroub@mysql.com-20090202130038-11e85n0j2qr52xkv) (merge vers: 6.0.10-alpha) (pib:6)
[7 May 2009 16:59] MC Brown
Internal/test fix. No changelog entry required.