List:Commits« Previous MessageNext Message »
From:Andrei Elkin Date:August 22 2010 8:07am
Subject:bzr push into mysql-5.1-rep+2 branch (aelkin:3203 to 3204) Bug#56006
View as plain text  
 3204 Andrei Elkin	2010-08-22
      Bug #56006  test failures on mysql-5.1-rep+2-wl2540
      
      this patch 
      1. fixes an assert erronously firing when the master started with
      --master-verify-checksum=1.
      2. corrects access to event_buf bytes - the header flags - to treat
        the buffer as an array of bytes.
     @ mysql-test/suite/rpl/r/rpl_checksum_cache.result
        results changed.
     @ mysql-test/suite/rpl/t/rpl_checksum_cache.test
        making testing more "aggressive" to raise a loop limit twice
        and with forcing the master side event verification.
     @ sql/log_event.cc
        Correcting assertion to allow FD event to carry no-alg info and being checksummed
        with CRC32.
        That case indicates no checksum of all the following events while FD itself does contain it.
        Correcting indexing of `event_buf' to treat it as an array of bytes.

    modified:
      mysql-test/suite/rpl/r/rpl_checksum_cache.result
      mysql-test/suite/rpl/t/rpl_checksum_cache.test
      sql/log_event.cc
 3203 Andrei Elkin	2010-08-19
      null commit to test sporadic failures

=== modified file 'mysql-test/suite/rpl/r/rpl_checksum_cache.result'
--- a/mysql-test/suite/rpl/r/rpl_checksum_cache.result	2010-06-14 10:04:20 +0000
+++ b/mysql-test/suite/rpl/r/rpl_checksum_cache.result	2010-08-22 08:04:15 +0000
@@ -7,8 +7,12 @@ start slave;
 call mtr.add_suppression('Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function');
 set @save_binlog_cache_size = @@global.binlog_cache_size;
 set @save_binlog_checksum = @@global.binlog_checksum;
+set @save_master_verify_checksum = @@global.master_verify_checksum;
 set @@global.binlog_cache_size = 4096;
 set @@global.binlog_checksum = CRC32;
+set @@global.master_verify_checksum = 1;
+include/stop_slave.inc
+include/start_slave.inc
 flush status;
 show status like "binlog_cache_use";
 Variable_name	Value
@@ -28,7 +32,7 @@ set n= n-1;
 end while;
 end|
 begin;
-call test.p_init(4000, 32);
+call test.p_init(8000, 32);
 commit;
 show status like "binlog_cache_use";
 Variable_name	Value
@@ -112,6 +116,7 @@ commit;
 drop table t1, t2, t3;
 set @@global.binlog_cache_size = @save_binlog_cache_size;
 set @@global.binlog_checksum = @save_binlog_checksum;
+set @@global.master_verify_checksum = @save_master_verify_checksum;
 drop procedure test.p_init;
 drop procedure test.p1;
 End of tests

=== modified file 'mysql-test/suite/rpl/t/rpl_checksum_cache.test'
--- a/mysql-test/suite/rpl/t/rpl_checksum_cache.test	2010-06-14 10:04:20 +0000
+++ b/mysql-test/suite/rpl/t/rpl_checksum_cache.test	2010-08-22 08:04:15 +0000
@@ -3,11 +3,21 @@
 
 call mtr.add_suppression('Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function');
 
+
 connection master;
 set @save_binlog_cache_size = @@global.binlog_cache_size;
 set @save_binlog_checksum = @@global.binlog_checksum;
+set @save_master_verify_checksum = @@global.master_verify_checksum;
 set @@global.binlog_cache_size = 4096;
 set @@global.binlog_checksum = CRC32;
+set @@global.master_verify_checksum = 1;
+
+# restart slave to force the dump thread to verify events (on master side)
+connection slave;
+source include/stop_slave.inc;
+source include/start_slave.inc;
+
+connection master;
 
 #
 # Testing a critical part of checksum handling dealing with transaction cache.
@@ -56,7 +66,7 @@ end|
 
 delimiter ;|
 
-let $1 = 4000;
+let $1 = 8000;
 begin;
 --disable_warnings
 # todo: check if it is really so.
@@ -238,6 +248,7 @@ commit;
 drop table t1, t2, t3;
 set @@global.binlog_cache_size = @save_binlog_cache_size;
 set @@global.binlog_checksum = @save_binlog_checksum;
+set @@global.master_verify_checksum = @save_master_verify_checksum;
 drop procedure test.p_init;
 drop procedure test.p1;
 

=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc	2010-08-19 14:19:53 +0000
+++ b/sql/log_event.cc	2010-08-22 08:04:15 +0000
@@ -658,16 +658,19 @@ inline bool event_checksum_test(uchar *e
 
     if (event_buf[EVENT_TYPE_OFFSET] == FORMAT_DESCRIPTION_EVENT)
     {
+      IF_DBUG(int8 fd_alg= event_buf[event_len - BINLOG_CHECKSUM_LEN - 
+                                     BINLOG_CHECKSUM_ALG_DESC_LEN];);
       /*
         FD event is checksummed and therefore verified w/o the binlog-in-use flag
       */
       flags= uint2korr(event_buf + FLAGS_OFFSET);
       if (flags & LOG_EVENT_BINLOG_IN_USE_F)
-        *((uint16*) event_buf + FLAGS_OFFSET) &= ~LOG_EVENT_BINLOG_IN_USE_F;
-      /* The only algorithm currently is CRC32 */
-      DBUG_ASSERT(event_buf[event_len - BINLOG_CHECKSUM_LEN - 
-                            BINLOG_CHECKSUM_ALG_DESC_LEN] ==
-                  BINLOG_CHECKSUM_ALG_CRC32);
+        event_buf[FLAGS_OFFSET] &= ~LOG_EVENT_BINLOG_IN_USE_F;
+      /* 
+         The only algorithm currently is CRC32. Zero indicates 
+         the binlog file is checksum-free *except* the FD-event.
+      */
+      DBUG_ASSERT(fd_alg == BINLOG_CHECKSUM_ALG_CRC32 || fd_alg == 0);
       DBUG_ASSERT(alg == BINLOG_CHECKSUM_ALG_CRC32);
       /*
         Complile time guard to watch over  the max number of alg


Attachment: [text/bzr-bundle] bzr/aelkin@mysql.com-20100822080415-p6ijgkzto4osiair.bundle
Thread
bzr push into mysql-5.1-rep+2 branch (aelkin:3203 to 3204) Bug#56006Andrei Elkin22 Aug