Bug #33349 possible race condition revolving around data dictionary and repartitioning
Submitted: 19 Dec 2007 1:18 Modified: 20 Jun 2010 0:52
Reporter: Matthew Lord Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.1.22 OS:Any
Assigned to: CPU Architecture:Any
Tags: data dictionary, fixed in pre-v6, partitioning, v6

[19 Dec 2007 1:18] Matthew Lord
Description:
It looks like a race condition is possible when this command is run:

alter table foo partition pmax into
( partition p733384 values less than (733384) ENGINE = InnoDB,
partition pmax values less than maxvalue)

The same basic command at times shows this error although everything was completed successfully:
[ERROR] Cannot find table test/foo#P#p733384 from the internal data dictionary of InnoDB though the .frm file for the table exists....

How to repeat:
N/A

Suggested fix:
Perhaps we could add sleep/retry logic inside InnoDB and allow for some additional
logging.
[19 Feb 2008 16:45] 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/42567

ChangeSet@1.2531, 2008-02-19 09:44:09-07:00, tsmith@ramayana.hindu.god +24 -0
  Applied InnoDB snapshot innodb-5.1-ss2298
  
  Fixes the following bugs:
  
  - Bug #33349: possible race condition revolving around data dictionary and repartitioning
    Introduce retry/sleep logic as a workaround for a transient bug
    where ::open fails for partitioned tables randomly if we are using
    one file per table.
  
  - Bug #34053: normal users can enable innodb_monitor logging
    In CREATE TABLE and DROP TABLE check whether the table in question is one
    of the magic innodb_monitor tables and whether the user has enough rights
    to mess with it before doing anything else.
  
  - Bug #22868: 'Thread thrashing' with > 50 concurrent conns under an upd-intensive workloadw
  - Bug #29560: InnoDB >= 5.0.30 hangs on adaptive hash rw-lock 'waiting for an X-lock'
    This is a combination of changes that forward port the scalability fix applied to 5.0
    through r1001.
    It reverts changes r149 and r122 (these were 5.1 specific changes made in lieu of
    scalability fix of 5.0)
    Then it applies r1001 to 5.0 which is the original scalability fix.
    Finally it applies r2082 which fixes an issue with the original fix.
  
  - Bug #30930: Add auxiliary function to retrieve THD::thread_id
    Add thd_get_thread_id() function.  Also make check_global_access() function
    visible to InnoDB under INNODB_COMPATIBILITY_HOOKS #define.
[20 Feb 2008 23:47] Timothy Smith
Queued in 5.1-build.  NOT applied to 6.0, yet.  Docs team, please return it to "Patch approved", waiting for a 6.0 snapshot from InnoDB devs.
[25 Feb 2008 15:58] Bugs System
Pushed into 5.1.24-rc
[25 Feb 2008 16:04] Bugs System
Pushed into 6.0.5-alpha
[25 Feb 2008 19:06] Paul DuBois
Noted in 5.1.24 changelog.

For InnoDB tables, there was a race condition involving the data
dictionary and repartitioning. 

Resetting to Patch Approved waiting for push into 6.0.x.
[2 Apr 2008 16:00] Jon Stephens
Also documented fix in the 5.1.23-ndb-6.3.11 changelog.

Left status as Patch Approved pending 6.0 push.
[24 Jun 2008 21:12] Calvin Sun
Merged into 6.0.6-alpha, according to Tim.
[25 Jun 2008 1:55] Paul DuBois
Noted in 6.0.6 changelog.
[5 May 2010 15:15] Bugs System
Pushed into 5.1.47 (revid:joro@sun.com-20100505145753-ivlt4hclbrjy8eye) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[6 May 2010 13:38] Paul DuBois
Push resulted from incorporation of InnoDB tree. No changes pertinent to this bug.
Re-closing.
[28 May 2010 5:57] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100524190136-egaq7e8zgkwb9aqi) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (pib:16)
[28 May 2010 6:26] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100524190941-nuudpx60if25wsvx) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[28 May 2010 6:54] Bugs System
Pushed into 5.5.5-m3 (revid:alik@sun.com-20100524185725-c8k5q7v60i5nix3t) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[29 May 2010 22:58] Paul DuBois
Push resulted from incorporation of InnoDB tree. No changes pertinent to this bug.
Re-closing.
[17 Jun 2010 11:59] Bugs System
Pushed into 5.1.47-ndb-7.0.16 (revid:martin.skold@mysql.com-20100617114014-bva0dy24yyd67697) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[17 Jun 2010 12:40] Bugs System
Pushed into 5.1.47-ndb-6.2.19 (revid:martin.skold@mysql.com-20100617115448-idrbic6gbki37h1c) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[17 Jun 2010 13:25] Bugs System
Pushed into 5.1.47-ndb-6.3.35 (revid:martin.skold@mysql.com-20100617114611-61aqbb52j752y116) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)