diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2015-12-14 10:10:09 +0200 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2015-12-14 10:10:09 +0200 |
commit | 4437f51682b22caaf2cf0b00de1bf6fa3edf6557 (patch) | |
tree | 4085bdff89bbd07fc020cd822b3486a201098108 /storage/xtradb/lock | |
parent | b88c67d5f23c6beca5604b31919ab45906dd9b39 (diff) | |
download | mariadb-git-4437f51682b22caaf2cf0b00de1bf6fa3edf6557.tar.gz |
MDEV-8869: Potential lock_sys->mutex deadlock
In wsrep brute force (BF) we have already took lock_sys and trx
mutex either on wsrep_abort_transaction() or
before wsrep_kill_victim().
Diffstat (limited to 'storage/xtradb/lock')
-rw-r--r-- | storage/xtradb/lock/lock0lock.cc | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/storage/xtradb/lock/lock0lock.cc b/storage/xtradb/lock/lock0lock.cc index 2291ba0db50..a41f60c24cd 100644 --- a/storage/xtradb/lock/lock0lock.cc +++ b/storage/xtradb/lock/lock0lock.cc @@ -1728,8 +1728,10 @@ wsrep_kill_victim( } } + lock->trx->wsrep_abort = TRUE; wsrep_innobase_kill_one_trx(trx->mysql_thd, (const trx_t*) trx, lock->trx, TRUE); + lock->trx->wsrep_abort = FALSE; } } } @@ -4424,9 +4426,7 @@ lock_report_waiters_to_mysql( innobase_kill_query. We mark this by setting current_lock_mutex_owner, so we can avoid trying to recursively take lock_sys->mutex. */ - w_trx->current_lock_mutex_owner = mysql_thd; thd_report_wait_for(mysql_thd, w_trx->mysql_thd); - w_trx->current_lock_mutex_owner = NULL; } ++i; } @@ -6836,7 +6836,7 @@ lock_clust_rec_modify_check_and_lock( lock_mutex_enter(); trx_t* trx = thr_get_trx(thr); - trx->current_lock_mutex_owner = trx->mysql_thd; + ut_ad(lock_table_has(trx, index->table, LOCK_IX)); err = lock_rec_lock(TRUE, LOCK_X | LOCK_REC_NOT_GAP, @@ -6844,7 +6844,6 @@ lock_clust_rec_modify_check_and_lock( MONITOR_INC(MONITOR_NUM_RECLOCK_REQ); - trx->current_lock_mutex_owner = NULL; lock_mutex_exit(); ut_ad(lock_rec_queue_validate(FALSE, block, rec, index, offsets)); @@ -6902,7 +6901,6 @@ lock_sec_rec_modify_check_and_lock( trx_t* trx = thr_get_trx(thr); lock_mutex_enter(); - trx->current_lock_mutex_owner = trx->mysql_thd; ut_ad(lock_table_has(trx, index->table, LOCK_IX)); @@ -6911,7 +6909,6 @@ lock_sec_rec_modify_check_and_lock( MONITOR_INC(MONITOR_NUM_RECLOCK_REQ); - trx->current_lock_mutex_owner = NULL; lock_mutex_exit(); #ifdef UNIV_DEBUG @@ -7013,7 +7010,6 @@ lock_sec_rec_read_check_and_lock( trx_t* trx = thr_get_trx(thr); lock_mutex_enter(); - trx->current_lock_mutex_owner = trx->mysql_thd; ut_ad(mode != LOCK_X || lock_table_has(trx, index->table, LOCK_IX)); @@ -7025,7 +7021,6 @@ lock_sec_rec_read_check_and_lock( MONITOR_INC(MONITOR_NUM_RECLOCK_REQ); - trx->current_lock_mutex_owner = NULL; lock_mutex_exit(); ut_ad(lock_rec_queue_validate(FALSE, block, rec, index, offsets)); @@ -7097,7 +7092,6 @@ lock_clust_rec_read_check_and_lock( lock_mutex_enter(); trx_t* trx = thr_get_trx(thr); - trx->current_lock_mutex_owner = trx->mysql_thd; ut_ad(mode != LOCK_X || lock_table_has(trx, index->table, LOCK_IX)); @@ -7109,7 +7103,6 @@ lock_clust_rec_read_check_and_lock( MONITOR_INC(MONITOR_NUM_RECLOCK_REQ); - trx->current_lock_mutex_owner = NULL; lock_mutex_exit(); ut_ad(lock_rec_queue_validate(FALSE, block, rec, index, offsets)); @@ -7256,6 +7249,19 @@ lock_get_type( } /*******************************************************************//** +Gets the trx of the lock. Non-inline version for using outside of the +lock module. +@return trx_t* */ +UNIV_INTERN +trx_t* +lock_get_trx( +/*=========*/ + const lock_t* lock) /*!< in: lock */ +{ + return (lock->trx); +} + +/*******************************************************************//** Gets the id of the transaction owning a lock. @return transaction id */ UNIV_INTERN |