Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions mysql-test/suite/galera/r/galera_sequences_recovery.result
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ SELECT LASTVAL(s);
LASTVAL(s)
12
SET GLOBAL innodb_log_checkpoint_now=1;
connection node_1_ctrl;
# Wait for the next_not_cached_value = 21 FROM s (1_ctrl)
connection node_1;
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
Expand Down
10 changes: 10 additions & 0 deletions mysql-test/suite/galera/t/galera_sequences_recovery.test
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ SELECT NEXTVAL(s);
SELECT LASTVAL(s);
SET GLOBAL innodb_log_checkpoint_now=1;

# Node 1 has an open transaction and wsrep_sync_wait is not effective
# inside a transaction. Wait here until node 1 has applied the sequence
# update replicated by NEXTVAL above, otherwise node 1 may still consume
# its own cached value before the update arrives.
--connection node_1_ctrl
--echo # Wait for the next_not_cached_value = 21 FROM s (1_ctrl)
--let $wait_condition = SELECT next_not_cached_value = 21 FROM s
--let $wait_condition_on_error_output = SELECT next_not_cached_value FROM s
--source include/wait_condition_with_debug.inc

--connection node_1
# Update the sequence value further
INSERT INTO t1(f2) values (1);
Expand Down