Skip to content

Commit

Permalink
Fixing rpl_raft_wait_for_ack
Browse files Browse the repository at this point in the history
Summary: There was a change in debug syncs on the plugin side.

Reviewed By: yichenshen

Differential Revision: D45130505

fbshipit-source-id: 8e242e5
  • Loading branch information
abhinav04sharma authored and facebook-github-bot committed Apr 19, 2023
1 parent 8a94981 commit 5fdafcc
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 54 deletions.
36 changes: 18 additions & 18 deletions mysql-test/suite/rpl_raft/r/rpl_raft_wait_for_ack.result
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ include/sync_slave_sql_with_master.inc
select @@global.raft_signal_async_dump_threads;
@@global.raft_signal_async_dump_threads
AFTER_CONSENSUS
set @@global.rpl_raft_debug_sync_point = 'replicationDone';
set @@global.rpl_raft_debug_sync_point = 'ReplicationDoneCallback';
insert into t1 values(1);
set @@global.rpl_raft_debug_sync_point_action = 'wait_for replicationDone';
set @@global.rpl_raft_debug_sync_point_action = 'wait_for ReplicationDoneCallback';
include/sync_slave_sql_with_master.inc
include/sync_slave_sql_with_master.inc
select * from t1;
Expand All @@ -75,7 +75,7 @@ a
select * from t1;
a
1
set @@global.rpl_raft_debug_sync_point_action = 'continue replicationDone';
set @@global.rpl_raft_debug_sync_point_action = 'continue ReplicationDoneCallback';
set @@global.rpl_raft_debug_sync_point = '';
include/sync_slave_sql_with_master.inc
include/sync_slave_sql_with_master.inc
Expand All @@ -95,9 +95,9 @@ a
select @@global.raft_signal_async_dump_threads;
@@global.raft_signal_async_dump_threads
AFTER_CONSENSUS
set @@global.rpl_raft_debug_sync_point = 'replicationDone';
set @@global.rpl_raft_debug_sync_point = 'ReplicationDoneCallback';
insert into t1 values(2);
set @@global.rpl_raft_debug_sync_point_action = 'wait_for replicationDone';
set @@global.rpl_raft_debug_sync_point_action = 'wait_for ReplicationDoneCallback';
include/sync_slave_sql_with_master.inc
select * from t1;
a
Expand All @@ -113,7 +113,7 @@ a
select * from t1;
a
1
set @@global.rpl_raft_debug_sync_point_action = 'continue replicationDone';
set @@global.rpl_raft_debug_sync_point_action = 'continue ReplicationDoneCallback';
set @@global.rpl_raft_debug_sync_point = '';
include/sync_slave_sql_with_master.inc
include/sync_slave_sql_with_master.inc
Expand All @@ -137,9 +137,9 @@ a
2
"Case 3: Test AFTER_ENGINE_COMMIT on leader"
set @@global.raft_signal_async_dump_threads = AFTER_ENGINE_COMMIT;
set @@global.rpl_raft_debug_sync_point = 'updateConsensusApplied';
set @@global.rpl_raft_debug_sync_point = 'UpdateConsensusApplied';
insert into t1 values(3);
set @@global.rpl_raft_debug_sync_point_action = 'wait_for updateConsensusApplied';
set @@global.rpl_raft_debug_sync_point_action = 'wait_for UpdateConsensusApplied';
include/sync_slave_sql_with_master.inc
include/sync_slave_sql_with_master.inc
select * from t1;
Expand All @@ -161,7 +161,7 @@ a
1
2
3
set @@global.rpl_raft_debug_sync_point_action = 'continue updateConsensusApplied';
set @@global.rpl_raft_debug_sync_point_action = 'continue UpdateConsensusApplied';
set @@global.rpl_raft_debug_sync_point = '';
include/sync_slave_sql_with_master.inc
include/sync_slave_sql_with_master.inc
Expand All @@ -188,9 +188,9 @@ a
set @@global.raft_signal_async_dump_threads = AFTER_CONSENSUS;
"Case 4: Test AFTER_ENGINE_COMMIT on follower"
set @@global.raft_signal_async_dump_threads = AFTER_ENGINE_COMMIT;
set @@global.rpl_raft_debug_sync_point = 'updateConsensusApplied';
set @@global.rpl_raft_debug_sync_point = 'UpdateConsensusApplied';
insert into t1 values(4);
set @@global.rpl_raft_debug_sync_point_action = 'wait_for updateConsensusApplied';
set @@global.rpl_raft_debug_sync_point_action = 'wait_for UpdateConsensusApplied';
include/sync_slave_sql_with_master.inc
select * from t1;
a
Expand All @@ -215,7 +215,7 @@ a
1
2
3
set @@global.rpl_raft_debug_sync_point_action = 'continue updateConsensusApplied';
set @@global.rpl_raft_debug_sync_point_action = 'continue UpdateConsensusApplied';
set @@global.rpl_raft_debug_sync_point = '';
include/sync_slave_sql_with_master.inc
include/sync_slave_sql_with_master.inc
Expand Down Expand Up @@ -248,9 +248,9 @@ a
set @@global.raft_signal_async_dump_threads = AFTER_CONSENSUS;
"Case 5: Check if rotation is handled correctly on leader"
flush binary logs;
set @@global.rpl_raft_debug_sync_point = 'replicationDone';
set @@global.rpl_raft_debug_sync_point = 'ReplicationDoneCallback';
insert into t1 values(5);
set @@global.rpl_raft_debug_sync_point_action = 'wait_for replicationDone';
set @@global.rpl_raft_debug_sync_point_action = 'wait_for ReplicationDoneCallback';
include/sync_slave_sql_with_master.inc
include/sync_slave_sql_with_master.inc
include/sync_slave_sql_with_master.inc
Expand Down Expand Up @@ -281,7 +281,7 @@ a
3
4
5
set @@global.rpl_raft_debug_sync_point_action = 'continue replicationDone';
set @@global.rpl_raft_debug_sync_point_action = 'continue ReplicationDoneCallback';
set @@global.rpl_raft_debug_sync_point = '';
include/sync_slave_sql_with_master.inc
include/sync_slave_sql_with_master.inc
Expand Down Expand Up @@ -317,9 +317,9 @@ a
5
"Case 6: Check if rotation is handled correctly on follower"
flush binary logs;
set @@global.rpl_raft_debug_sync_point = 'replicationDone';
set @@global.rpl_raft_debug_sync_point = 'ReplicationDoneCallback';
insert into t1 values(6);
set @@global.rpl_raft_debug_sync_point_action = 'wait_for replicationDone';
set @@global.rpl_raft_debug_sync_point_action = 'wait_for ReplicationDoneCallback';
include/sync_slave_sql_with_master.inc
include/sync_slave_sql_with_master.inc
select * from t1;
Expand Down Expand Up @@ -352,7 +352,7 @@ a
3
4
5
set @@global.rpl_raft_debug_sync_point_action = 'continue replicationDone';
set @@global.rpl_raft_debug_sync_point_action = 'continue ReplicationDoneCallback';
set @@global.rpl_raft_debug_sync_point = '';
include/sync_slave_sql_with_master.inc
include/sync_slave_sql_with_master.inc
Expand Down
72 changes: 36 additions & 36 deletions mysql-test/suite/rpl_raft/t/rpl_raft_wait_for_ack.test
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ echo "Case 1: Test AFTER_CONSENSUS on leader";
connection server_1;
# Should be AFTER_CONSENSUS
select @@global.raft_signal_async_dump_threads;
# Wait before executing replicationDone i.e. before commit hook
set @@global.rpl_raft_debug_sync_point = 'replicationDone';
# Wait before executing ReplicationDoneCallback i.e. before commit hook
set @@global.rpl_raft_debug_sync_point = 'ReplicationDoneCallback';

# Execute a trx on the leader
connection server_1_1;
send insert into t1 values(1);

# Wait till we've reached the beginning of replicationDone
# Wait till we've reached the beginning of ReplicationDoneCallback
connection server_1;
set @@global.rpl_raft_debug_sync_point_action = 'wait_for replicationDone';
set @@global.rpl_raft_debug_sync_point_action = 'wait_for ReplicationDoneCallback';

# Sync both raft nodes
let $sync_slave_connection= server_2;
Expand All @@ -80,9 +80,9 @@ select * from t1;
connection server_5;
select * from t1;

# Continue replicationDone
# Continue ReplicationDoneCallback
connection server_1;
set @@global.rpl_raft_debug_sync_point_action = 'continue replicationDone';
set @@global.rpl_raft_debug_sync_point_action = 'continue ReplicationDoneCallback';
set @@global.rpl_raft_debug_sync_point = '';

connection server_1_1;
Expand Down Expand Up @@ -113,16 +113,16 @@ echo "Case 2: Test AFTER_CONSENSUS on follower";
connection server_2;
# Should be AFTER_CONSENSUS
select @@global.raft_signal_async_dump_threads;
# Wait before executing replicationDone
set @@global.rpl_raft_debug_sync_point = 'replicationDone';
# Wait before executing ReplicationDoneCallback
set @@global.rpl_raft_debug_sync_point = 'ReplicationDoneCallback';

# Execute a trx on the leader
connection server_1;
insert into t1 values(2);

# Wait till we've reached the beginning of replicationDone
# Wait till we've reached the beginning of ReplicationDoneCallback
connection server_2;
set @@global.rpl_raft_debug_sync_point_action = 'wait_for replicationDone';
set @@global.rpl_raft_debug_sync_point_action = 'wait_for ReplicationDoneCallback';

# Sync server3
let $sync_slave_connection= server_3;
Expand All @@ -141,9 +141,9 @@ select * from t1;
connection server_5;
select * from t1;

# Continue replicationDone
# Continue ReplicationDoneCallback
connection server_2;
set @@global.rpl_raft_debug_sync_point_action = 'continue replicationDone';
set @@global.rpl_raft_debug_sync_point_action = 'continue ReplicationDoneCallback';
set @@global.rpl_raft_debug_sync_point = '';

connection server_1;
Expand Down Expand Up @@ -173,16 +173,16 @@ echo "Case 3: Test AFTER_ENGINE_COMMIT on leader";

connection server_1;
set @@global.raft_signal_async_dump_threads = AFTER_ENGINE_COMMIT;
# Wait before executing updateConsensusApplied i.e. after commit
set @@global.rpl_raft_debug_sync_point = 'updateConsensusApplied';
# Wait before executing UpdateConsensusApplied i.e. after commit
set @@global.rpl_raft_debug_sync_point = 'UpdateConsensusApplied';

# Execute a trx on the leader
connection server_1_1;
send insert into t1 values(3);

# Wait till we've reached the beginning of replicationDone
# Wait till we've reached the beginning of ReplicationDoneCallback
connection server_1;
set @@global.rpl_raft_debug_sync_point_action = 'wait_for updateConsensusApplied';
set @@global.rpl_raft_debug_sync_point_action = 'wait_for UpdateConsensusApplied';

# Sync both raft nodes
let $sync_slave_connection= server_2;
Expand All @@ -203,9 +203,9 @@ select * from t1;
connection server_5;
select * from t1;

# Continue replicationDone
# Continue ReplicationDoneCallback
connection server_1;
set @@global.rpl_raft_debug_sync_point_action = 'continue updateConsensusApplied';
set @@global.rpl_raft_debug_sync_point_action = 'continue UpdateConsensusApplied';
set @@global.rpl_raft_debug_sync_point = '';

connection server_1_1;
Expand Down Expand Up @@ -236,16 +236,16 @@ echo "Case 4: Test AFTER_ENGINE_COMMIT on follower";

connection server_2;
set @@global.raft_signal_async_dump_threads = AFTER_ENGINE_COMMIT;
# Wait before executing updateConsensusApplied
set @@global.rpl_raft_debug_sync_point = 'updateConsensusApplied';
# Wait before executing UpdateConsensusApplied
set @@global.rpl_raft_debug_sync_point = 'UpdateConsensusApplied';

# Execute a trx on the leader
connection server_1;
insert into t1 values(4);

# Wait till we've reached the beginning of replicationDone
# Wait till we've reached the beginning of ReplicationDoneCallback
connection server_2;
set @@global.rpl_raft_debug_sync_point_action = 'wait_for updateConsensusApplied';
set @@global.rpl_raft_debug_sync_point_action = 'wait_for UpdateConsensusApplied';

# Sync server3
let $sync_slave_connection= server_3;
Expand All @@ -264,9 +264,9 @@ select * from t1;
connection server_5;
select * from t1;

# Continue replicationDone
# Continue ReplicationDoneCallback
connection server_2;
set @@global.rpl_raft_debug_sync_point_action = 'continue updateConsensusApplied';
set @@global.rpl_raft_debug_sync_point_action = 'continue UpdateConsensusApplied';
set @@global.rpl_raft_debug_sync_point = '';

connection server_1;
Expand Down Expand Up @@ -300,16 +300,16 @@ echo "Case 5: Check if rotation is handled correctly on leader";
connection server_1;
# Rotate raft log
flush binary logs;
# Wait before executing replicationDone i.e. before commit hook
set @@global.rpl_raft_debug_sync_point = 'replicationDone';
# Wait before executing ReplicationDoneCallback i.e. before commit hook
set @@global.rpl_raft_debug_sync_point = 'ReplicationDoneCallback';

# Execute a trx on the leader
connection server_1_1;
send insert into t1 values(5);

# Wait till we've reached the beginning of replicationDone
# Wait till we've reached the beginning of ReplicationDoneCallback
connection server_1;
set @@global.rpl_raft_debug_sync_point_action = 'wait_for replicationDone';
set @@global.rpl_raft_debug_sync_point_action = 'wait_for ReplicationDoneCallback';

let $sync_slave_connection= server_2;
source include/sync_slave_sql_with_master.inc;
Expand Down Expand Up @@ -337,9 +337,9 @@ select * from t1;
connection server_5;
select * from t1;

# Continue replicationDone
# Continue ReplicationDoneCallback
connection server_1;
set @@global.rpl_raft_debug_sync_point_action = 'continue replicationDone';
set @@global.rpl_raft_debug_sync_point_action = 'continue ReplicationDoneCallback';
set @@global.rpl_raft_debug_sync_point = '';

connection server_1_1;
Expand Down Expand Up @@ -374,16 +374,16 @@ connection server_1;
# Rotate raft logs
flush binary logs;
connection server_2;
# Wait before executing replicationDone
set @@global.rpl_raft_debug_sync_point = 'replicationDone';
# Wait before executing ReplicationDoneCallback
set @@global.rpl_raft_debug_sync_point = 'ReplicationDoneCallback';

# Execute a trx on the leader
connection server_1;
insert into t1 values(6);

# Wait till we've reached the beginning of replicationDone
# Wait till we've reached the beginning of ReplicationDoneCallback
connection server_2;
set @@global.rpl_raft_debug_sync_point_action = 'wait_for replicationDone';
set @@global.rpl_raft_debug_sync_point_action = 'wait_for ReplicationDoneCallback';

let $sync_slave_connection= server_3;
source include/sync_slave_sql_with_master.inc;
Expand All @@ -409,9 +409,9 @@ select * from t1;
connection server_5;
select * from t1;

# Continue replicationDone
# Continue ReplicationDoneCallback
connection server_2;
set @@global.rpl_raft_debug_sync_point_action = 'continue replicationDone';
set @@global.rpl_raft_debug_sync_point_action = 'continue ReplicationDoneCallback';
set @@global.rpl_raft_debug_sync_point = '';

# Sync all servers
Expand Down

0 comments on commit 5fdafcc

Please sign in to comment.