Bug #118782 rpl_semi_sync_binlog_suffix_exceed_six_digit test doesn't test the Bug#37024069 scenario
Submitted: 5 Aug 10:49 Modified: 5 Aug 11:13
Reporter: Varun Nagaraju (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:Tests: Replication Severity:S7 (Test Cases)
Version:8.0.43 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution

[5 Aug 10:49] Varun Nagaraju
Description:
The MTR test in MySQL 8.0.43 for Bug#37024069, rpl_semi_sync_binlog_suffix_exceed_six_digit.test doesn't test the scenario of the fix. 
According to the comments in the test file, an INSERT statement is executed on the master which checks if the the replication type is switched to async or not.

# ==== Implementation ====
# 1. Initial setup
# 2. Reset the binary log and set the suffix to 999999.
# 3. Start replicating from the binlog file with suffix 999999.
# 4. Insert 2 rows, this will cause binary log to rotate
#    from six digit suffix to seven digit suffix
# 5. Stop the replica
# 6. Execute an insert on source and verify that it doesn't commit even after
#    a sleep of 1 second. The source will commit after the
#    rpl_semi_sync_source_timeout.
# 7. Start the replica.
# 8. Cleanup.

But, in the test the INSERT statement is performed on the SLAVE which is not what was intended and the test passes without the fix.

--echo #
--echo # 6. Execute an insert on source and verify that it doesn't commit even
--echo #    after a sleep of 1 second. The source will commit after the
--echo #    rpl_semi_sync_source_timeout.
--echo #
--source include/rpl_connection_slave.inc

--let $row_count_before= `SELECT COUNT(*) FROM t2`
--let $yes_tx_before = query_get_value(SHOW STATUS LIKE 'Rpl_semi_sync_yes_tx', Value, 1)

--send INSERT INTO t2 VALUES ('a')
--sleep 1
--source include/rpl_connection_master1.inc
--let $row_count_after= `SELECT COUNT(*) FROM t2`
--let $yes_tx_after = query_get_value(SHOW STATUS LIKE 'Rpl_semi_sync_yes_tx', Value, 1)

# When the replica is stopped, the INSERT query will only succeed
# after the value for rpl_semi_sync_source_timeout elapses.

--let $assert_text = Row count has not been updated
--let $assert_cond = "$row_count_before" = "$row_count_after"
--source include/assert.inc

# The number of commits that were acknowledged successfully by a replica
# should remain unchanged.

--let $assert_text = Status variable Rpl_semi_sync_yes_tx is unchanged
--let $assert_cond = "$yes_tx_before" = "$yes_tx_after"
--source include/assert.inc

--source include/rpl_connection_slave.inc
--reap;

How to repeat:
Run the MTR test rpl_semi_sync_binlog_suffix_exceed_six_digit without the fix.
[5 Aug 10:50] Varun Nagaraju
adding the patch as contribution

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: 0001-Bug-37024069-Fixes-rpl_semi_sync_binlog_suffix_excee.patch (text/x-patch), 2.42 KiB.

[5 Aug 11:13] MySQL Verification Team
Hello Varun Nagaraju,

Thank you for the report and contribution.

regards,
Umesh