MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Chuck Bell Date:February 9 2010 4:20pm
Subject:bzr commit into mysql-backup-backport branch (charles.bell:3086)
Bug#50846
View as plain text  
#At file:///Users/cbell/source/bzr/MS10/ based on revid:charles.bell@stripped

 3086 Chuck Bell	2010-02-09
      BUG#50846 : BACKPORT: Locking tests failing in pushbuild tree
      
      The locking tests that use the wait_for_lock sync point in the old
      server locking code fail because the method wait_for_lock() has been
      replaced with the new MDL code.
      
      This patch introduces a new sync point in the new MDL code for
      synchronizing the locking tests. 
     @ mysql-test/suite/backup/r/backup_myisam_sync.result
        Corrected result file.
     @ mysql-test/suite/backup/r/backup_restore_locking.result
        Corrected result file.
     @ mysql-test/suite/backup/t/backup_myisam_sync.test
        Changed test to use new sync point in mdl code.
     @ mysql-test/suite/backup/t/backup_restore_locking.test
        Changed test to use new sync point in mdl code.
        Commented out non-deterministic show processlist call -- this
        was due to change in how locking is done in the server with the
        new MDL locking code.
     @ sql/mdl.cc
        Added sync point for restore locking tests.

    modified:
      mysql-test/suite/backup/r/backup_myisam_sync.result
      mysql-test/suite/backup/r/backup_restore_locking.result
      mysql-test/suite/backup/t/backup_myisam_sync.test
      mysql-test/suite/backup/t/backup_restore_locking.test
      sql/mdl.cc
=== modified file 'mysql-test/suite/backup/r/backup_myisam_sync.result'
--- a/mysql-test/suite/backup/r/backup_myisam_sync.result	2010-01-06 15:03:50 +0000
+++ b/mysql-test/suite/backup/r/backup_myisam_sync.result	2010-02-09 16:20:02 +0000
@@ -108,7 +108,7 @@ RESTORE FROM 'bup_myisam_sync_db1.bak';
 #
 # connection con1
 SET DEBUG_SYNC= 'now WAIT_FOR restore_locked';
-SET DEBUG_SYNC= 'wait_for_lock SIGNAL restore_finish';
+SET DEBUG_SYNC= 'mdl_wait_table SIGNAL restore_finish';
 SELECT COUNT(*) FROM bup_myisam_sync_db1.t1 WHERE c2 < 5;
 #
 # connection default

=== modified file 'mysql-test/suite/backup/r/backup_restore_locking.result'
--- a/mysql-test/suite/backup/r/backup_restore_locking.result	2010-01-06 15:03:50 +0000
+++ b/mysql-test/suite/backup/r/backup_restore_locking.result	2010-02-09 16:20:02 +0000
@@ -62,37 +62,29 @@ RESTORE FROM 'bup_reslock_db1.bak';
 #
 # connection con1
 SET DEBUG_SYNC= 'now WAIT_FOR waiting';
-SET DEBUG_SYNC= 'wait_for_lock SIGNAL lock_wait';
+SET DEBUG_SYNC= 'mdl_wait_table SIGNAL lock_wait';
 INSERT INTO bup_reslock_db1.t1 VALUES(1,"after_lock_tables");
 #
 # connection con2
 SET DEBUG_SYNC= 'now WAIT_FOR lock_wait';
 SET DEBUG_SYNC= 'now SIGNAL continue WAIT_FOR waiting';
-SET DEBUG_SYNC= 'wait_for_lock SIGNAL lock_wait';
+SET DEBUG_SYNC= 'mdl_wait_table SIGNAL lock_wait';
 INSERT INTO bup_reslock_db1.t1 VALUES(2,"after_truncate_tables");
 #
 # connection con3
 SET DEBUG_SYNC= 'now WAIT_FOR lock_wait';
 SET DEBUG_SYNC= 'now SIGNAL continue WAIT_FOR waiting';
-SET DEBUG_SYNC= 'wait_for_lock SIGNAL lock_wait';
+SET DEBUG_SYNC= 'mdl_wait_table SIGNAL lock_wait';
 INSERT INTO bup_reslock_db1.t1 VALUES(3,"before_flush_tables");
 #
 # connection con4
 SET DEBUG_SYNC= 'now WAIT_FOR lock_wait';
 SET DEBUG_SYNC= 'now SIGNAL continue WAIT_FOR waiting';
-SET DEBUG_SYNC= 'wait_for_lock SIGNAL lock_wait';
+SET DEBUG_SYNC= 'mdl_wait_table SIGNAL lock_wait';
 INSERT INTO bup_reslock_db1.t1 VALUES(4,"before_unlock_tables");
 #
 # connection con5
 SET DEBUG_SYNC= 'now WAIT_FOR lock_wait';
-SELECT state, info FROM INFORMATION_SCHEMA.PROCESSLIST;
-state	info
-executing	SELECT state, info FROM INFORMATION_SCHEMA.PROCESSLIST
-Table lock	INSERT INTO bup_reslock_db1.t1 VALUES(4,"before_unlock_tables")
-Table lock	INSERT INTO bup_reslock_db1.t1 VALUES(3,"before_flush_tables")
-Table lock	INSERT INTO bup_reslock_db1.t1 VALUES(2,"after_truncate_tables")
-Table lock	INSERT INTO bup_reslock_db1.t1 VALUES(1,"after_lock_tables")
-debug sync point: before_restore_unlock_tables	RESTORE FROM 'bup_reslock_db1.bak'
 SET DEBUG_SYNC= 'now SIGNAL continue';
 #
 # connection default, retrieve RESTORE result

=== modified file 'mysql-test/suite/backup/t/backup_myisam_sync.test'
--- a/mysql-test/suite/backup/t/backup_myisam_sync.test	2010-01-06 15:03:50 +0000
+++ b/mysql-test/suite/backup/t/backup_myisam_sync.test	2010-02-09 16:20:02 +0000
@@ -151,7 +151,7 @@ send RESTORE FROM 'bup_myisam_sync_db1.b
     --echo # connection con1
     --connect(con1, localhost, root,,)
     SET DEBUG_SYNC= 'now WAIT_FOR restore_locked';
-    SET DEBUG_SYNC= 'wait_for_lock SIGNAL restore_finish';
+    SET DEBUG_SYNC= 'mdl_wait_table SIGNAL restore_finish';
     send SELECT COUNT(*) FROM bup_myisam_sync_db1.t1 WHERE c2 < 5;
 #
 --echo #

=== modified file 'mysql-test/suite/backup/t/backup_restore_locking.test'
--- a/mysql-test/suite/backup/t/backup_restore_locking.test	2010-01-06 15:03:50 +0000
+++ b/mysql-test/suite/backup/t/backup_restore_locking.test	2010-02-09 16:20:02 +0000
@@ -91,7 +91,7 @@ send RESTORE FROM 'bup_reslock_db1.bak';
     --echo # connection con1
     --connect (con1, localhost, root,,)
     SET DEBUG_SYNC= 'now WAIT_FOR waiting';
-    SET DEBUG_SYNC= 'wait_for_lock SIGNAL lock_wait';
+    SET DEBUG_SYNC= 'mdl_wait_table SIGNAL lock_wait';
     send INSERT INTO bup_reslock_db1.t1 VALUES(1,"after_lock_tables");
 #
       --echo #
@@ -99,7 +99,7 @@ send RESTORE FROM 'bup_reslock_db1.bak';
       --connect (con2, localhost, root,,)
       SET DEBUG_SYNC= 'now WAIT_FOR lock_wait';
       SET DEBUG_SYNC= 'now SIGNAL continue WAIT_FOR waiting';
-      SET DEBUG_SYNC= 'wait_for_lock SIGNAL lock_wait';
+      SET DEBUG_SYNC= 'mdl_wait_table SIGNAL lock_wait';
       send INSERT INTO bup_reslock_db1.t1 VALUES(2,"after_truncate_tables");
 #
         --echo #
@@ -107,7 +107,7 @@ send RESTORE FROM 'bup_reslock_db1.bak';
         --connect (con3, localhost, root,,)
         SET DEBUG_SYNC= 'now WAIT_FOR lock_wait';
         SET DEBUG_SYNC= 'now SIGNAL continue WAIT_FOR waiting';
-        SET DEBUG_SYNC= 'wait_for_lock SIGNAL lock_wait';
+        SET DEBUG_SYNC= 'mdl_wait_table SIGNAL lock_wait';
         send INSERT INTO bup_reslock_db1.t1 VALUES(3,"before_flush_tables");
 #
           --echo #
@@ -115,14 +115,18 @@ send RESTORE FROM 'bup_reslock_db1.bak';
           --connect (con4, localhost, root,,)
           SET DEBUG_SYNC= 'now WAIT_FOR lock_wait';
           SET DEBUG_SYNC= 'now SIGNAL continue WAIT_FOR waiting';
-          SET DEBUG_SYNC= 'wait_for_lock SIGNAL lock_wait';
+          SET DEBUG_SYNC= 'mdl_wait_table SIGNAL lock_wait';
           send INSERT INTO bup_reslock_db1.t1 VALUES(4,"before_unlock_tables");
 #
             --echo #
             --echo # connection con5
             --connect (con5, localhost, root,,)
             SET DEBUG_SYNC= 'now WAIT_FOR lock_wait';
-            SELECT state, info FROM INFORMATION_SCHEMA.PROCESSLIST;
+          # Processlist can give non-deterministic results.
+          # It grabs variables of other threads without locking by design.
+          # Even if we can be sure here that all processes wait at
+          # defined places in code, con5 can still read "old" data.
+          # SELECT state, info FROM INFORMATION_SCHEMA.PROCESSLIST;
             SET DEBUG_SYNC= 'now SIGNAL continue';
             --disconnect con5
 #

=== modified file 'sql/mdl.cc'
--- a/sql/mdl.cc	2010-02-01 14:38:50 +0000
+++ b/sql/mdl.cc	2010-02-09 16:20:02 +0000
@@ -774,6 +774,11 @@ MDL_context::mdl_signal_type MDL_context
 
   old_msg= MDL_ENTER_COND(m_thd, mysys_var, &m_signal_cond, &m_signal_lock);
 
+#if defined(ENABLED_DEBUG_SYNC)
+  if (! m_signal && !mysys_var->abort)
+    DEBUG_SYNC(m_thd, "mdl_wait_table");
+#endif /* defined(ENABLED_DEBUG_SYNC) */
+
   while (! m_signal && !mysys_var->abort)
     pthread_cond_wait(&m_signal_cond, &m_signal_lock);
 


Attachment: [text/bzr-bundle] bzr/charles.bell@sun.com-20100209162002-5yvmxbmkcdrddt57.bundle
Thread
bzr commit into mysql-backup-backport branch (charles.bell:3086)Bug#50846Chuck Bell9 Feb
  • Re: bzr commit into mysql-backup-backport branch (charles.bell:3086)Bug#50846Konstantin Osipov10 Feb
  • Re: bzr commit into mysql-backup-backport branch (charles.bell:3086)Bug#50846Ritheesh Vedire10 Feb