Browse Source

MDEV-36663: Testcase Fixup

There were two issues with the test:

 1. A race between a race_condition.inc and status variable, where the
    status variable Rpl_semi_sync_master_status could be ON before the
    semi-sync connection finished establishing, resulting in
    Rpl_semi_sync_master_clients showing 0 (instead of 1). To fix this,
    we simply instead wait for Rpl_semi_sync_master_clients to be 1
    before proceeding.

 2. Another race between a race_condition.inc and status variable,
    where the wait_condition waited on a process_list command of
    'BINLOG DUMP' to disappear to infer the binlog dump thread was
    killed, to where we then verified semi-sync state was correct
    using status variables. However, the 'BINLOG DUMP' command is
    overridden with a killed status before the semi-sync tear-down
    happens, and thereby we could see invalid values. The fix for
    this is to change the wait_condition to instead wait for the
    connection with the replication user is gone, because that stays
    through the binlog dump thread tear-down life-cycle
remotes/origin/bb-10.11-MDEV-36663-testfix
Brandon Nesterenko 7 months ago
parent
commit
0db5622c4f
  1. 6
      mysql-test/suite/rpl/t/rpl_semi_sync_ssl_stop.test

6
mysql-test/suite/rpl/t/rpl_semi_sync_ssl_stop.test

@ -49,8 +49,8 @@ SET @@GLOBAL.rpl_semi_sync_slave_enabled= 1;
--connection master
--echo # Verify Semi-Sync is active
--let $status_var= Rpl_semi_sync_master_status
--let $status_var_value= ON
--let $status_var= Rpl_semi_sync_master_clients
--let $status_var_value= 1
--source include/wait_for_status_var.inc
SHOW STATUS LIKE 'Rpl_semi_sync_master_clients';
@ -67,7 +67,7 @@ STOP SLAVE;
--echo # MDEV-36663: Verifying dump thread connection is killed..
# Prior to MDEV-36663 fixes, this would time out and
# Rpl_semi_sync_master_clients would remain 1.
--let $wait_condition= SELECT COUNT(*)=0 FROM information_schema.PROCESSLIST WHERE COMMAND = 'Binlog Dump'
--let $wait_condition= SELECT COUNT(*)=0 FROM information_schema.PROCESSLIST WHERE USER = 'replssl'
--source include/wait_condition.inc
--let $n_master_clients= query_get_value(SHOW STATUS LIKE 'Rpl_semi_sync_master_clients', Value, 1)

Loading…
Cancel
Save