Skip to content

Commit d4359ee

Browse files
author
Parveez Baig
committed
Bug#21326745: ASSERTION FAILURE IN TEST RPL_GTID.RPL_SYNC_RELAY_LOG_INFO
There are two types of assertion failures in test. 1)In the test some operation is performed on master and on slave assertion is made whether the master_log_name and master_log_pos have got updated in mysql.slave_relay_log_info. The assertion is failng with the result that the master_log_file and position have not got synced since before the assertion is made the test doesn't guarantee whether the slave has synced it's IO_THREAD with the master. 2) some times there is assertion failure in gtid_step_assert.inc. This file checks that n number of gtid's have been added since last call to gtid_executed was made. This assertion is failing since before the assertion is made the test doesn't guaratee whether the slave's IO_THREAD is in sync with the master. Fix: Replaced assert.inc with wait_condition.inc. Added sync_slave_io_with_master wherever necessary.
1 parent 94af73c commit d4359ee

File tree

3 files changed

+131
-100
lines changed

3 files changed

+131
-100
lines changed

mysql-test/extra/rpl_tests/rpl_sync_relay_log_info.inc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,24 +51,28 @@ if ( `SELECT '$_storage_engine' <> 'INNODB' AND '$_storage_engine' <> 'MYISAM'`
5151
# 2 - Simple DDL
5252
--source include/rpl_connection_master.inc
5353
--eval CREATE TABLE t1 (c1 int PRIMARY KEY) ENGINE=$storage_engine
54+
--source include/sync_slave_io_with_master.inc
5455
--let $gtid_step_count= 1
5556
--source extra/rpl_tests/rpl_sync_relay_log_info_assert_pos.inc
5657

5758
# 3 - Simple DML
5859
--source include/rpl_connection_master.inc
5960
INSERT INTO t1 VALUES (1);
61+
--source include/sync_slave_io_with_master.inc
6062
--let $gtid_step_count= 1
6163
--source extra/rpl_tests/rpl_sync_relay_log_info_assert_pos.inc
6264

6365
# 4 - The master has flushed the binary log
6466
--source include/rpl_connection_master.inc
6567
FLUSH LOCAL BINARY LOGS;
68+
--source include/sync_slave_io_with_master.inc
6669
--let $gtid_step_count= 0
6770
--source extra/rpl_tests/rpl_sync_relay_log_info_assert_pos.inc
6871

6972
# 5 - Simple DDL
7073
--source include/rpl_connection_master.inc
7174
DROP TABLE t1;
75+
--source include/sync_slave_io_with_master.inc
7276
--let $gtid_step_count= 1
7377
--source extra/rpl_tests/rpl_sync_relay_log_info_assert_pos.inc
7478

@@ -172,6 +176,7 @@ SET DEBUG_SYNC= 'now SIGNAL continue_after_queue_event';
172176
# 18 - Simple DDL
173177
--source include/rpl_connection_master.inc
174178
DROP TABLE t1;
179+
--source include/sync_slave_io_with_master.inc
175180
--let $gtid_step_count= 1
176181
--source extra/rpl_tests/rpl_sync_relay_log_info_assert_pos.inc
177182

@@ -181,6 +186,7 @@ if ($_storage_engine == "INNODB")
181186
# 19 - Simple DDL
182187
--source include/rpl_connection_master.inc
183188
--eval CREATE TABLE t1 (c1 int PRIMARY KEY) ENGINE=$storage_engine
189+
--source include/sync_slave_io_with_master.inc
184190
--let $gtid_step_count= 1
185191
--source extra/rpl_tests/rpl_sync_relay_log_info_assert_pos.inc
186192

@@ -256,6 +262,7 @@ if ($_storage_engine == "INNODB")
256262
# 25 - Simple DDL
257263
--source include/rpl_connection_master.inc
258264
DROP TABLE t1;
265+
--source include/sync_slave_io_with_master.inc
259266
--let $gtid_step_count= 1
260267
--source extra/rpl_tests/rpl_sync_relay_log_info_assert_pos.inc
261268
}

mysql-test/extra/rpl_tests/rpl_sync_relay_log_info_assert_pos.inc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ if ( $_rrli_expected == "N" )
6969
# If it was expected to be updated
7070
if ( $_rrli_expected == "U" )
7171
{
72-
--let $assert_text= ($_rrli_subheader) SQL thread synced master binlog file
73-
--let $assert_cond= [ SELECT Master_log_name = "$master_file" FROM mysql.slave_relay_log_info WHERE Channel_name = "" ]
74-
--source include/assert.inc
72+
--echo Wait until ($_rrli_subheader) SQL thread synced master binlog file
73+
--let $wait_condition= SELECT Master_log_name = "$master_file" FROM mysql.slave_relay_log_info WHERE Channel_name = ""
74+
--source include/wait_condition.inc
7575
--let $last_synced_master_file= $master_file
7676

77-
--let $assert_text= ($_rrli_subheader) SQL thread synced master binlog position
78-
--let $assert_cond= [ SELECT Master_log_pos = "$master_pos" FROM mysql.slave_relay_log_info WHERE Channel_name = "" ]
79-
--source include/assert.inc
77+
--echo Wait until ($_rrli_subheader) SQL thread synced master binlog position
78+
--let $wait_condition= SELECT Master_log_pos = "$master_pos" FROM mysql.slave_relay_log_info WHERE Channel_name = ""
79+
--source include/wait_condition.inc
8080
--let $last_synced_master_pos= $master_pos
8181
}
8282

0 commit comments

Comments
 (0)