summaryrefslogtreecommitdiff
path: root/mysql-test/suite/rpl/r
diff options
context:
space:
mode:
authorAndrei Elkin <andrei.elkin@mariadb.com>2017-07-02 19:45:04 +0300
committerMonty <monty@mariadb.org>2017-07-02 19:47:30 +0300
commit946a07e8a85c5553b3906b46052b8044cb70a480 (patch)
tree67678cd3b1665369313ec69ecb1871e59a228dbf /mysql-test/suite/rpl/r
parent46d6f74c4892e0e2952d129888c34b61b66ba350 (diff)
downloadmariadb-git-946a07e8a85c5553b3906b46052b8044cb70a480.tar.gz
Fix for MDEV-9670 server_id mysteriously set to 0
Problem was that in a circular replication setup the master remembers position to events it has generated itself when reading from a slave. If there are no new events in the queue from the slave, a Gtid_list_log_event is generated to remember the last skipped event. The problem happens if there is a network delay and we generate a Gtid_list_log_event in the middle of the transaction, in which case there will be an implicit comment and a new transaction with serverid=0 will be logged. The fix was to not generate any Gtid_list_log_events in the middle of a transaction.
Diffstat (limited to 'mysql-test/suite/rpl/r')
-rw-r--r--mysql-test/suite/rpl/r/circular_serverid0.result30
1 files changed, 30 insertions, 0 deletions
diff --git a/mysql-test/suite/rpl/r/circular_serverid0.result b/mysql-test/suite/rpl/r/circular_serverid0.result
new file mode 100644
index 00000000000..899b4bd343b
--- /dev/null
+++ b/mysql-test/suite/rpl/r/circular_serverid0.result
@@ -0,0 +1,30 @@
+include/rpl_init.inc [topology=1->2->1]
+include/rpl_connect.inc [creating M4]
+include/rpl_connect.inc [creating M2]
+SET @old_debug= @@global.debug;
+STOP SLAVE;
+SET GLOBAL debug_dbug= "+d,dbug.rows_events_to_delay_relay_logging";
+START SLAVE IO_THREAD;
+include/wait_for_slave_io_to_start.inc
+CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b VARCHAR(30000)) ENGINE=innodb;
+INSERT INTO `t1` VALUES (null, repeat('a', 1024)), (null, repeat('b', 1024));
+SET debug_sync='now WAIT_FOR start_sql_thread';
+START SLAVE SQL_THREAD;
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Gtid # # GTID #-#-#
+slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b VARCHAR(30000)) ENGINE=innodb
+SET debug_sync='now SIGNAL go_on_relay_logging';
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Gtid # # GTID #-#-#
+slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b VARCHAR(30000)) ENGINE=innodb
+slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
+slave-bin.000001 # Table_map # # table_id: # (test.t1)
+slave-bin.000001 # Write_rows_v1 # # table_id: #
+slave-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+slave-bin.000001 # Xid # # COMMIT /* XID */
+drop table t1;
+SET GLOBAL debug_dbug= @old_debug;
+SET debug_sync='RESET';
+include/rpl_end.inc