Commit fcd21d3e authored by Brandon Nesterenko's avatar Brandon Nesterenko

MDEV-34355: rpl.rpl_semi_sync_no_missed_ack_after_add_slave ‘server_3 should have sent…’

The problem is that the test could query the status variable
Rpl_semi_sync_slave_send_ack before the slave actually updated it.
This would result in an immediate --die assertion killing the rest
of the test. The bottom of this commit message has a small patch
that can be applied to reproduce the test failure.

This patch fixes the test failure by waiting for the variable to be
updated before querying its value.

diff --git a/sql/semisync_slave.cc b/sql/semisync_slave.cc
index 9ddd4c5c8d7..60538079fce 100644
--- a/sql/semisync_slave.cc
+++ b/sql/semisync_slave.cc
@@ -303,7 +303,10 @@ int Repl_semi_sync_slave::slave_reply(Master_info *mi)
     reply_res= DBUG_EVALUATE_IF("semislave_failed_net_flush", 1,
                                 net_flush(net));
     if (!reply_res)
+    {
+      sleep(1);
       rpl_semi_sync_slave_send_ack++;
+    }
   }
   DBUG_RETURN(reply_res);
 }
parent 27834ebc
...@@ -70,6 +70,10 @@ if (`SELECT $slave1_sent_ack`) ...@@ -70,6 +70,10 @@ if (`SELECT $slave1_sent_ack`)
--connection server_3 --connection server_3
--echo # Verifying server_3 did send ACK --echo # Verifying server_3 did send ACK
--let $status_var= Rpl_semi_sync_slave_send_ack
--let $status_var_comparsion= >
--let $status_var_value= 0
--source include/wait_for_status_var.inc
--let $slave2_sent_ack= query_get_value(SHOW STATUS LIKE 'rpl_semi_sync_slave_send_ack', Value, 1) --let $slave2_sent_ack= query_get_value(SHOW STATUS LIKE 'rpl_semi_sync_slave_send_ack', Value, 1)
if (`SELECT NOT $slave2_sent_ack`) if (`SELECT NOT $slave2_sent_ack`)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment