revision-id: 0bd8d9946831635325a8b72aec9433c769d4deb0 (mariadb-10.1.37-80-g0bd8d994683) parent(s): 27f1de5cb3ededcea5a54d43047b5c38c2965075 author: Jan Lindström committer: Jan Lindström timestamp: 2019-02-04 20:01:08 +0200 message: MDEV-18464: Port kill_one_trx fixes from 10.4 to 10.1 Pushed the decision for innodb transaction and system locking down to lock_trx_handle_wait() level. With this, we can avoid releasing these mutexes for executions where these mutexes were acquired upfront. This patch will also fix BF aborting of native threads, e.g. threads which have declared wsrep_on=OFF. Earlier, we have used, for innodb trx locks, was_chosen_as_deadlock_victim flag, for marking inodb transactions, which are victims for wsrep BF abort. With native threads (wsrep_on==OFF), re-using was_chosen_as_deadlock_victim flag may lead to inteference with real deadlock, and to deal with this, the patch has added new flag for marking wsrep BF aborts only: was_chosen_as_wsrep_victim innobase_kill_query() Removed lock mutex and trx mutex code. wsrep_innobase_kill_one_trx() Code cleanup and we will now use new was_chosen_as_wsrep_victim flag. wsrep_kill_victim() Removed unnecessary code. lock_trx_handle_wait_low() New low lever function to handle lock waits. lock_trx_handle_wait() Taking lock mutex and trx mutex is pushed down to this function. --- storage/innobase/handler/ha_innodb.cc | 72 ++++++++++------------------------ storage/innobase/include/trx0trx.h | 9 +++-- storage/innobase/lock/lock0lock.cc | 42 ++++++++++++++------ storage/innobase/row/row0sel.cc | 4 -- storage/innobase/trx/trx0roll.cc | 3 ++ storage/innobase/trx/trx0trx.cc | 9 +++-- storage/xtradb/handler/ha_innodb.cc | 73 +++++++++++------------------------ storage/xtradb/include/trx0trx.h | 11 ++++-- storage/xtradb/lock/lock0lock.cc | 42 ++++++++++++++------ storage/xtradb/row/row0sel.cc | 4 -- storage/xtradb/trx/trx0roll.cc | 6 +-- storage/xtradb/trx/trx0trx.cc | 8 ++-- 12 files changed, 130 insertions(+), 153 deletions(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 702f84a52d1..7f2dff51440 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -4912,8 +4912,6 @@ static void innobase_kill_query(handlerton*, THD* thd, enum thd_kill_levels) /* if victim has been signaled by BF thread and/or aborting is already progressing, following query aborting is not necessary any more. - Also, BF thread should own trx mutex for the victim, which would - conflict with trx_mutex_enter() below */ DBUG_VOID_RETURN; } @@ -4922,34 +4920,8 @@ static void innobase_kill_query(handlerton*, THD* thd, enum thd_kill_levels) if (trx_t* trx = thd_to_trx(thd)) { ut_ad(trx->mysql_thd == thd); - switch (trx->abort_type) { -#ifdef WITH_WSREP - case TRX_WSREP_ABORT: - break; -#endif - case TRX_SERVER_ABORT: - if (!wsrep_thd_is_BF(trx->mysql_thd, FALSE)) { - lock_mutex_enter(); - } - /* fall through */ - case TRX_REPLICATION_ABORT: - trx_mutex_enter(trx); - } /* Cancel a pending lock request if there are any */ lock_trx_handle_wait(trx); - switch (trx->abort_type) { -#ifdef WITH_WSREP - case TRX_WSREP_ABORT: - break; -#endif - case TRX_SERVER_ABORT: - if (!wsrep_thd_is_BF(trx->mysql_thd, FALSE)) { - lock_mutex_exit(); - } - /* fall through */ - case TRX_REPLICATION_ABORT: - trx_mutex_exit(trx); - } } DBUG_VOID_RETURN; @@ -18593,7 +18565,7 @@ wsrep_innobase_kill_one_trx( ut_ad(victim_trx); DBUG_ENTER("wsrep_innobase_kill_one_trx"); - THD *bf_thd = bf_thd_ptr ? (THD*) bf_thd_ptr : NULL; + THD *bf_thd = (THD *) bf_thd_ptr; THD *thd = (THD *) victim_trx->mysql_thd; int64_t bf_seqno = (bf_thd) ? wsrep_thd_trx_seqno(bf_thd) : 0; @@ -18603,27 +18575,28 @@ wsrep_innobase_kill_one_trx( DBUG_RETURN(1); } - if (!bf_thd) { - DBUG_PRINT("wsrep", ("no BF thd for conflicting lock")); - WSREP_WARN("no BF THD for trx: " TRX_ID_FMT, - bf_trx ? bf_trx->id : 0); - DBUG_RETURN(1); - } - WSREP_LOG_CONFLICT(bf_thd, thd, TRUE); - WSREP_DEBUG("BF kill (%lu, seqno: %lld), victim: (%lu) trx: " - TRX_ID_FMT, - signal, (long long)bf_seqno, + wsrep_thd_LOCK(thd); + + WSREP_DEBUG("BF kill (" ULINTPF ", seqno: " INT64PF + "), victim: (%lu) trx: " TRX_ID_FMT, + signal, bf_seqno, thd_get_thread_id(thd), victim_trx->id); - WSREP_DEBUG("Aborting query: %s conf %d trx: %" PRId64, - (thd && wsrep_thd_query(thd)) ? wsrep_thd_query(thd) : "void", - wsrep_thd_conflict_state(thd, FALSE), + WSREP_DEBUG("Aborting query: %s conflict_state %s trx: %" PRId64, + (wsrep_thd_query(thd) ? wsrep_thd_query(thd) : "void"), + wsrep_thd_conflict_state_str(thd), wsrep_thd_ws_handle(thd)->trx_id); - wsrep_thd_LOCK(thd); + /* + * we mark with was_chosen_as_deadlock_victim transaction, + * which is already marked as BF victim + * lock_sys is held until this vicitm has aborted + */ + victim_trx->lock.was_chosen_as_wsrep_victim = TRUE; + DBUG_EXECUTE_IF("sync.wsrep_after_BF_victim_lock", { const char act[]= @@ -18633,7 +18606,6 @@ wsrep_innobase_kill_one_trx( STRING_WITH_LEN(act))); };); - if (wsrep_thd_query_state(thd) == QUERY_EXITING) { WSREP_DEBUG("kill trx EXITING for " TRX_ID_FMT, victim_trx->id); @@ -18642,9 +18614,9 @@ wsrep_innobase_kill_one_trx( } if(wsrep_thd_exec_mode(thd) != LOCAL_STATE) { - WSREP_DEBUG("withdraw for BF trx: " TRX_ID_FMT ", state: %d", + WSREP_DEBUG("withdraw for BF trx: " TRX_ID_FMT ", state: %s", victim_trx->id, - wsrep_thd_get_conflict_state(thd)); + wsrep_thd_conflict_state_str(thd)); } switch (wsrep_thd_get_conflict_state(thd)) { @@ -18661,8 +18633,8 @@ wsrep_innobase_kill_one_trx( case ABORTED: case ABORTING: // fall through default: - WSREP_DEBUG("victim " TRX_ID_FMT " in state %d", - victim_trx->id, wsrep_thd_get_conflict_state(thd)); + WSREP_DEBUG("victim " TRX_ID_FMT " in state %s", + victim_trx->id, wsrep_thd_conflict_state_str(thd)); wsrep_thd_UNLOCK(thd); DBUG_RETURN(0); break; @@ -18765,9 +18737,9 @@ wsrep_innobase_kill_one_trx( wsrep_thd_trx_seqno(thd)); DBUG_RETURN(0); } + /* This will lock thd from proceeding after net_read() */ wsrep_thd_set_conflict_state(thd, ABORTING); - wsrep_lock_rollback(); if (wsrep_aborting_thd_contains(thd)) { @@ -18819,12 +18791,10 @@ wsrep_abort_transaction( if (victim_trx) { lock_mutex_enter(); trx_mutex_enter(victim_trx); - victim_trx->abort_type = TRX_WSREP_ABORT; int rcode = wsrep_innobase_kill_one_trx(bf_thd, bf_trx, victim_trx, signal); trx_mutex_exit(victim_trx); lock_mutex_exit(); - victim_trx->abort_type = TRX_SERVER_ABORT; wsrep_srv_conc_cancel_wait(victim_trx); DBUG_RETURN(rcode); } else { diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h index fe16b8272b8..50405fee69b 100644 --- a/storage/innobase/include/trx0trx.h +++ b/storage/innobase/include/trx0trx.h @@ -624,6 +624,12 @@ struct trx_lock_t { only be modified by the thread that is serving the running transaction. */ +#ifdef WITH_WSREP + bool was_chosen_as_wsrep_victim; + /*!< high priority wsrep thread has + marked this trx to abort */ +#endif /* WITH_WSREP */ + mem_heap_t* lock_heap; /*!< memory heap for trx_locks; protected by lock_sys->mutex */ @@ -697,9 +703,6 @@ lock_sys->mutex and sometimes by trx->mutex. */ enum trx_abort_t { TRX_SERVER_ABORT = 0, -#ifdef WITH_WSREP - TRX_WSREP_ABORT, -#endif TRX_REPLICATION_ABORT }; diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index 3970a559a4c..dcf5b5ecfd0 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -1793,10 +1793,8 @@ wsrep_kill_victim( } } - lock->trx->abort_type = TRX_WSREP_ABORT; wsrep_innobase_kill_one_trx(trx->mysql_thd, (const trx_t*) trx, lock->trx, TRUE); - lock->trx->abort_type = TRX_SERVER_ABORT; } } } @@ -7967,16 +7965,7 @@ lock_trx_release_locks( lock_mutex_exit(); } -/*********************************************************************//** -Check whether the transaction has already been rolled back because it -was selected as a deadlock victim, or if it has to wait then cancel -the wait lock. -@return DB_DEADLOCK, DB_LOCK_WAIT or DB_SUCCESS */ -UNIV_INTERN -dberr_t -lock_trx_handle_wait( -/*=================*/ - trx_t* trx) /*!< in/out: trx lock state */ +static inline dberr_t lock_trx_handle_wait_low(trx_t* trx) { ut_ad(lock_mutex_own()); ut_ad(trx_mutex_own(trx)); @@ -7993,6 +7982,35 @@ lock_trx_handle_wait( return DB_LOCK_WAIT; } +/*********************************************************************//** +Check whether the transaction has already been rolled back because it +was selected as a deadlock victim, or if it has to wait then cancel +the wait lock. +@return DB_DEADLOCK, DB_LOCK_WAIT or DB_SUCCESS */ +UNIV_INTERN +dberr_t +lock_trx_handle_wait( +/*=================*/ + trx_t* trx) /*!< in/out: trx lock state */ +{ +#ifdef WITH_WSREP + /* We already own mutexes */ + if (trx->lock.was_chosen_as_wsrep_victim) { + return lock_trx_handle_wait_low(trx); + } +#endif /* WITH_WSREP */ + if (trx->abort_type != TRX_REPLICATION_ABORT) { + lock_mutex_enter(); + } + trx_mutex_enter(trx); + dberr_t err = lock_trx_handle_wait_low(trx); + if (trx->abort_type != TRX_REPLICATION_ABORT) { + lock_mutex_exit(); + } + trx_mutex_exit(trx); + return err; +} + /*********************************************************************//** Get the number of locks on a table. @return number of locks */ diff --git a/storage/innobase/row/row0sel.cc b/storage/innobase/row/row0sel.cc index 06bf4cc30c0..855266686e6 100644 --- a/storage/innobase/row/row0sel.cc +++ b/storage/innobase/row/row0sel.cc @@ -4746,11 +4746,7 @@ row_search_for_mysql( a deadlock and the transaction had to wait then release the lock it is waiting on. */ - lock_mutex_enter(); - trx_mutex_enter(trx); err = lock_trx_handle_wait(trx); - lock_mutex_exit(); - trx_mutex_exit(trx); switch (err) { case DB_SUCCESS: diff --git a/storage/innobase/trx/trx0roll.cc b/storage/innobase/trx/trx0roll.cc index 3fd71aff23a..be8b7d29350 100644 --- a/storage/innobase/trx/trx0roll.cc +++ b/storage/innobase/trx/trx0roll.cc @@ -370,6 +370,9 @@ trx_rollback_to_savepoint_for_mysql_low( trx_mark_sql_stat_end(trx); trx->op_info = ""; +#ifdef WITH_WSREP + trx->lock.was_chosen_as_wsrep_victim = FALSE; +#endif return(err); } diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index f36aabba8b4..f79ca7a2bc0 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -168,6 +168,9 @@ trx_create(void) #ifdef WITH_WSREP trx->wsrep_event = NULL; #endif /* WITH_WSREP */ + + trx->abort_type = TRX_SERVER_ABORT; + return(trx); } @@ -1339,12 +1342,10 @@ trx_commit_in_memory( ut_ad(!trx->in_ro_trx_list); ut_ad(!trx->in_rw_trx_list); + trx->dict_operation = TRX_DICT_OP_NONE; #ifdef WITH_WSREP - if (trx->mysql_thd && wsrep_on(trx->mysql_thd)) { - trx->lock.was_chosen_as_deadlock_victim = FALSE; - } + trx->lock.was_chosen_as_wsrep_victim = FALSE; #endif - trx->dict_operation = TRX_DICT_OP_NONE; trx->error_state = DB_SUCCESS; diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index d3be5155d27..09a8d36709d 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -5517,43 +5517,15 @@ static void innobase_kill_query(handlerton*, THD* thd, enum thd_kill_levels) /* if victim has been signaled by BF thread and/or aborting is already progressing, following query aborting is not necessary any more. - Also, BF thread should own trx mutex for the victim, which would - conflict with trx_mutex_enter() below */ DBUG_VOID_RETURN; } #endif /* WITH_WSREP */ + if (trx_t* trx = thd_to_trx(thd)) { ut_ad(trx->mysql_thd == thd); - - switch (trx->abort_type) { -#ifdef WITH_WSREP - case TRX_WSREP_ABORT: - break; -#endif - case TRX_SERVER_ABORT: - if (!wsrep_thd_is_BF(trx->mysql_thd, FALSE)) { - lock_mutex_enter(); - } - /* fall through */ - case TRX_REPLICATION_ABORT: - trx_mutex_enter(trx); - } /* Cancel a pending lock request if there are any */ lock_trx_handle_wait(trx); - switch (trx->abort_type) { -#ifdef WITH_WSREP - case TRX_WSREP_ABORT: - break; -#endif - case TRX_SERVER_ABORT: - if (!wsrep_thd_is_BF(trx->mysql_thd, FALSE)) { - lock_mutex_exit(); - } - /* fall through */ - case TRX_REPLICATION_ABORT: - trx_mutex_exit(trx); - } } DBUG_VOID_RETURN; @@ -19636,7 +19608,7 @@ wsrep_innobase_kill_one_trx( ut_ad(victim_trx); DBUG_ENTER("wsrep_innobase_kill_one_trx"); - THD *bf_thd = bf_thd_ptr ? (THD*) bf_thd_ptr : NULL; + THD *bf_thd = (THD *) bf_thd_ptr; THD *thd = (THD *) victim_trx->mysql_thd; int64_t bf_seqno = (bf_thd) ? wsrep_thd_trx_seqno(bf_thd) : 0; @@ -19646,25 +19618,28 @@ wsrep_innobase_kill_one_trx( DBUG_RETURN(1); } - if (!bf_thd) { - DBUG_PRINT("wsrep", ("no BF thd for conflicting lock")); - WSREP_WARN("no BF THD for trx: " TRX_ID_FMT, - bf_trx ? bf_trx->id : 0); - DBUG_RETURN(1); - } - WSREP_LOG_CONFLICT(bf_thd, thd, TRUE); - WSREP_DEBUG("BF kill (%lu, seqno: %lld), victim: (%lu) trx: " - TRX_ID_FMT, - signal, (long long)bf_seqno, + wsrep_thd_LOCK(thd); + + WSREP_DEBUG("BF kill (" ULINTPF ", seqno: " INT64PF + "), victim: (%lu) trx: " TRX_ID_FMT, + signal, bf_seqno, thd_get_thread_id(thd), victim_trx->id); - WSREP_DEBUG("Aborting query: %s", - (thd && wsrep_thd_query(thd)) ? wsrep_thd_query(thd) : "void"); + WSREP_DEBUG("Aborting query: %s conflict_state %s trx: %" PRId64, + (wsrep_thd_query(thd) ? wsrep_thd_query(thd) : "void"), + wsrep_thd_conflict_state_str(thd), + wsrep_thd_ws_handle(thd)->trx_id); + + /* + * we mark with was_chosen_as_deadlock_victim transaction, + * which is already marked as BF victim + * lock_sys is held until this vicitm has aborted + */ + victim_trx->lock.was_chosen_as_wsrep_victim = TRUE; - wsrep_thd_LOCK(thd); DBUG_EXECUTE_IF("sync.wsrep_after_BF_victim_lock", { const char act[]= @@ -19683,9 +19658,9 @@ wsrep_innobase_kill_one_trx( } if(wsrep_thd_exec_mode(thd) != LOCAL_STATE) { - WSREP_DEBUG("withdraw for BF trx: " TRX_ID_FMT ", state: %d", + WSREP_DEBUG("withdraw for BF trx: " TRX_ID_FMT ", state: %s", victim_trx->id, - wsrep_thd_get_conflict_state(thd)); + wsrep_thd_conflict_state_str(thd)); } switch (wsrep_thd_get_conflict_state(thd)) { @@ -19702,8 +19677,8 @@ wsrep_innobase_kill_one_trx( case ABORTED: case ABORTING: // fall through default: - WSREP_DEBUG("victim " TRX_ID_FMT " in state %d", - victim_trx->id, wsrep_thd_get_conflict_state(thd)); + WSREP_DEBUG("victim " TRX_ID_FMT " in state %s", + victim_trx->id, wsrep_thd_conflict_state_str(thd)); wsrep_thd_UNLOCK(thd); DBUG_RETURN(0); break; @@ -19806,9 +19781,9 @@ wsrep_innobase_kill_one_trx( wsrep_thd_trx_seqno(thd)); DBUG_RETURN(0); } + /* This will lock thd from proceeding after net_read() */ wsrep_thd_set_conflict_state(thd, ABORTING); - wsrep_lock_rollback(); if (wsrep_aborting_thd_contains(thd)) { @@ -19853,12 +19828,10 @@ wsrep_abort_transaction(handlerton* hton, THD *bf_thd, THD *victim_thd, if (victim_trx) { lock_mutex_enter(); trx_mutex_enter(victim_trx); - victim_trx->abort_type = TRX_WSREP_ABORT; int rcode = wsrep_innobase_kill_one_trx(bf_thd, bf_trx, victim_trx, signal); trx_mutex_exit(victim_trx); lock_mutex_exit(); - victim_trx->abort_type = TRX_SERVER_ABORT; wsrep_srv_conc_cancel_wait(victim_trx); DBUG_RETURN(rcode); } else { diff --git a/storage/xtradb/include/trx0trx.h b/storage/xtradb/include/trx0trx.h index 77afde4c35c..5c11d3ae292 100644 --- a/storage/xtradb/include/trx0trx.h +++ b/storage/xtradb/include/trx0trx.h @@ -673,6 +673,12 @@ struct trx_lock_t { only be modified by the thread that is serving the running transaction. */ +#ifdef WITH_WSREP + bool was_chosen_as_wsrep_victim; + /*!< high priority wsrep thread has + marked this trx to abort */ +#endif /* WITH_WSREP */ + mem_heap_t* lock_heap; /*!< memory heap for trx_locks; protected by lock_sys->mutex */ @@ -746,10 +752,7 @@ lock_sys->mutex and sometimes by trx->mutex. */ enum trx_abort_t { TRX_SERVER_ABORT = 0, -#ifdef WITH_WSREP - TRX_WSREP_ABORT, -#endif - TRX_REPLICATION_ABORT + TRX_REPLICATION_ABORT = 1 }; struct trx_t{ diff --git a/storage/xtradb/lock/lock0lock.cc b/storage/xtradb/lock/lock0lock.cc index 2183d281b78..53bd6e77fe8 100644 --- a/storage/xtradb/lock/lock0lock.cc +++ b/storage/xtradb/lock/lock0lock.cc @@ -1804,10 +1804,8 @@ wsrep_kill_victim( } } - lock->trx->abort_type = TRX_WSREP_ABORT; wsrep_innobase_kill_one_trx(trx->mysql_thd, (const trx_t*) trx, lock->trx, TRUE); - lock->trx->abort_type = TRX_SERVER_ABORT; } } } @@ -8077,16 +8075,7 @@ lock_trx_release_locks( lock_mutex_exit(); } -/*********************************************************************//** -Check whether the transaction has already been rolled back because it -was selected as a deadlock victim, or if it has to wait then cancel -the wait lock. -@return DB_DEADLOCK, DB_LOCK_WAIT or DB_SUCCESS */ -UNIV_INTERN -dberr_t -lock_trx_handle_wait( -/*=================*/ - trx_t* trx) /*!< in/out: trx lock state */ +static inline dberr_t lock_trx_handle_wait_low(trx_t* trx) { ut_ad(lock_mutex_own()); ut_ad(trx_mutex_own(trx)); @@ -8103,6 +8092,35 @@ lock_trx_handle_wait( return DB_LOCK_WAIT; } +/*********************************************************************//** +Check whether the transaction has already been rolled back because it +was selected as a deadlock victim, or if it has to wait then cancel +the wait lock. +@return DB_DEADLOCK, DB_LOCK_WAIT or DB_SUCCESS */ +UNIV_INTERN +dberr_t +lock_trx_handle_wait( +/*=================*/ + trx_t* trx) /*!< in/out: trx lock state */ +{ +#ifdef WITH_WSREP + /* We already own mutexes */ + if (trx->lock.was_chosen_as_wsrep_victim) { + return lock_trx_handle_wait_low(trx); + } +#endif /* WITH_WSREP */ + if (trx->abort_type != TRX_REPLICATION_ABORT) { + lock_mutex_enter(); + } + trx_mutex_enter(trx); + dberr_t err = lock_trx_handle_wait_low(trx); + if (trx->abort_type != TRX_REPLICATION_ABORT) { + lock_mutex_exit(); + } + trx_mutex_exit(trx); + return err; +} + /*********************************************************************//** Get the number of locks on a table. @return number of locks */ diff --git a/storage/xtradb/row/row0sel.cc b/storage/xtradb/row/row0sel.cc index b6b5d107885..87bc2aa2875 100644 --- a/storage/xtradb/row/row0sel.cc +++ b/storage/xtradb/row/row0sel.cc @@ -4755,11 +4755,7 @@ row_search_for_mysql( a deadlock and the transaction had to wait then release the lock it is waiting on. */ - lock_mutex_enter(); - trx_mutex_enter(trx); err = lock_trx_handle_wait(trx); - lock_mutex_exit(); - trx_mutex_exit(trx); switch (err) { case DB_SUCCESS: diff --git a/storage/xtradb/trx/trx0roll.cc b/storage/xtradb/trx/trx0roll.cc index 56b7120fa34..5e60725b9be 100644 --- a/storage/xtradb/trx/trx0roll.cc +++ b/storage/xtradb/trx/trx0roll.cc @@ -375,12 +375,8 @@ trx_rollback_to_savepoint_for_mysql_low( trx_mark_sql_stat_end(trx); trx->op_info = ""; - #ifdef WITH_WSREP - if (wsrep_on(trx->mysql_thd) && - trx->lock.was_chosen_as_deadlock_victim) { - trx->lock.was_chosen_as_deadlock_victim = FALSE; - } + trx->lock.was_chosen_as_wsrep_victim = FALSE; #endif return(err); diff --git a/storage/xtradb/trx/trx0trx.cc b/storage/xtradb/trx/trx0trx.cc index 17cba81daf3..81ffbc6e4e1 100644 --- a/storage/xtradb/trx/trx0trx.cc +++ b/storage/xtradb/trx/trx0trx.cc @@ -304,6 +304,8 @@ trx_create(void) trx->wsrep_event = NULL; #endif /* WITH_WSREP */ + trx->abort_type = TRX_SERVER_ABORT; + return(trx); } @@ -1563,12 +1565,10 @@ trx_commit_in_memory( ut_ad(!trx->in_ro_trx_list); ut_ad(!trx->in_rw_trx_list); + trx->dict_operation = TRX_DICT_OP_NONE; #ifdef WITH_WSREP - if (trx->mysql_thd && wsrep_on(trx->mysql_thd)) { - trx->lock.was_chosen_as_deadlock_victim = FALSE; - } + trx->lock.was_chosen_as_wsrep_victim = FALSE; #endif - trx->dict_operation = TRX_DICT_OP_NONE; trx->error_state = DB_SUCCESS;