Bug #36538 Table locking refinements needed for multiple locks in a thread
Submitted: 6 May 2008 15:24 Modified: 17 Sep 2012 19:49
Reporter: Chuck Bell Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Locking Severity:S4 (Feature request)
Version:6.0.5 OS:Any
Assigned to: CPU Architecture:Any

[6 May 2008 15:24] Chuck Bell
Description:
The backup system is currently having to use a workaround to allow multiple calls to lock tables during a backup.

This is accomplished using a thread to open and lock tables for the default driver (see be_thread.h/.cc).

The reason this was created is because both the default driver and the consistent snapshot driver each need to open and lock tables. The backup kernel calls methods in the API to allow a driver to open and lock its tables. Since the open_and_lock_tables() method is designed to be called only once per thread, the backup system failed when a backup included tables that used both the default and consistent snapshot drivers.

This mechanism is not sufficient for long-term maintainability. The locking mechanism needs to be refined to allow operations like backup to open and lock tables more than once in a thread.

How to repeat:
Code inspection.

Suggested fix:
Suggestion: Refine locking mechanism to be independent of THD or at least allow for serialization state.
[17 Sep 2012 19:49] Sveta Smirnova
Set to "Verified" since can still be useful.