Skip to content

Commit

Permalink
main.alter_table_online_debug: fix race in XA tests
Browse files Browse the repository at this point in the history
  • Loading branch information
FooBarrior committed Nov 14, 2023
1 parent d59d883 commit e6acddf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
20 changes: 10 additions & 10 deletions mysql-test/main/alter_table_online_debug.result
Expand Up @@ -1577,10 +1577,10 @@ xa begin 'x1';
update t set a = 2 where a = 1;
xa end 'x1';
xa prepare 'x1';
set debug_sync= 'THD_cleanup_after_trans_cleanup signal xa_detach';
set debug_sync= 'thread_end signal xa_detach wait_for close';
disconnect con1;
connection con2;
set debug_sync= 'now wait_for xa_detach';
set debug_sync= 'now signal close wait_for xa_detach';
xa commit 'x1';
set debug_sync= 'now signal go';
connection default;
Expand All @@ -1596,10 +1596,10 @@ xa begin 'x2';
insert into t values (53);
xa end 'x2';
xa prepare 'x2';
set debug_sync= 'THD_cleanup_after_trans_cleanup signal xa_detach';
set debug_sync= 'thread_end signal xa_detach wait_for close';
disconnect con1;
connection con2;
set debug_sync= 'now wait_for xa_detach';
set debug_sync= 'now signal close wait_for xa_detach';
xa rollback 'x2';
set debug_sync= 'now signal go';
connection default;
Expand All @@ -1618,11 +1618,11 @@ insert into t values (3);
xa end 'xuncommitted';
xa prepare 'xuncommitted';
set debug_sync= 'now signal go';
set debug_sync= 'THD_cleanup_after_trans_cleanup signal xa_detach';
set debug_sync= 'thread_end signal xa_detach wait_for close';
disconnect con1;
connection default;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
set debug_sync= 'now wait_for xa_detach';
set debug_sync= 'now signal close wait_for xa_detach';
xa rollback 'xuncommitted';
select * from t;
a
Expand All @@ -1638,11 +1638,11 @@ insert into t values (3);
xa end 'committed_later';
xa prepare 'committed_later';
set debug_sync= 'now signal go';
set debug_sync= 'THD_cleanup_after_trans_cleanup signal xa_detach';
set debug_sync= 'thread_end signal xa_detach wait_for close';
disconnect con1;
connection default;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
set debug_sync= 'now wait_for xa_detach';
set debug_sync= 'now signal close wait_for xa_detach';
xa commit 'committed_later';
select * from t;
a
Expand All @@ -1659,10 +1659,10 @@ ERROR 23000: Duplicate entry '3' for key 'PRIMARY'
insert into t values (5);
xa end 'x1';
xa prepare 'x1';
set debug_sync= 'THD_cleanup_after_trans_cleanup signal xa_detach';
set debug_sync= 'thread_end signal xa_detach wait_for close';
disconnect con1;
connection con2;
set debug_sync= 'now wait_for xa_detach';
set debug_sync= 'now signal close wait_for xa_detach';
xa commit 'x1';
set debug_sync= 'now signal go';
connection default;
Expand Down
20 changes: 10 additions & 10 deletions mysql-test/main/alter_table_online_debug.test
Expand Up @@ -1810,11 +1810,11 @@ xa begin 'x1';
update t set a = 2 where a = 1;
xa end 'x1';
xa prepare 'x1';
set debug_sync= 'THD_cleanup_after_trans_cleanup signal xa_detach';
set debug_sync= 'thread_end signal xa_detach wait_for close';
--disconnect con1

--connection con2
set debug_sync= 'now wait_for xa_detach';
set debug_sync= 'now signal close wait_for xa_detach';
xa commit 'x1';
set debug_sync= 'now signal go';
--connection default
Expand All @@ -1832,11 +1832,11 @@ xa begin 'x2';
insert into t values (53);
xa end 'x2';
xa prepare 'x2';
set debug_sync= 'THD_cleanup_after_trans_cleanup signal xa_detach';
set debug_sync= 'thread_end signal xa_detach wait_for close';
--disconnect con1

--connection con2
set debug_sync= 'now wait_for xa_detach';
set debug_sync= 'now signal close wait_for xa_detach';
xa rollback 'x2';
set debug_sync= 'now signal go';
--connection default
Expand All @@ -1858,13 +1858,13 @@ insert into t values (3);
xa end 'xuncommitted';
xa prepare 'xuncommitted';
set debug_sync= 'now signal go';
set debug_sync= 'THD_cleanup_after_trans_cleanup signal xa_detach';
set debug_sync= 'thread_end signal xa_detach wait_for close';
--disconnect con1

--connection default
--error ER_LOCK_WAIT_TIMEOUT
--reap # alter table
set debug_sync= 'now wait_for xa_detach';
set debug_sync= 'now signal close wait_for xa_detach';
xa rollback 'xuncommitted';

select * from t;
Expand All @@ -1882,13 +1882,13 @@ insert into t values (3);
xa end 'committed_later';
xa prepare 'committed_later';
set debug_sync= 'now signal go';
set debug_sync= 'THD_cleanup_after_trans_cleanup signal xa_detach';
set debug_sync= 'thread_end signal xa_detach wait_for close';
--disconnect con1

--connection default
--error ER_LOCK_WAIT_TIMEOUT
--reap # alter table
set debug_sync= 'now wait_for xa_detach';
set debug_sync= 'now signal close wait_for xa_detach';
xa commit 'committed_later';


Expand All @@ -1906,11 +1906,11 @@ insert into t values (4), (3);
insert into t values (5);
xa end 'x1';
xa prepare 'x1';
set debug_sync= 'THD_cleanup_after_trans_cleanup signal xa_detach';
set debug_sync= 'thread_end signal xa_detach wait_for close';
--disconnect con1

--connection con2
set debug_sync= 'now wait_for xa_detach';
set debug_sync= 'now signal close wait_for xa_detach';
xa commit 'x1';
set debug_sync= 'now signal go';
--connection default
Expand Down

0 comments on commit e6acddf

Please sign in to comment.