List:Commits« Previous MessageNext Message »
From:Mats Kindahl Date:June 17 2008 6:47pm
Subject:Re: bzr commit into mysql-6.0 branch (sven:2662) Bug#37373
View as plain text  
Hi Sven!

My comments are:

- I think you should place regression tests for specific bugs in the
  'bugs' suite and not in the replication suite.

- See if you can remove the SHOW BINLOG EVENTS. Otherwise, use
  show_binlog_events.inc instead of an explicit SHOW BINLOG EVENTS.

See below for more info

Just my few cents,
Mats Kindahl

Sven Sandberg wrote:
> #At file:///home/sven/bzr/b37373-rpl_ndb_transaction/6.0-rpl/
> 
>  2662 Sven Sandberg	2008-06-17
>       BUG#37373: rpl_ndb_transaction fails sporadically in pb on sol10-amd64-a and
> sol10-sparc-a
>       Problem: rpl_ndb_transaction fails because it assumes nothing
>       is written to the binlog at a certain point. However, ndb may
>       write updates to ndb system tables to the binlog at a
>       nondeterministic time point after an ndb table update has
>       been committed.
>       Fix: break the test into two. rpl_ndb_transaction still does
>       the ndb updates needed by the first half of the test. The new
>       test case rpl_bug26395 includes the part that assumes nothing
>       more will be written to the binlog.
>       Also improved test cases a bit.
> added:
>   mysql-test/suite/rpl/r/rpl_bug26395.result
>   mysql-test/suite/rpl/t/rpl_bug26395-master.opt
>   mysql-test/suite/rpl/t/rpl_bug26395-slave.opt
>   mysql-test/suite/rpl/t/rpl_bug26395.test
> modified:
>   mysql-test/suite/rpl_ndb/r/rpl_ndb_transaction.result
>   mysql-test/suite/rpl_ndb/t/rpl_ndb_transaction-master.opt
>   mysql-test/suite/rpl_ndb/t/rpl_ndb_transaction.test
> 
> per-file messages:
>   mysql-test/suite/rpl/r/rpl_bug26395.result
>     New result file.
>   mysql-test/suite/rpl/t/rpl_bug26395-master.opt
>     New opt file.
>   mysql-test/suite/rpl/t/rpl_bug26395-slave.opt
>     New opt file.
>   mysql-test/suite/rpl/t/rpl_bug26395.test
>     Moved second half of rpl_ndb_transaction here.
>   mysql-test/suite/rpl_ndb/r/rpl_ndb_transaction.result
>     Updated result file.
>   mysql-test/suite/rpl_ndb/t/rpl_ndb_transaction-master.opt
>     No need for the special debug flag any more, it was used by
>     the second part of the test which is now in rpl_bug26395.
>   mysql-test/suite/rpl_ndb/t/rpl_ndb_transaction.test
>     1. Moved second half of the test to another test (rpl_bug26395)
>     2. Improved comments.
>     3. Extended the mixed transaction test to include also innodb.
>     4. Used 'source include/diff_tables.inc' instead of listing
>     several identical tables in the result file.
> === added file 'mysql-test/suite/rpl/r/rpl_bug26395.result'
> --- a/mysql-test/suite/rpl/r/rpl_bug26395.result	1970-01-01 00:00:00 +0000
> +++ b/mysql-test/suite/rpl/r/rpl_bug26395.result	2008-06-17 13:59:41 +0000
> @@ -0,0 +1,42 @@
> +stop slave;
> +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
> +reset master;
> +reset slave;
> +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
> +start slave;
> +==== Initialize ====
> +[on master]
> +CREATE TABLE tinnodb (a INT) ENGINE = INNODB;
> +SHOW CREATE TABLE tinnodb;
> +Table	Create Table
> +tinnodb	CREATE TABLE `tinnodb` (
> +  `a` int(11) DEFAULT NULL
> +) ENGINE=InnoDB DEFAULT CHARSET=latin1
> +==== Test ====
> +INSERT INTO tinnodb VALUES (1);
> +SELECT * FROM tinnodb ORDER BY a;
> +a
> +1
> +[on slave]
> +==== Verify results on slave ====
> +show binlog events;
> +Log_name	Pos	Event_type	Server_id	End_log_pos	Info
> +slave-bin.000001	4	Format_desc	2	107	Server ver: 6.0.6-alpha-debug-log, Binlog ver:
> 4
> +slave-bin.000001	107	Query	2	217	use `test`; drop table if exists
> t1,t2,t3,t4,t5,t6,t7,t8,t9
> +slave-bin.000001	217	Query	1	324	use `test`; CREATE TABLE tinnodb (a INT) ENGINE =
> INNODB

What do you need this output for? In general, having the output of SHOW
BINLOG EVENTS in a test makes it very difficult to maintain the test, so
if you don't need this for any specific reason, I would suggest that you
remove it.

If you need it, you need to clean it. The best way is to use
show_binlog_events.inc, but otherwise you have the following items:

- The version in the format description log event will change every time
  the version number of the server is stepped.

- The binary log name is not relevant for this display, nor is the
  binlog positions. The only thing that is relevant are that the correct
  events have been executed.

> +STOP SLAVE;
> +SELECT "" AS Slave_IO_State;
> +Slave_IO_State
> +
> +SELECT "" AS Last_SQL_Error;
> +Last_SQL_Error
> +
> +SELECT "" AS Last_IO_Error;
> +Last_IO_Error
> +
> +SELECT * FROM tinnodb ORDER BY a;
> +a
> +==== Clean up ====
> +[on master]
> +DROP TABLE tinnodb;
> +DROP TABLE tinnodb;
> 
> === added file 'mysql-test/suite/rpl/t/rpl_bug26395-master.opt'
> --- a/mysql-test/suite/rpl/t/rpl_bug26395-master.opt	1970-01-01 00:00:00 +0000
> +++ b/mysql-test/suite/rpl/t/rpl_bug26395-master.opt	2008-06-17 13:59:41 +0000
> @@ -0,0 +1 @@
> +--innodb --debug=d,do_not_write_xid

I think you should place this test in the bugs suite.

> 
> === added file 'mysql-test/suite/rpl/t/rpl_bug26395-slave.opt'
> --- a/mysql-test/suite/rpl/t/rpl_bug26395-slave.opt	1970-01-01 00:00:00 +0000
> +++ b/mysql-test/suite/rpl/t/rpl_bug26395-slave.opt	2008-06-17 13:59:41 +0000
> @@ -0,0 +1 @@
> +--innodb
> 
> === added file 'mysql-test/suite/rpl/t/rpl_bug26395.test'
> --- a/mysql-test/suite/rpl/t/rpl_bug26395.test	1970-01-01 00:00:00 +0000
> +++ b/mysql-test/suite/rpl/t/rpl_bug26395.test	2008-06-17 13:59:41 +0000
> @@ -0,0 +1,85 @@
> +# ==== Purpose ====
> +#
> +# Tests that an autocommitted XA transaction where the master crashes
> +# just before writing the XID log event is executed correctly.  The
> +# master rolls back, so the slave should not execute statement.
> +#
> +#
> +# ==== Method ====
> +#
> +# We want master to be alive sot that it can replicate the statement

typo "sot"

> +# to the slave. So in the test case, we must therefore not crash the
> +# master. Instead, we fake the crash by just not writing the XID event
> +# to the binlog. This is done by the --debug=d,do_not_write_xid flag
> +# in the .opt file. This, in turn, requires us to do 'source
> +# include_have_debug.inc'

typo "include_have_debug.inc"

-- 
Mats Kindahl
Lead Software Developer
Replication Team
MySQL AB, www.mysql.com

Thread
bzr commit into mysql-6.0 branch (sven:2662) Bug#37373Sven Sandberg17 Jun
  • Re: bzr commit into mysql-6.0 branch (sven:2662) Bug#37373Mats Kindahl17 Jun
  • Re: bzr commit into mysql-6.0 branch (sven:2662) Bug#37373Andrei Elkin25 Jun
    • Re: bzr commit into mysql-6.0 branch (sven:2662) Bug#37373Sven Sandberg28 Jun
      • Re: bzr commit into mysql-6.0 branch (sven:2662) Bug#37373Andrei Elkin3 Jul
        • Re: bzr commit into mysql-6.0 branch (sven:2662) Bug#37373Sven Sandberg3 Jul