1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
|
# This test checks the behavior of applier thread when shutdown is issued at
# various stages of the XA transaction. The session thread is marked as an
# applier thread by setting the pseudo_replica_mode and executing BINLOG''
# query.
#
# References:
# Bug#32416819: ASSERTION "UT_LIST_GET_LEN.TRX_SYS->MYSQL_TRX_LIST. == 0" ON
# SHUTDOWN
--source include/big_test.inc
--echo # Scenario 1: Simple test with CREATE TABLE before XA START
--echo # 1.1: Shutdown from same connection
--let $create_table = 1
--let $insert_table = 0
--let $need_xa_end = 0
--let $need_xa_prepare = 0
--let $need_xa_commit = 0
--let $need_xa_rollback = 0
--let $restart_connection = 0
--source include/xa_applier_shutdown.inc
--echo # 1.2: Shutdown from other connection
--let $create_table = 1
--let $insert_table = 0
--let $need_xa_end = 0
--let $need_xa_prepare = 0
--let $need_xa_commit = 0
--let $need_xa_rollback = 0
--let $restart_connection = conn_case_1_2
--source include/xa_applier_shutdown.inc
--echo # Scenario 2: After XA START
--echo # 2.1: Shutdown from same connection
--let $create_table = 0
--let $insert_table = 0
--let $need_xa_end = 0
--let $need_xa_prepare = 0
--let $need_xa_commit = 0
--let $need_xa_rollback = 0
--let $restart_connection = 0
--source include/xa_applier_shutdown.inc
--echo # 2.2: Shutdown from other connection
--let $create_table = 0
--let $insert_table = 0
--let $need_xa_end = 0
--let $need_xa_prepare = 0
--let $need_xa_commit = 0
--let $need_xa_rollback = 0
--let $restart_connection = conn_case_2_2
--source include/xa_applier_shutdown.inc
--echo # Scenario 3: After XA START + XA END
# restart_mysqld.inc checks for pid_file with `SHOW VARIABLES LIKE 'pid_file';`.
# However, since XA transaction is not yet prepared, this statement will fail.
# Hence it is necessary that the restart is issued from another connection.
--let $create_table = 0
--let $insert_table = 0
--let $need_xa_end = 1
--let $need_xa_prepare = 0
--let $need_xa_commit = 0
--let $need_xa_rollback = 0
--let $restart_connection = conn_case_3
--source include/xa_applier_shutdown.inc
--echo # Scenario 4: After XA START + XA END + XA PREPARE
--echo # 4.1: Shutdown from same connection
--let $create_table = 0
--let $insert_table = 0
--let $need_xa_end = 1
--let $need_xa_prepare = 1
--let $need_xa_commit = 0
--let $need_xa_rollback = 0
--let $restart_connection = 0
--source include/xa_applier_shutdown.inc
--echo # 4.2: Shutdown from other connection
--let $create_table = 0
--let $insert_table = 0
--let $need_xa_end = 1
--let $need_xa_prepare = 1
--let $need_xa_commit = 0
--let $need_xa_rollback = 0
--let $restart_connection = conn_case_4_2
--source include/xa_applier_shutdown.inc
--echo # Scenario 5: After XA START + INSERT
--echo # 5.1: Shutdown from same connection
--let $create_table = 1
--let $insert_table = 1
--let $need_xa_end = 0
--let $need_xa_prepare = 0
--let $need_xa_commit = 0
--let $need_xa_rollback = 0
--let $restart_connection = 0
--source include/xa_applier_shutdown.inc
--echo # 5.2: Shutdown from other connection
--let $create_table = 1
--let $insert_table = 1
--let $need_xa_end = 0
--let $need_xa_prepare = 0
--let $need_xa_commit = 0
--let $need_xa_rollback = 0
--let $restart_connection = conn_case_5_2
--source include/xa_applier_shutdown.inc
--echo # Scenario 6: After XA START + INSERT + XA END
# Restart from other connection is mandatory here, similar to case 3
--let $create_table = 1
--let $insert_table = 1
--let $need_xa_end = 1
--let $need_xa_prepare = 0
--let $need_xa_commit = 0
--let $need_xa_rollback = 0
--let $restart_connection = conn_case_6
--source include/xa_applier_shutdown.inc
--echo # Scenario 7: After XA START + INSERT + XA END + XA PREPARE, do restart
--echo # followed by XA ROLLBACK
--echo # 7.1: Shutdown from same connection
--let $create_table = 1
--let $insert_table = 1
--let $need_xa_end = 1
--let $need_xa_prepare = 1
--let $need_xa_commit = 0
--let $need_xa_rollback = 1
--let $restart_connection = 0
--source include/xa_applier_shutdown.inc
--echo # 7.2: Shutdown from other connection
--let $create_table = 1
--let $insert_table = 1
--let $need_xa_end = 1
--let $need_xa_prepare = 1
--let $need_xa_commit = 0
--let $need_xa_rollback = 1
--let $restart_connection = conn_case_7_2
--source include/xa_applier_shutdown.inc
--echo # Scenario 8: After XA START + INSERT + XA END + XA PREPARE, do restart
--echo # followed by XA COMMIT
--echo # 8.1: Shutdown from same connection
call mtr.add_suppression("Found 1 prepared XA transactions");
--let $create_table = 1
--let $insert_table = 1
--let $need_xa_end = 1
--let $need_xa_prepare = 1
--let $need_xa_commit = 1
--let $need_xa_rollback = 0
--let $restart_connection = 0
--source include/xa_applier_shutdown.inc
--echo # 8.2: Shutdown from other connection
--let $create_table = 1
--let $insert_table = 1
--let $need_xa_end = 1
--let $need_xa_prepare = 1
--let $need_xa_commit = 1
--let $need_xa_rollback = 0
--let $restart_connection = conn_case_8_2
--source include/xa_applier_shutdown.inc
--echo # Secenario 9: XA START + XA END + XA COMMIT ONE PHASE, do restart from
--echo # from other connection
--echo # 9.1: Without INSERTs
# restart_mysqld.inc checks for pid_file with `SHOW VARIABLES LIKE 'pid_file';`.
# However, since XA transaction is not yet prepared, this statement will fail.
# Hence it is necessary that the restart is issued from another connection.
--let $create_table = 1
--let $insert_table = 0
--let $need_xa_end = 1
--let $need_xa_commit_one = 1
--let $need_xa_prepare = 0
--let $need_xa_commit = 0
--let $need_xa_rollback = 0
--let $restart_connection = conn_case_9_1
--source include/xa_applier_shutdown.inc
--echo # 9.2: With INSERTs
# restart_mysqld.inc checks for pid_file with `SHOW VARIABLES LIKE 'pid_file';`.
# However, since XA transaction is not yet prepared, this statement will fail.
# Hence it is necessary that the restart is issued from another connection.
--let $create_table = 1
--let $insert_table = 1
--let $need_xa_end = 1
--let $need_xa_commit_one = 1
--let $need_xa_prepare = 0
--let $need_xa_commit = 0
--let $need_xa_rollback = 0
--let $restart_connection = conn_case_9_2
--source include/xa_applier_shutdown.inc
|