Current Path : /home/usr.opt/mysql57/mysql-test/suite/rpl/t/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //home/usr.opt/mysql57/mysql-test/suite/rpl/t/rpl_sbm_fake_rotate_event.test |
############################################################################### # Bug#23532304 SECONDS_BEHIND_MASTER REPORTS IO_THREAD TIME WHEN USING MTS & # ROTATING RELAY-LOG # Problem: The value of 'Seconds_Behind_Master' (SBM) reports distorted number # when rotating a relay-log. # # Steps to reproduce: # 1) Fake that I/O thread is started 3 minutes ago using a debug point. # 2) Flush the logs on the master which would have generated fake rotate # event # 3) While the fake rotate event is getting executing, calculate the SBM # 4) Compare the executed SBM that it is not greater than or equal to I/O # thread's active time. # 5) Clean the debug point. # ############################################################################### --source include/have_debug_sync.inc --let rpl_skip_start_slave=1 --source include/master-slave.inc # Step-1 Set sync debug point to calculate sbm exactly after fake # rotate log event. --source include/rpl_connection_slave.inc SET @save_global_debug=@@GLOBAL.DEBUG; # This debug point internally fake that IO thread is started 3 minutes ago. SET @@GLOBAL.DEBUG= '+d,dbug.calculate_sbm_after_fake_rotate_log_event'; # Start slave threads after enabling the debug point. --disable_warnings --source include/start_slave.inc --enable_warnings # Step-2 Flush logs on master which will generate a fake rotate event. --source include/rpl_connection_master.inc FLUSH LOGS; # Step-3 There will be two fake rotate events (first one while the initial setup # in master-slave.inc and second one due to FLUSH LOGS execution on master). # The following will test SBM calculation while both events are getting # executed. --source include/rpl_connection_slave.inc --let $iter=0 while ($iter < 2) { # Step-4: Calcualte SBM while fake rotate log event is getting executed. # It should be approximately zero (some times little more than zero # if this test is run on a slow pb2 machine). Comparing with the # I/O thread age that it should be atleast less # than the age of I/O thread. SET DEBUG_SYNC="now wait_for signal.reached"; let $sbm= query_get_value("SHOW SLAVE STATUS", Seconds_Behind_Master, 1); --let $assert_text= Seconds Behind Master should be less than IO_THREAD's time. --let $assert_cond= $sbm < 180 --source include/assert.inc SET DEBUG_SYNC="now signal signal.done_sbm_calculation"; --inc $iter } # Step-5: Cleanup SET @@GLOBAL.DEBUG=@save_global_debug; --source include/rpl_end.inc