1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-22953 main.flush_read_lock failed in buildbot with XAER_NOTA: Unknown XID

Issue:- Since there is no waiting for the actual disconnection of the con_tmp
(which does XA prepare of test1), We can have a issue when test1 is not
prepared and we are calling rollback on test1 , giving XAER_NOTA: Unknown XID
error

Solution:- Wait for the complete disconnection of con_tmp
This commit is contained in:
sachin
2021-04-02 00:33:13 +01:00
committed by Sachin Kumar
parent df33b719ca
commit 21973d0d8e
2 changed files with 20 additions and 8 deletions

View File

@ -1383,19 +1383,22 @@ insert into t3_trans values (1);
xa end 'test1'; xa end 'test1';
xa prepare 'test1'; xa prepare 'test1';
# Disconnect temporary connection # Disconnect temporary connection
set debug_sync='thread_end SIGNAL test1_prepare';
disconnect con_tmp; disconnect con_tmp;
connection con1;
set debug_sync='now WAIT_FOR test1_prepare';
# Create temporary connection for XA transaction. # Create temporary connection for XA transaction.
connect con_tmp,localhost,root,,; connect con_tmp1,localhost,root,,;
xa start 'test2'; xa start 'test2';
insert into t3_trans values (2); insert into t3_trans values (2);
xa end 'test2'; xa end 'test2';
xa prepare 'test2'; xa prepare 'test2';
# Disconnect temporary connection # Disconnect temporary connection
set debug_sync='thread_end SIGNAL detached'; set debug_sync='thread_end SIGNAL test2_prepare';
disconnect con_tmp; disconnect con_tmp1;
# Switching to connection 'con1'. # Switching to connection 'con1'.
connection con1; connection con1;
set debug_sync='now WAIT_FOR detached'; set debug_sync='now WAIT_FOR test2_prepare';
flush tables with read lock; flush tables with read lock;
# Switching to connection 'default'. # Switching to connection 'default'.
connection default; connection default;

View File

@ -1690,25 +1690,34 @@ insert into t3_trans values (1);
xa end 'test1'; xa end 'test1';
xa prepare 'test1'; xa prepare 'test1';
--echo # Disconnect temporary connection --echo # Disconnect temporary connection
set debug_sync='thread_end SIGNAL test1_prepare';
disconnect con_tmp; disconnect con_tmp;
connection $con_aux1;
set debug_sync='now WAIT_FOR test1_prepare';
--echo # Create temporary connection for XA transaction. --echo # Create temporary connection for XA transaction.
connect (con_tmp,localhost,root,,); connect (con_tmp1,localhost,root,,);
xa start 'test2'; xa start 'test2';
insert into t3_trans values (2); insert into t3_trans values (2);
xa end 'test2'; xa end 'test2';
xa prepare 'test2'; xa prepare 'test2';
--echo # Disconnect temporary connection --echo # Disconnect temporary connection
set debug_sync='thread_end SIGNAL detached'; set debug_sync='thread_end SIGNAL test2_prepare';
disconnect con_tmp; disconnect con_tmp1;
--echo # Switching to connection '$con_aux1'. --echo # Switching to connection '$con_aux1'.
connection $con_aux1; connection $con_aux1;
set debug_sync='now WAIT_FOR detached'; set debug_sync='now WAIT_FOR test2_prepare';
flush tables with read lock; flush tables with read lock;
--echo # Switching to connection 'default'. --echo # Switching to connection 'default'.
connection default; connection default;
--echo # Send XA ROLLBACK 'test1' --echo # Send XA ROLLBACK 'test1'
--send xa rollback 'test1' --send xa rollback 'test1'
--echo # Switching to connection '$con_aux1'. --echo # Switching to connection '$con_aux1'.
connection $con_aux1; connection $con_aux1;
--echo # Wait until XA ROLLBACK is blocked. --echo # Wait until XA ROLLBACK is blocked.
let $wait_condition= let $wait_condition=