mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
Bug #51398 Test "rpl_heartbeat_basic" fails "while waiting for slave_received_heartbeats"
Non-determinism of the test was caused by lack of setting a proper value to hb period, actually fixed by BUG@50767. These fixes aim at possible non-determinism in comparison of received hb events by master and slave in the circular part of the test. Even though the HB periods ratio was choosen to be as high as 10, it's still incorrect to compare number of hb-events basing only a relation between their periods. Yet another issue is relatively short 60 secs timeout of wait_for_status_var.inc makes valgrind runs to fail. Fixed with deploying wait_for_slave_io_to_start afront of calling wait_for_status_var. The test is made runnable only with MIXED binlog-format as it has close to 1 min total exec time and there is nothing format specific in it.
This commit is contained in:
parent
f977e21d26
commit
cf206a57f6
2 changed files with 17 additions and 14 deletions
|
@ -290,12 +290,10 @@ a b
|
||||||
2 on slave
|
2 on slave
|
||||||
Heartbeat event received on master
|
Heartbeat event received on master
|
||||||
Heartbeat event received on slave
|
Heartbeat event received on slave
|
||||||
Slave has received more events than master (1 means 'yes'): 1
|
|
||||||
|
|
||||||
*** Clean up ***
|
*** Clean up ***
|
||||||
include/stop_slave.inc
|
include/stop_slave.inc
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
include/stop_slave.inc
|
include/stop_slave.inc
|
||||||
SET @@global.slave_net_timeout=@restore_slave_net_timeout;
|
SET @@global.slave_net_timeout=@restore_slave_net_timeout;
|
||||||
|
|
||||||
End of 6.0 test
|
End of tests
|
||||||
|
|
|
@ -10,6 +10,12 @@
|
||||||
# * Circular replication
|
# * Circular replication
|
||||||
#############################################################
|
#############################################################
|
||||||
--source include/master-slave.inc
|
--source include/master-slave.inc
|
||||||
|
#
|
||||||
|
# The test runs long and does not have any specifics to
|
||||||
|
# binlog_format. It is choosen therefore to run with MIXED mode
|
||||||
|
# in order to not slow down much `make test'.
|
||||||
|
#
|
||||||
|
--source include/have_binlog_format_mixed.inc
|
||||||
--echo
|
--echo
|
||||||
|
|
||||||
--echo *** Preparing ***
|
--echo *** Preparing ***
|
||||||
|
@ -462,6 +468,9 @@ EOF
|
||||||
--enable_reconnect
|
--enable_reconnect
|
||||||
--source include/wait_until_connected_again.inc
|
--source include/wait_until_connected_again.inc
|
||||||
--connection slave
|
--connection slave
|
||||||
|
# make sure IO thread has re-connected
|
||||||
|
# due to slow valgrind env the following wait_for_status may time out
|
||||||
|
--source include/wait_for_slave_io_to_start.inc
|
||||||
# Wait until slave_received_heartbeats will be incremented
|
# Wait until slave_received_heartbeats will be incremented
|
||||||
let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
|
let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
|
||||||
let $status_var= slave_received_heartbeats;
|
let $status_var= slave_received_heartbeats;
|
||||||
|
@ -470,7 +479,7 @@ let $status_var_comparsion= >;
|
||||||
--echo Heartbeat event received
|
--echo Heartbeat event received
|
||||||
--echo
|
--echo
|
||||||
|
|
||||||
# Circular replication
|
# Circular replication: demonstrating bidirectional hearbeat flow
|
||||||
--echo *** Circular replication ***
|
--echo *** Circular replication ***
|
||||||
# Configure circular replication
|
# Configure circular replication
|
||||||
--source include/master-slave-reset.inc
|
--source include/master-slave-reset.inc
|
||||||
|
@ -499,15 +508,16 @@ SELECT * FROM t1 ORDER BY a;
|
||||||
let $master_rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
|
let $master_rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
|
||||||
--connection slave
|
--connection slave
|
||||||
SELECT * FROM t1 ORDER BY a;
|
SELECT * FROM t1 ORDER BY a;
|
||||||
# Wait heartbeat event on master
|
|
||||||
|
# Wait for heartbeat event on master
|
||||||
--connection master
|
--connection master
|
||||||
let $status_var= slave_received_heartbeats;
|
let $status_var= slave_received_heartbeats;
|
||||||
let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
|
let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
|
||||||
let $status_var_comparsion= >;
|
let $status_var_comparsion= >;
|
||||||
--source include/wait_for_status_var.inc
|
--source include/wait_for_status_var.inc
|
||||||
--echo Heartbeat event received on master
|
--echo Heartbeat event received on master
|
||||||
let $master_rcvd_heartbeats= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
|
|
||||||
# Wait heartbeat event on slave
|
# Wait heartbeat events on slave
|
||||||
--connection slave
|
--connection slave
|
||||||
let $status_var= slave_received_heartbeats;
|
let $status_var= slave_received_heartbeats;
|
||||||
let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
|
let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
|
||||||
|
@ -515,11 +525,6 @@ let $status_var_comparsion= >;
|
||||||
--source include/wait_for_status_var.inc
|
--source include/wait_for_status_var.inc
|
||||||
--echo Heartbeat event received on slave
|
--echo Heartbeat event received on slave
|
||||||
let $slave_rcvd_heartbeats= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
|
let $slave_rcvd_heartbeats= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
|
||||||
# Heartbeat period on slave less than on master therefore number of received events on slave
|
|
||||||
# should be greater than on master
|
|
||||||
let $result= query_get_value(SELECT ($slave_rcvd_heartbeats DIV $master_rcvd_heartbeats) > 1 AS Result, Result, 1);
|
|
||||||
--echo Slave has received more events than master (1 means 'yes'): $result
|
|
||||||
--echo
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Clean up and restore system variables
|
# Clean up and restore system variables
|
||||||
|
@ -533,5 +538,5 @@ DROP TABLE t1;
|
||||||
SET @@global.slave_net_timeout=@restore_slave_net_timeout;
|
SET @@global.slave_net_timeout=@restore_slave_net_timeout;
|
||||||
--echo
|
--echo
|
||||||
|
|
||||||
# End of 6.0 test
|
# End of tests
|
||||||
--echo End of 6.0 test
|
--echo End of tests
|
||||||
|
|
Loading…
Reference in a new issue