# ==== Purpose ==== # # The purpose of this test is to check that the XA recovery identifies # and reports errors returned by the SEs. # # ==== Requirements ==== # # R1. An error message describing the transaction and the error will be # outputted to the server log. # R2. Server will abort if any pending transaction fails to finish in the # SE. # # ==== Implementation ==== # # For each of the possible errors(1) returned by the SE and for each of the # possible actions(2) performed by the SE: # 1. Start the transaction and insert some record. # 2. Setup a conditional sync point for timestamp for the statement # associated with the one of the possible SE actions(2) and execute up # until that sync point. # 3. Kill the server. # 4. Restart server passing debug symbols that will simulate SEs returning # a given error(1) and expect crash during start. # 5. Find in the server log the error message corresponding to the # simulated error(1). # 6. Restart the server without the debug symbols. # # (1) List of possible errors returned by the SE: # - XAER_ASYNC # - XAER_RMERR # - XAER_NOTA # - XAER_INVAL # - XAER_PROTO # - XAER_RMFAIL # - XAER_DUPID # - XAER_OUTSIDE # # (2) List of possible SE actions during recovery: # - Commit a normal transaction # - Rollback a normal transaction # - Prepare an XA transaction # - Commit an XA transaction # - Rollback an XA transaction # - Commit an XA transaction with one-phase # # ==== References ==== # # WL#11300: Crash-safe XA + binary log # # Related tests; # see extra/xa_crash_safe_tests/setup.inc # --source include/have_binlog_format_row.inc --source include/not_valgrind.inc --source include/have_debug.inc --source include/have_debug_sync.inc --source include/big_test.inc let $messages = .*Crash recovery finished in InnoDB engine. Failed to.* .*Storage engines failed to recover one or more transactions* .*Can.t init tc log.* .*Aborting.*; --source include/suppress_messages.inc --let $xid = 'xid0' --source extra/xa_crash_safe_tests/setup.inc let $xa_errors = [ "XAER_ASYNC", "XAER_RMERR", "XAER_NOTA", "XAER_INVAL", "XAER_PROTO", "XAER_RMFAIL", "XAER_DUPID", "XAER_OUTSIDE" ]; --let $json_label = xa_error_list --source include/create_json_iterator.inc # Include $error_on_recovery_for_normal_transaction and # $error_on_recovery_for_xa_transaction procedures --source extra/xa_crash_safe_tests/utility_functions.inc --let $nth_iteration = 3 # Commit a normal transaction --let $action = commit --let $sync_point = before_commit_in_engines --source $error_on_recovery_for_normal_transaction # Rollback a normal transaction --let $action = rollback --let $sync_point = before_write_binlog --source $error_on_recovery_for_normal_transaction # Prepare an XA transaction --let $action = prepare --let $sync_point = before_set_prepared_in_tc --source $error_on_recovery_for_xa_transaction # Commit an XA transaction --let $action = commit --let $sync_point = before_commit_in_engines --source $error_on_recovery_for_xa_transaction # Rollback an XA transaction --let $action = rollback --let $sync_point = before_rollback_in_engines --source $error_on_recovery_for_xa_transaction # Commit an XA transaction with one-phase --let $action = commit --let $xa_opt = one phase --let $sync_point = before_commit_in_engines --source $error_on_recovery_for_xa_transaction --connection default DROP TABLE t1; --source extra/xa_crash_safe_tests/end_utility_functions.inc --source include/destroy_json_functions.inc