diff options
author | Jan Lindström <jplindst@mariadb.org> | 2013-11-27 08:43:46 +0200 |
---|---|---|
committer | Jan Lindström <jplindst@mariadb.org> | 2013-11-27 08:43:46 +0200 |
commit | 21bb5cdfb59629e4d35ba6bfea4d050bf2ec5f9a (patch) | |
tree | c77b2275745610fb332b0c9770ac68f4a1aab0fc /storage | |
parent | 480753972a96efa2dd9f59434ed811ffe788f08f (diff) | |
download | mariadb-git-21bb5cdfb59629e4d35ba6bfea4d050bf2ec5f9a.tar.gz |
MDEV-4223: Galera: InnoDB assertion failure !mutex_own(mutex) in file sync0sync.ic line 207
Analysis: Code acquired kernel_mutex when calling wsrep_innobase_kill_one_trx.
However, functions below also might take kernel mutex thus the assertion.
Fix: Acquire kernel_mutex only for lock_cancel_waiting_and_release where
it is really needed.
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 4 | ||||
-rw-r--r-- | storage/xtradb/handler/ha_innodb.cc | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index c2c7301bc97..028eea45726 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -12662,7 +12662,9 @@ wsrep_innobase_kill_one_trx(void *bf_thd_ptr, trx_t *bf_trx, trx_t *victim_trx, if (wait_lock) { WSREP_DEBUG("canceling wait lock"); victim_trx->was_chosen_as_deadlock_victim= TRUE; + mutex_enter(&kernel_mutex); lock_cancel_waiting_and_release(wait_lock); + mutex_exit(&kernel_mutex); } wsrep_thd_awake(bf_thd, thd, signal); @@ -12753,10 +12755,8 @@ wsrep_abort_transaction(handlerton* hton, THD *bf_thd, THD *victim_thd, if (victim_trx) { - mutex_enter(&kernel_mutex); int rcode = wsrep_innobase_kill_one_trx( bf_thd, bf_trx, victim_trx, signal); - mutex_exit(&kernel_mutex); wsrep_srv_conc_cancel_wait(victim_trx); DBUG_RETURN(rcode); } else { diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 2da3ead5abd..d1c6a971e4d 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -13985,7 +13985,9 @@ wsrep_innobase_kill_one_trx(trx_t *bf_trx, trx_t *victim_trx, ibool signal) if (wait_lock) { WSREP_DEBUG("canceling wait lock"); victim_trx->was_chosen_as_deadlock_victim= TRUE; + mutex_enter(&kernel_mutex); lock_cancel_waiting_and_release(wait_lock); + mutex_exit(&kernel_mutex); } wsrep_thd_awake(bf_thd, thd, signal); @@ -14076,10 +14078,8 @@ wsrep_abort_transaction(handlerton* hton, THD *bf_thd, THD *victim_thd, if (victim_trx) { - mutex_enter(&kernel_mutex); int rcode = wsrep_innobase_kill_one_trx(bf_trx, victim_trx, signal); - mutex_exit(&kernel_mutex); wsrep_srv_conc_cancel_wait(victim_trx); DBUG_RETURN(rcode); } else { |