From 8010a4128dea3955724f60031d564077285d2138 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Fri, 28 Mar 2025 19:20:16 +0100 Subject: [PATCH] MDEV-36424: binlog_encryption.encrypted_master_switch_to_unencrypted_gtid Fails in BB 11.4+ The test case was missing a wait for the SQL thread to complete its work before checking the value of @@GLOBAL.gtid_slave_pos. Signed-off-by: Kristian Nielsen --- .../encrypted_master_switch_to_unencrypted_gtid.result | 3 +++ .../encrypted_master_switch_to_unencrypted_gtid.test | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.result b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.result index d05e3abd068..be7c9b819ff 100644 --- a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.result +++ b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.result @@ -59,6 +59,9 @@ INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption; connection server_2; start slave; include/wait_for_slave_io_error.inc [errno=1236] +SELECT MASTER_GTID_WAIT("LAST_UNENCRYPTED_GTID", 60); +MASTER_GTID_WAIT("LAST_UNENCRYPTED_GTID", 60) +0 # Ensuring slave was unable to replicate any encrypted transactions.. # ..success SHOW TABLES; diff --git a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.test b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.test index 7f717190cbf..f95262d99b2 100644 --- a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.test +++ b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.test @@ -122,6 +122,13 @@ start slave; --let $slave_io_errno= 1236 --source include/wait_for_slave_io_error.inc +# Wait for the SQL thread to have replicated to the expected point. Otherwise +# there is a race where the IO thread can stop with error and the test case +# check the @@GLOBAL.gtid_slave_pos before the SQL thread has had time to +# replicate the events queued by the IO thread (MDEV-36424). +--replace_result "$last_unencrypted_gtid" "LAST_UNENCRYPTED_GTID" +eval SELECT MASTER_GTID_WAIT("$last_unencrypted_gtid", 60); + --echo # Ensuring slave was unable to replicate any encrypted transactions.. --let $gsp= `SELECT @@global.gtid_slave_pos` if (`SELECT strcmp("$gsp","$last_unencrypted_gtid")`)