Bug #32465 Backup: Commit blocker does not block tables in default driver
Submitted: 17 Nov 2007 1:48 Modified: 26 Nov 2008 16:10
Reporter: Chuck Bell Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Backup Severity:S3 (Non-critical)
Version:6.0 OS:Any
Assigned to: Jørgen Løland CPU Architecture:Any

[17 Nov 2007 1:48] Chuck Bell
Description:
The default driver uses a thread to open and lock its tables. This action occurs prior to the commit blocker. The open and lock thread for the default driver executes and does not block even though the commit blocker is called after the tables are opened. Increased use of BACKUP_BREAKPOINT can verify this.

How to repeat:
Run the backup_commit_blocker test removing the commented out statements concerning table t4. When the test is run, the default driver will fail because the row that is being read has been deleted by a previous statement (which should have been allowed to complete and the backup blocked).

Suggested fix:
There are several possibilities. One or more of the following may apply:

a) The locking thread structure (THD) is not configured correctly and is not identified as having open tables when the commit blocker is fired.
b) The locking thread needs to be synchronized with the kernel. Right now, there is no way to know when the open and tables method is called until the locking thread is finished.
c) The methods the comprise the commit blocker are not identifying the locking thread and therefore not setting the appropriate values to block.
d) The default driver and the kernel are synchronized differently preventing the commit blocker from working correctly.
e) The breakpoints for the test are in the wrong place.
[21 Nov 2007 16:41] Chuck Bell
Latest observation shows the open_and_lock_tables() in be_thread.cc is not being blocked by the non-trx operation in progress. It should be blocked until the delete completes (the table is closed).
[12 Sep 2008 12:39] 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/53975

2694 Jorgen Loland	2008-09-12
      Bug#32465 - Backup: Commit blocker does not block tables in default driver
      
      The original bug has been resolved in another worklog. This patch 
      modifies backup_commit_blocker to test that the blocking works
[23 Sep 2008 15:30] Jørgen Løland
This functionality cannot be tested properly until bug#39602
[14 Oct 2008 11:59] Øystein Grøvlen
Does the commit blocker really need to block tables in default driver?
AFAIU, these tables will be locked during entire backup.  How can there be any transactions that have touched these tables that need to be prevented from committing?
[4 Nov 2008 7:44] Jørgen Løland
The commit blocker is global - it currently does not operate on single drivers.
[4 Nov 2008 8:21] 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/57747

2727 Jorgen Loland	2008-11-04
      Bug#32465 - Backup: Commit blocker does not block tables in default driver
                  
      This bug has been removed by an unknown fix, but a proper test case was never added.
                  
      The patch contains a commit blocker test written for the temporary commit blocker solution of setting Global Read Lock before backup prepare phase (fixed in bug#39602).
[4 Nov 2008 8:21] 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/57748

2727 Jorgen Loland	2008-11-04
      Bug#32465 - Backup: Commit blocker does not block tables in default driver
            
      This bug has been removed by an unknown fix, but a proper test case was never added.
            
      The patch contains a commit blocker test written for the temporary commit blocker solution of setting Global Read Lock before backup prepare phase (fixed in bug#39602).
[4 Nov 2008 8:21] 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/57749

2727 Jorgen Loland	2008-11-04
      Bug#32465 - Backup: Commit blocker does not block tables in default driver
      
      This bug has been removed by an unknown fix, but a proper test case was never added.
      
      The patch contains a commit blocker test written for the temporary commit blocker solution of setting Global Read Lock before backup prepare phase (fixed in bug#39602).
[4 Nov 2008 14:26] Chuck Bell
Patch approved pending fix of three comment-related requests:

1. Please clarify comment in patch header or remove it.
2. Please clarify comment in test header.
3. Please add comments for complex debug sync sequence.
[5 Nov 2008 9:38] 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/57861

2727 Jorgen Loland	2008-11-05
      Bug#32465 - Backup: Commit blocker does not block tables in default driver
      
      The patch contains a commit blocker test written for the temporary commit blocker solution of setting Global Read Lock before backup prepare phase (fixed in bug#39602).
[10 Nov 2008 13:18] 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/58333

2727 Jorgen Loland	2008-11-10
      Bug#32465 - Backup: Commit blocker does not block tables in default driver
            
      The patch contains commit blocker tests written for the temporary commit blocker solution of setting Global Read Lock before backup prepare phase (fixed in bug#39602).
[11 Nov 2008 15:21] Chuck Bell
Waiting for new patch.
[14 Nov 2008 14:12] 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/58785

2727 Jorgen Loland	2008-11-14
      Bug#32465 - Backup: Commit blocker does not block tables in default driver
                  
      Patch (1/2): The patch removes the old commit blocker test.
[14 Nov 2008 14:18] 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/58787

2728 Jorgen Loland	2008-11-14
      Bug#32465 - Backup: Commit blocker does not block tables in default driver
                        
      Patch (2/2): The patch contains new validity point tests written for the temporary commit blocker solution of setting Global Read Lock before backup prepare phase (fixed in bug#39602). The backup_vp* tests replace the old backup_commit_blocker tests.
[17 Nov 2008 9:15] 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/58921

2729 Jorgen Loland	2008-11-17
      Bug#32465 - Backup: Commit blocker does not block tables in default driver
                              
      Patch (2/2): The patch contains new validity point tests written for the temporary commit blocker solution of setting Global Read Lock before backup prepare phase (fixed in bug#39602). The backup_vp* tests replace the old backup_commit_blocker tests.
[17 Nov 2008 9:31] Rafal Somla
Good to push (few typos in the comments need fixing).
[19 Nov 2008 21:10] Chuck Bell
Patch approved pending resolution of requests in commit reply.
[20 Nov 2008 9:37] 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/59333

2738 Jorgen Loland	2008-11-20
      Bug#32465 - Backup: Commit blocker does not block tables in default driver
                        
      Patch (1/2): The patch removes the old commit blocker test.
[20 Nov 2008 9:47] 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/59334

2739 Jorgen Loland	2008-11-20
      Bug#32465 - Backup: Commit blocker does not block tables in default driver
                                    
      Patch (2/2): The patch contains new validity point tests written for the temporary commit blocker solution of setting Global Read Lock before backup prepare phase (fixed in bug#39602). The backup_vp* tests replace the old backup_commit_blocker tests.
[21 Nov 2008 9:47] Jørgen Løland
Pushed to mysql-6.0-backup
[26 Nov 2008 8:50] Bugs System
Pushed into 6.0.9-alpha  (revid:jorgen.loland@sun.com-20081120094934-vgo0aplsets5ysb6) (version source revid:jorgen.loland@sun.com-20081126084449-lq9ckif3hmxesy1n) (pib:5)
[26 Nov 2008 16:10] Paul DuBois
Test case changes. No changelog entry needed.
[10 Dec 2008 5:41] 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/61141

2742 He Zhenxing	2008-12-10 [merge]
      Auto Merge