3538 Alfranio Correia 2011-12-16
Created test case to check if GTids events are correctly stored in logs.
added:
mysql-test/extra/rpl_tests/rpl_check_gtid.inc
mysql-test/suite/rpl/r/rpl_check_gtid.result
mysql-test/suite/rpl/t/rpl_check_gtid-slave.opt
mysql-test/suite/rpl/t/rpl_check_gtid.test
3537 Luis Soares 2011-12-16
WL#3584
Fixing result file for rpl_*_binlog_max_cache_size so that the output does not
trick PB2 to think that it is another collection delimiter.
modified:
mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test
mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result
mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result
mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result
=== added file 'mysql-test/extra/rpl_tests/rpl_check_gtid.inc'
--- a/mysql-test/extra/rpl_tests/rpl_check_gtid.inc 1970-01-01 00:00:00 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_check_gtid.inc 2011-12-16 16:47:32 +0000
@@ -0,0 +1,143 @@
+################################################################################
+# This file aims to check if a log, either binary or relay log, has correctly
+# stored the Previous_gtids_log_event and Gtid_log_event events.
+#
+# Options:
+# (Type of the log: binlog or relaylog)
+# --let $binlog= <type_log>
+# (Check in the current log has <set_ini>-<set_end> in Previous GTids)
+# $gtid_set_ini= <set_ini>
+# $gtid_set_end= <set_end>
+# (Check in the current log has GTids from <gtid_ini> to <gtid_end>)
+# $gtid_ini= <gtid_ini>
+# $gtid_end= <gtid_end>
+# (Enable or disable debug)
+# --let $debug= <enabled>
+#
+# Usage:
+# --let $binlog= <type_log>
+# --let $gtid_set_ini= <set_ini>
+# --let $gtid_set_end= <set_end>
+# --let $gtid_ini= <gtid_ini>
+# --let $gtid_end= <gtid_end>
+# --source extra/rpl_tests/rpl_check_gtid.inc
+#
+# Example (Checking both Previous GTids and current Gtids in the master's
+# current binary log):
+# --connection master
+# --let $binlog= binlog
+# --let $gtid_set_ini= <set_ini>
+# --let $gtid_set_end= <set_end>
+# --let $gtid_ini= <gtid_ini>
+# --let $gtid_end= <gtid_end>
+# --source extra/rpl_tests/rpl_check_gtid.inc
+#
+# Example (Checking Previous GTids in the slave's current binary log):
+# --connection slave
+# --let $binlog= binlog
+# --let $gtid_set_ini= <set_ini>
+# --let $gtid_set_end= <set_end>
+# --let $gtid_ini=
+# --let $gtid_end=
+# --source extra/rpl_tests/rpl_check_gtid.inc
+#
+# Example (Checking GTids in the slave's current relay log):
+# --connection slave
+# --let $binlog= relaylog
+# --let $gtid_set_ini=
+# --let $gtid_set_end=
+# --let $gtid_ini= <gtid_ini>
+# --let $gtid_end= <gtid_end>
+# --source extra/rpl_tests/rpl_check_gtid.inc
+################################################################################
+
+--let $include_filename= rpl_check_gtid.inc
+--source include/begin_include_file.inc
+
+if (`SELECT "$binlog" = "binlog"`)
+{
+ --let $command_set= SHOW MASTER STATUS
+ --let $command_set_info= File
+ --let $command_show= SHOW BINLOG EVENTS
+}
+
+if (`SELECT "$binlog" = "relaylog"`)
+{
+ --let $command_set= SHOW SLAVE STATUS
+ --let $command_set_info= Relay_Log_File
+ --let $command_show= SHOW RELAYLOG EVENTS
+}
+
+
+if (`SELECT "$binlog" <> "" and "$gtid_set_end" <> "" and "$gtid_set_ini" <> ""`)
+{
+ --let $master_binlog= query_get_value($command_set, $command_set_info, 1)
+ if (`SELECT "$debug" <> ""`)
+ {
+ --eval $command_show in "$master_binlog"
+ }
+ --let $type= query_get_value($command_show in "$master_binlog", Event_type, 2)
+ --let $info= query_get_value($command_show in "$master_binlog", Info, 2)
+ if ($type != Previous_gtids)
+ {
+ --echo $type $info --- Type should be Previous_gtids.
+ --eval $command_show in "$master_binlog"
+ --die
+ }
+ if ($gtid_set_end == 0 && $gtid_set_ini == 0)
+ {
+ if (`SELECT "$info" <> ""`)
+ {
+ --echo $type $info -- Info should be empty.
+ --eval $command_show in "$master_binlog"
+ --die
+ }
+ }
+ if (`SELECT $gtid_set_end <> 0 and $gtid_set_ini <> 0 and $gtid_set_end <> $gtid_set_ini`)
+ {
+ if (`SELECT NOT ("$info" REGEXP "^$master_uuid:$gtid_set_ini-$gtid_set_end")`)
+ {
+ --echo $type $info -- Info should be $master_uuid:$gtid_set_ini-$gtid_set_end.
+ --eval $command_show in "$master_binlog"
+ --die
+ }
+ }
+ if ($gtid_set_end != 0 && $gtid_set_ini != 0 && $gtid_set_end == $gtid_set_ini)
+ {
+ if (`SELECT NOT ("$info" REGEXP "^$master_uuid:$gtid_set_ini")`)
+ {
+ --echo $type $info -- Info should be $master_uuid:$gtid_set_ini.
+ --eval $command_show in "$master_binlog"
+ --die
+ }
+ }
+}
+
+if (`SELECT "$binlog" <> "" and "$gtid_end" <> "" and "$gtid_ini" <> ""`)
+{
+ --let $type= unknown
+ --let $trans= `SELECT $gtid_ini`
+ --let $pos= 1
+ while (`SELECT $trans <= $gtid_end AND "$type" <> "No such row"`)
+ {
+ --let $type= query_get_value($command_show in "$master_binlog", Event_type, $pos)
+ if ($type == Gtid)
+ {
+ --let $info= query_get_value($command_show in "$master_binlog", Info, $pos)
+ if (`SELECT "$info" REGEXP "^SET @@SESSION.GTID_NEXT= '$master_uuid:$trans'"`)
+ {
+ --let $trans= `SELECT $trans + 1`
+ }
+ }
+ --inc $pos
+ }
+ if ($trans <= $gtid_end)
+ {
+ --echo $type $info -- We should retrieve from $gtid_ini to $gtid_end.
+ --eval $command_show in "$master_binlog"
+ --die
+ }
+}
+
+--let $include_filename= rpl_check_gtid.inc
+--source include/end_include_file.inc
=== added file 'mysql-test/suite/rpl/r/rpl_check_gtid.result'
--- a/mysql-test/suite/rpl/r/rpl_check_gtid.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_check_gtid.result 2011-12-16 16:47:32 +0000
@@ -0,0 +1,226 @@
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression("Recovery from master pos .*");
+CREATE TABLE t1(id INTEGER) ENGINE= Innodb;
+BEGIN;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+COMMIT;
+include/rpl_check_gtid.inc
+include/rpl_check_gtid.inc
+include/rpl_check_gtid.inc
+FLUSH LOGS;
+FLUSH LOGS;
+BEGIN;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+COMMIT;
+include/rpl_check_gtid.inc
+include/rpl_check_gtid.inc
+include/rpl_check_gtid.inc
+FLUSH LOGS;
+FLUSH LOGS;
+BEGIN;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+COMMIT;
+include/rpl_check_gtid.inc
+include/rpl_check_gtid.inc
+include/rpl_check_gtid.inc
+FLUSH LOGS;
+FLUSH LOGS;
+include/stop_slave.inc
+RESET MASTER;
+RESET SLAVE;
+RESET MASTER;
+SET GLOBAL debug="d,rotate_slave_debug_group";
+include/start_slave.inc
+BEGIN;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+COMMIT;
+include/rpl_check_gtid.inc
+FLUSH LOGS;
+BEGIN;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+COMMIT;
+include/rpl_check_gtid.inc
+FLUSH LOGS;
+BEGIN;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+COMMIT;
+include/rpl_check_gtid.inc
+FLUSH LOGS;
+BEGIN;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+COMMIT;
+include/rpl_check_gtid.inc
+FLUSH LOGS;
+include/stop_slave.inc
+SET GLOBAL debug="d,";
+RESET MASTER;
+RESET SLAVE;
+RESET MASTER;
+include/start_slave.inc
+BEGIN;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+COMMIT;
+include/rpl_check_gtid.inc
+include/rpl_check_gtid.inc
+include/stop_slave.inc
+include/rpl_restart_server.inc [server_number=2]
+include/start_slave.inc
+FLUSH LOGS;
+FLUSH LOGS;
+BEGIN;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+COMMIT;
+include/rpl_check_gtid.inc
+include/rpl_check_gtid.inc
+include/stop_slave.inc
+include/rpl_restart_server.inc [server_number=2]
+include/start_slave.inc
+FLUSH LOGS;
+FLUSH LOGS;
+BEGIN;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+COMMIT;
+include/rpl_check_gtid.inc
+include/rpl_check_gtid.inc
+include/stop_slave.inc
+include/rpl_restart_server.inc [server_number=2]
+include/start_slave.inc
+FLUSH LOGS;
+FLUSH LOGS;
+BEGIN;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+COMMIT;
+include/rpl_check_gtid.inc
+include/rpl_check_gtid.inc
+include/stop_slave.inc
+include/rpl_restart_server.inc [server_number=2]
+include/start_slave.inc
+FLUSH LOGS;
+FLUSH LOGS;
+include/stop_slave.inc
+RESET MASTER;
+RESET SLAVE;
+RESET MASTER;
+include/start_slave.inc
+BEGIN;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+COMMIT;
+include/rpl_check_gtid.inc
+include/rpl_check_gtid.inc
+include/rpl_check_gtid.inc
+include/stop_slave.inc
+include/rpl_restart_server.inc [server_number=1]
+include/start_slave.inc
+FLUSH LOGS;
+FLUSH LOGS;
+BEGIN;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+COMMIT;
+include/rpl_check_gtid.inc
+include/rpl_check_gtid.inc
+include/rpl_check_gtid.inc
+include/stop_slave.inc
+include/rpl_restart_server.inc [server_number=1]
+include/start_slave.inc
+FLUSH LOGS;
+FLUSH LOGS;
+BEGIN;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+COMMIT;
+include/rpl_check_gtid.inc
+include/rpl_check_gtid.inc
+include/rpl_check_gtid.inc
+include/stop_slave.inc
+include/rpl_restart_server.inc [server_number=1]
+include/start_slave.inc
+FLUSH LOGS;
+FLUSH LOGS;
+BEGIN;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+COMMIT;
+include/rpl_check_gtid.inc
+include/rpl_check_gtid.inc
+include/rpl_check_gtid.inc
+include/stop_slave.inc
+include/rpl_restart_server.inc [server_number=1]
+include/start_slave.inc
+FLUSH LOGS;
+FLUSH LOGS;
+include/stop_slave.inc
+RESET SLAVE;
+RESET MASTER;
+include/start_slave.inc
+BEGIN;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+COMMIT;
+BEGIN;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+COMMIT;
+include/rpl_check_gtid.inc
+FLUSH LOGS;
+FLUSH LOGS;
+include/stop_slave.inc
+RESET SLAVE;
+RESET MASTER;
+include/start_slave.inc
+BEGIN;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+COMMIT;
+BEGIN;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+COMMIT;
+include/rpl_check_gtid.inc
+FLUSH LOGS;
+FLUSH LOGS;
+include/stop_slave.inc
+RESET SLAVE;
+RESET MASTER;
+include/start_slave.inc
+BEGIN;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+COMMIT;
+BEGIN;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+COMMIT;
+include/rpl_check_gtid.inc
+FLUSH LOGS;
+FLUSH LOGS;
+include/stop_slave.inc
+RESET SLAVE;
+RESET MASTER;
+include/start_slave.inc
+BEGIN;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+COMMIT;
+BEGIN;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES(2);
+COMMIT;
+include/rpl_check_gtid.inc
+FLUSH LOGS;
+FLUSH LOGS;
+DROP TABLE t1;
+include/rpl_end.inc
=== added file 'mysql-test/suite/rpl/t/rpl_check_gtid-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_check_gtid-slave.opt 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_check_gtid-slave.opt 2011-12-16 16:47:32 +0000
@@ -0,0 +1 @@
+--relay-log-purge=0 --relay-log-recovery=1
=== added file 'mysql-test/suite/rpl/t/rpl_check_gtid.test'
--- a/mysql-test/suite/rpl/t/rpl_check_gtid.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_check_gtid.test 2011-12-16 16:47:32 +0000
@@ -0,0 +1,464 @@
+################################################################################
+# 1. Guarantee that an event generated on the master appears everywhere.
+#
+# Property 1.1 The set of GTids generated on the master are unique and
+# monotonically created.
+#
+# Property 1.2 The set of GTids generated on the master are preserved
+# in the relay log after being fetched.
+#
+# Property 1.2 The set of GTids generated on the master are preserved
+# in the slave's binary log after execution.
+#
+# 2. Guarantee that the Previous GTids events are correctly stored everywhere.
+#
+# Property 2.1 - The Previous GTids stored in a binary log must represent the
+# set of transactions stored in the previous binary logs.
+#
+# Property 2.2 - The Previous GTids stored in a relay log must represent the
+# set of transactions stored in the previous relay logs.
+#
+# 3. Guarantee that RESET SLAVE/RESET MASTER cleans the appropriate states.
+#
+# Property 3.1 - RESET SLAVE cleans the GTids and previous GTids' state
+# storead in the relay log.
+#
+# Property 3.2 - RESET MASTER cleans the GTids and previous GTids' state
+# storead in the binary log.
+#
+# We check if the aforementioned properties hold after generating a set
+# of transactions and rotating logs through different methods:
+#
+# 1. On both master and slave, rotate logs through FLUSH LOGS.
+# 2. On the slave, generate spreaded events by rotating the relay log when
+# its size is greater than 500 bytes. On the master, rotate logs through
+# FLUSH LOGS.
+# 3. On the slave, rotate logs by restarting the server. On the master,
+# rotate logs through FLUSH LOGS.
+# 4. On the slave, rotate logs by start/stop. On the master, rotate logs by
+# restarting the server.
+# 5. RESET SLAVE must not affect its binary log. On the master, rotate logs
+# by restarting the server.
+#
+# --- TODO ---
+# There are two cases not consider here:
+# . Events being generated at both master and slave.
+# . Crahes after creating logs and corrupted Previous Gtids.
+################################################################################
+--source include/master-slave.inc
+--source include/not_embedded.inc
+--source include/not_windows.inc
+
+call mtr.add_suppression("Recovery from master pos .*");
+
+--let $master_uuid= query_get_value(SELECT @@SERVER_UUID, @@SERVER_UUID, 1)
+CREATE TABLE t1(id INTEGER) ENGINE= Innodb;
+
+#
+# 1. This part of the test case:
+#
+# 1.1 - Generates a set of transactions on the master.
+#
+# 1.2 - Makes the slave to retrieve and apply these transactions.
+#
+# 1.3 - Rotates both the binary logs on the slave and master
+# by calling FLUSH LOGS.
+#
+--let $i=1
+while ($i != 4)
+{
+ # 1.1 - Generates a set of transactions on the master.
+ BEGIN;
+ INSERT INTO t1 VALUES(1);
+ INSERT INTO t1 VALUES(2);
+ COMMIT;
+
+ # Check property 1.1 and 2.1.
+ --let $binlog= binlog
+ if ($i == 1)
+ {
+ --let $gtid_set_ini= 0
+ --let $gtid_set_end= 0
+ --let $gtid_ini= 1
+ --let $gtid_end= 3
+ }
+ if ($i != 1)
+ {
+ --let $gtid_set_ini= 1
+ --let $gtid_set_end= `SELECT $i + 1`
+ --let $gtid_ini= `SELECT $i + 2`
+ --let $gtid_end= `SELECT $i + 2`
+ }
+ --source extra/rpl_tests/rpl_check_gtid.inc
+
+ # 1.2 - Makes the slave to retrieve and apply these transactions.
+ --sync_slave_with_master
+ --connection slave
+
+ # Check property 1.2 and 2.1.
+ --let $binlog= binlog
+ if ($i == 1)
+ {
+ --let $gtid_set_ini= 0
+ --let $gtid_set_end= 0
+ --let $gtid_ini= 1
+ --let $gtid_end= 3
+ }
+ if ($i != 1)
+ {
+ --let $gtid_set_ini= 1
+ --let $gtid_set_end= `SELECT $i + 1`
+ --let $gtid_ini= `SELECT $i + 2`
+ --let $gtid_end= `SELECT $i + 2`
+ }
+ --source extra/rpl_tests/rpl_check_gtid.inc
+
+ # Check property 1.3 and 2.2.
+ --let $binlog= relaylog
+ if ($i == 1)
+ {
+ --let $gtid_set_ini= 0
+ --let $gtid_set_end= 0
+ --let $gtid_ini= 1
+ --let $gtid_end= 3
+ }
+ if ($i != 1)
+ {
+ --let $gtid_set_ini= 1
+ --let $gtid_set_end= `SELECT $i + 1`
+ --let $gtid_ini= `SELECT $i + 2`
+ --let $gtid_end= `SELECT $i + 2`
+ }
+ --source extra/rpl_tests/rpl_check_gtid.inc
+
+# 1.3 - Rotates both the binary logs on the slave and master.
+ FLUSH LOGS;
+ --connection master
+ FLUSH LOGS;
+
+ inc $i;
+}
+
+#
+# 2. This part of the test case:
+#
+# 2.1 - Generates a set of transactions on the master.
+#
+# 2.2 - Makes the slave to retrieve these transactions and
+# spread their events into two relay logs. Then apply
+# the events.
+#
+# 2.3 - Rotates the binary log on the master
+# by calling FLUSH LOGS.
+#
+--connection slave
+--source include/stop_slave.inc
+RESET MASTER;
+RESET SLAVE;
+--connection master
+RESET MASTER;
+--connection slave
+SET GLOBAL debug="d,rotate_slave_debug_group";
+--source include/start_slave.inc
+
+--let $i=1
+while ($i != 5)
+{
+ # 2.1 - Generates a set of transactions on the master.
+ --connection master
+ BEGIN;
+ INSERT INTO t1 VALUES(1);
+ INSERT INTO t1 VALUES(2);
+ COMMIT;
+
+ # 2.2 - Makes the slave to retrieve these transactions and
+ # spread their events into two relay logs. Then apply
+ # the events.
+ --sync_slave_with_master
+
+ # Check property 2.2.
+ --let $binlog= relaylog
+ --let $gtid_set_ini= 1
+ --let $gtid_set_end= `SELECT $i`
+ --let $gtid_ini=
+ --let $gtid_end=
+ --source extra/rpl_tests/rpl_check_gtid.inc
+
+ # 2.3 - Rotates the binary log on the master.
+ --connection master
+ FLUSH LOGS;
+
+ inc $i;
+}
+
+#
+# 3. This part of the test case:
+#
+# 3.1 - Generates a set of transactions on the master.
+#
+# 3.2 - Makes the slave to retrieve and apply these transactions
+#
+# 3.3 - Restarts the slave server to rotate binary and relay logs.
+#
+# 3.4 - Rotates both the binary logs on the slave and master
+# by calling FLUSH LOGS.
+#
+--connection slave
+--source include/stop_slave.inc
+SET GLOBAL debug="d,";
+RESET MASTER;
+RESET SLAVE;
+--connection master
+RESET MASTER;
+--connection slave
+--source include/start_slave.inc
+
+--let $i=1
+while ($i != 5)
+{
+ # 3.1 - Generates a set of transactions on the master.
+ --connection master
+ BEGIN;
+ INSERT INTO t1 VALUES(1);
+ INSERT INTO t1 VALUES(2);
+ COMMIT;
+
+ # 3.2 - Makes the slave to retrieve and apply these transactions.
+ --sync_slave_with_master
+
+ # Check property 1.2 and 2.1.
+ --connection slave
+ --let $binlog= binlog
+ if ($i == 1)
+ {
+ --let $gtid_set_ini= 0
+ --let $gtid_set_end= 0
+ --let $gtid_ini= 1
+ --let $gtid_end= 1
+ }
+ if ($i != 1)
+ {
+ --let $gtid_set_ini= 1
+ --let $gtid_set_end= `SELECT $i - 1`
+ --let $gtid_ini= `SELECT $i`
+ --let $gtid_end= `SELECT $i`
+ }
+ --source extra/rpl_tests/rpl_check_gtid.inc
+
+ # Check property 1.3 and 2.2.
+ --let $binlog= relaylog
+ if ($i == 1)
+ {
+ --let $gtid_set_ini= 0
+ --let $gtid_set_end= 0
+ --let $gtid_ini= 1
+ --let $gtid_end= 1
+ }
+ if ($i != 1)
+ {
+ --let $gtid_set_ini= 1
+ --let $gtid_set_end= `SELECT $i - 1`
+ --let $gtid_ini= `SELECT $i`
+ --let $gtid_end= `SELECT $i`
+ }
+ --source extra/rpl_tests/rpl_check_gtid.inc
+
+ # 3.3 - Restarts the slave server to rotate binary and relay logs.
+ --source include/stop_slave.inc
+ --let $rpl_server_number= 2
+ --source include/rpl_restart_server.inc
+ --connection slave
+ --source include/start_slave.inc
+
+ # 3.4 - Rotates both the binary logs on the slave and master.
+ FLUSH LOGS;
+ --connection master
+ FLUSH LOGS;
+
+ inc $i;
+}
+
+#
+# 4. This part of the test case:
+#
+# 4.1 - Generates a set of transactions on the master.
+#
+# 4.2 - Makes the slave to retrieve and apply these transactions
+#
+# 4.3 - Stops the slave, restart the master server and starts the
+# slave to rotate both slave and master's binary and slave's
+# relay logs.
+#
+# 4.4 - Rotates both the binary logs on the slave and master
+# by calling FLUSH LOGS.
+#
+--connection slave
+--source include/stop_slave.inc
+RESET MASTER;
+RESET SLAVE;
+--connection master
+RESET MASTER;
+--connection slave
+--source include/start_slave.inc
+
+--let $i=1
+while ($i != 5)
+{
+ # 4.1 - Generates a set of transactions on the master.
+ --connection master
+ BEGIN;
+ INSERT INTO t1 VALUES(1);
+ INSERT INTO t1 VALUES(2);
+ COMMIT;
+
+ # Check property 1.1 and 2.1.
+ --let $binlog= binlog
+ if ($i == 1)
+ {
+ --let $gtid_set_ini= 0
+ --let $gtid_set_end= 0
+ --let $gtid_ini= 1
+ --let $gtid_end= 1
+ }
+ if ($i != 1)
+ {
+ --let $gtid_set_ini= 1
+ --let $gtid_set_end= `SELECT $i - 1`
+ --let $gtid_ini= `SELECT $i`
+ --let $gtid_end= `SELECT $i`
+ }
+ --source extra/rpl_tests/rpl_check_gtid.inc
+
+ # 4.2 - Makes the slave to retrieve and apply these transactions.
+ --sync_slave_with_master
+
+ # Check property 1.2 and 2.1.
+ --connection slave
+ --let $binlog= binlog
+ if ($i == 1)
+ {
+ --let $gtid_set_ini= 0
+ --let $gtid_set_end= 0
+ --let $gtid_ini= 1
+ --let $gtid_end= 1
+ }
+ if ($i != 1)
+ {
+ --let $gtid_set_ini= 1
+ --let $gtid_set_end= `SELECT $i - 1`
+ --let $gtid_ini= `SELECT $i`
+ --let $gtid_end= `SELECT $i`
+ }
+ --source extra/rpl_tests/rpl_check_gtid.inc
+
+ # Check property 1.3 and 2.2.
+ --let $binlog= relaylog
+ if ($i == 1)
+ {
+ --let $gtid_set_ini= 0
+ --let $gtid_set_end= 0
+ --let $gtid_ini= 1
+ --let $gtid_end= 1
+ }
+ if ($i != 1)
+ {
+ --let $gtid_set_ini= 1
+ --let $gtid_set_end= `SELECT $i - 1`
+ --let $gtid_ini= `SELECT $i`
+ --let $gtid_end= `SELECT $i`
+ }
+ --source extra/rpl_tests/rpl_check_gtid.inc
+
+ # 4.3 - Stops the slave, restart the master server and starts the
+ # slave.
+ --source include/stop_slave.inc
+ --connection master
+ --let $rpl_server_number= 1
+ --source include/rpl_restart_server.inc
+ --connection slave
+ --source include/start_slave.inc
+
+ # 4.4 - Rotates both the binary logs on the slave and master.
+ FLUSH LOGS;
+ --connection master
+ FLUSH LOGS;
+
+ inc $i;
+}
+
+#
+# 5. This part of the test case:
+#
+# 5.1 - Resets the IO Thread's state but not SQL Thread's state.
+#
+# 5.2 - Generates a set of transactions on the master.
+#
+# 5.3 - Stops the slave, restart the master server and starts the
+# slave to rotate both slave and master's binary and slave's
+# relay logs.
+#
+# 5.4 - Rotates both the binary logs on the slave and master
+# by calling FLUSH LOGS.
+#
+
+--let $i=1
+while ($i != 5)
+{
+
+ # 5.1 - Resets the IO Thread's state but not SQL Thread's state.
+ --connection slave
+ --source include/stop_slave.inc
+ RESET SLAVE;
+ --connection master
+ RESET MASTER;
+ --connection slave
+ --source include/start_slave.inc
+
+ # 5.2 - Generates a set of transactions on the master.
+ --connection master
+ BEGIN;
+ INSERT INTO t1 VALUES(1);
+ INSERT INTO t1 VALUES(2);
+ COMMIT;
+
+ BEGIN;
+ INSERT INTO t1 VALUES(1);
+ INSERT INTO t1 VALUES(2);
+ COMMIT;
+
+ # 5.3 - Makes the slave to retrieve and apply these transactions.
+ --sync_slave_with_master
+
+ # Check property 1.2, 2.1, 3.1 and 3.2
+ # This must be fixed after merging with Sven's because
+ # the RESET SLAVE was not supposed to reset both SQL and
+ # IO Threads.
+ if ($i == 1)
+ {
+ --let $binlog= binlog
+ --let $gtid_set_ini= 1
+ --let $gtid_set_end= 4
+ --let $gtid_ini= 1
+ --let $gtid_end= 2
+ }
+ if ($i != 1)
+ {
+ --let $binlog= binlog
+ --let $gtid_set_ini= 1
+ --let $gtid_set_end= 1
+ --let $gtid_ini= 1
+ --let $gtid_end= 2
+ }
+ --source extra/rpl_tests/rpl_check_gtid.inc
+
+ # 5.4 - Rotates both the binary logs on the slave and master.
+ FLUSH LOGS;
+ --connection master
+ FLUSH LOGS;
+
+ inc $i;
+}
+
+--connection master
+DROP TABLE t1;
+--source include/rpl_end.inc
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk-wl3584 branch (alfranio.correia:3537 to 3538) | Alfranio Correia | 16 Dec |