summaryrefslogtreecommitdiff
path: root/storage/innobase/lock
diff options
context:
space:
mode:
authorJan Lindström <jplindst@mariadb.org>2013-10-15 12:03:57 +0300
committerJan Lindström <jplindst@mariadb.org>2013-10-15 12:03:57 +0300
commiteec8297107e52dc80999f3bb067c663149410d4b (patch)
treeea73fef0923502035721cfdfc08a6317ea696647 /storage/innobase/lock
parent1a34a56a9fb990ce09f58392144c8c1dd3cb4483 (diff)
downloadmariadb-git-eec8297107e52dc80999f3bb067c663149410d4b.tar.gz
Fixed performance schema instrumentation on galera and added correct mutexing when cancelling waiting trx on InnoDB
Diffstat (limited to 'storage/innobase/lock')
-rw-r--r--storage/innobase/lock/lock0lock.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc
index 8676446077b..78d34031bfc 100644
--- a/storage/innobase/lock/lock0lock.cc
+++ b/storage/innobase/lock/lock0lock.cc
@@ -1880,7 +1880,7 @@ lock_rec_create(
#ifdef WITH_WSREP
if (c_lock && wsrep_thd_is_brute_force(trx->mysql_thd)) {
- lock_t *hash = (lock_t*)c_lock->hash;
+ lock_t *hash = (lock_t*)c_lock->hash;
lock_t *prev = NULL;
while (hash &&
@@ -1899,9 +1899,10 @@ lock_rec_create(
* delayed conflict resolution '...kill_one_trx' was not called,
* if victim was waiting for some other lock
*/
- // if (c_lock && c_lock->trx->que_state == TRX_QUE_LOCK_WAIT) {
+ // if (c_lock && c_lock->trx->que_state == TRX_QUE_LOCK_WAIT) {
if (c_lock && c_lock->trx->lock.que_state == TRX_QUE_LOCK_WAIT) {
- // c_lock->trx->was_chosen_as_deadlock_victim = TRUE;
+ trx_t* c_trx = c_lock->trx;
+ // c_lock->trx->was_chosen_as_deadlock_victim = TRUE;
c_lock->trx->lock.was_chosen_as_deadlock_victim = TRUE;
//if (wsrep_debug && c_lock->trx->wait_lock != c_lock) {
@@ -1917,7 +1918,13 @@ lock_rec_create(
lock_set_lock_and_trx_wait(lock, trx);
// lock_cancel_waiting_and_release(c_lock->trx->wait_lock);
+ if (trx != c_trx) {
+ trx_mutex_enter(c_trx);
+ }
lock_cancel_waiting_and_release(c_lock->trx->lock.wait_lock);
+ if (trx != c_trx) {
+ trx_mutex_exit(c_trx);
+ }
/* trx might not wait for c_lock, but some other lock
does not matter if wait_lock was released above