List:Commits« Previous MessageNext Message »
From:Luis Soares Date:June 26 2009 2:22pm
Subject:bzr commit into mysql-5.4 branch (luis.soares:2813) Bug#44958
View as plain text  
#At file:///home/lsoares/Workspace/mysql-server/bugfix/b44958%2Bb44938%2Bb44779/mysql-azalea-bugfixing/ based on revid:epotemkin@stripped

 2813 Luis Soares	2009-06-26
      BUG#44958: Setting read_only won't succeed if tx is already started in
      different connection
            
      This bug was opened to report the disabling of test rpl_read_only
      after patch for BUG#989 was pushed and to reenable this test case with
      the appropriate changes.
            
      This test case consists of three parts:
            
      1. check that the readonly variable is not replicated. The variable is
         set on the master before any locking takes place. This is safe wrt
         to the patch for BUG#989.
            
      2. check that user root (on conn1) can commit even if 'set
          read_only=1' is done concurrently (on conn3) just before conn1
          issues commit. This checks also that other users than root will not
          be able to commit under the same scenario.
            
      3. check that the sql slave thread is able to apply the changes even
         if read_only is set. This is safe wrt to the patch for BUG#989.
           
      The test case now hangs in 2. because it tries to set the flag
      read_only, while there are active changes going on (and mdl locks are
      taken). 
            
      The proposed fix addresses this, by changing a little the test case in
      2., so that the read_only flag is set before the changes are
      done. This makes the test not to hang anymore and keeps as close as
      possible the same assertions from before: i) assertion that the SUPER
      user can commit persists; ii) assertion that the non-super user cannot
      commit is changed - since read_only is set before the inserts, now
      when this user tries to insert it will get an error (ie, the check is
      performed earlier - before commit).
     @ mysql-test/suite/rpl/r/rpl_read_only.result
        updates to result file.
     @ mysql-test/suite/rpl/t/disabled.def
        Removes the rpl_read_only test from the list of disabled tests.
     @ mysql-test/suite/rpl/t/rpl_read_only.test
        Changes the setting of read_only variable to happen before any 
        locking takes place.

    modified:
      mysql-test/suite/rpl/r/rpl_read_only.result
      mysql-test/suite/rpl/t/disabled.def
      mysql-test/suite/rpl/t/rpl_read_only.test
=== modified file 'mysql-test/suite/rpl/r/rpl_read_only.result'
--- a/mysql-test/suite/rpl/r/rpl_read_only.result	2007-06-27 12:28:02 +0000
+++ b/mysql-test/suite/rpl/r/rpl_read_only.result	2009-06-26 14:22:34 +0000
@@ -30,15 +30,26 @@ a
 2001
 set global read_only=0;
 BEGIN;
+BEGIN;
+select @@read_only;
+@@read_only
+0
+set global read_only=1;
+*** On SUPER USER connection ***
 insert into t1 values(1002);
 insert into t2 values(2002);
-BEGIN;
+*** On regular USER connection ***
 insert into t1 values(1003);
+ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
 insert into t2 values(2003);
-set global read_only=1;
+ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
+*** SUPER USER COMMIT (must succeed) *** 
 COMMIT;
+*** regular USER COMMIT (must succeed - nothing to commit) *** 
 COMMIT;
-ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
+select @@read_only;
+@@read_only
+1
 set global read_only=0;
 insert into t1 values(1004);
 insert into t2 values(2004);
@@ -51,7 +62,6 @@ select * from t2;
 a
 2001
 2002
-2003
 2004
 select * from t1;
 a
@@ -62,7 +72,6 @@ select * from t2;
 a
 2001
 2002
-2003
 2004
 set global read_only=1;
 select @@read_only;
@@ -90,7 +99,6 @@ select * from t2;
 a
 2001
 2002
-2003
 2004
 2005
 select * from t1;
@@ -103,7 +111,6 @@ select * from t2;
 a
 2001
 2002
-2003
 2004
 2005
 insert into t1 values(1006);

=== modified file 'mysql-test/suite/rpl/t/disabled.def'
--- a/mysql-test/suite/rpl/t/disabled.def	2009-06-24 19:39:33 +0000
+++ b/mysql-test/suite/rpl/t/disabled.def	2009-06-26 14:22:34 +0000
@@ -16,5 +16,4 @@ rpl_cross_version          : BUG#42311 2
 rpl_heartbeat_basic        : Bug#43828 Sporadic failures (Serge.Kozlov@stripped)
 rpl_heartbeat_2slaves      : Bug#43828 Sporadic failures (Serge.Kozlov@stripped)
 rpl_failed_optimize        : Bug#44938 Replication fails when optimizing a table used by pending transaction.
-rpl_read_only              : Bug#44958 Setting read_only won't succeed if tx is already started in different connection
 rpl_init_slave             : Bug#44920 2009-05-18 pcrews MTR2 is not processing master.opt input properly on Windows

=== modified file 'mysql-test/suite/rpl/t/rpl_read_only.test'
--- a/mysql-test/suite/rpl/t/rpl_read_only.test	2007-06-27 12:28:02 +0000
+++ b/mysql-test/suite/rpl/t/rpl_read_only.test	2009-06-26 14:22:34 +0000
@@ -39,26 +39,37 @@ set global read_only=0;
 
 connection master1;
 BEGIN;
-insert into t1 values(1002);
-insert into t2 values(2002);
 
 connection master2;
 BEGIN;
-insert into t1 values(1003);
-insert into t2 values(2003);
 
 connection master;
+select @@read_only;
 set global read_only=1;
 
 connection master1;
+-- echo *** On SUPER USER connection ***
+insert into t1 values(1002);
+insert into t2 values(2002);
+
+connection master2;
+-- echo *** On regular USER connection ***
+--error ER_OPTION_PREVENTS_STATEMENT
+insert into t1 values(1003);
+--error ER_OPTION_PREVENTS_STATEMENT
+insert into t2 values(2003);
+
+connection master1;
 ## works even with read_only=1, because master1 is root
+-- echo *** SUPER USER COMMIT (must succeed) *** 
 COMMIT;
 
 connection master2;
---error ER_OPTION_PREVENTS_STATEMENT
+-- echo *** regular USER COMMIT (must succeed - nothing to commit) *** 
 COMMIT;
 
 connection master;
+select @@read_only;
 set global read_only=0;
 
 connection master1;


Attachment: [text/bzr-bundle] bzr/luis.soares@sun.com-20090626142234-8da6l9d991pw8tyx.bundle
Thread
bzr commit into mysql-5.4 branch (luis.soares:2813) Bug#44958Luis Soares26 Jun