summaryrefslogtreecommitdiff
path: root/storage/innobase/lock
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-03-13 14:19:03 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2018-03-16 15:50:04 +0200
commitf93a219c72b6b6c2ba023a002434738ec913ddad (patch)
treea8eac399670550aa272db9ce75c8ed19837b4e17 /storage/innobase/lock
parentcac373f5333ad8dcfbc2b9d512ccc589f241008e (diff)
downloadmariadb-git-f93a219c72b6b6c2ba023a002434738ec913ddad.tar.gz
MDEV-13935 INSERT stuck at state Unlocking tables
lock_rec_queue_validate(): Restore some assertions. DeadlockChecker::select_victim(): Reduce the WSREP-related diff.
Diffstat (limited to 'storage/innobase/lock')
-rw-r--r--storage/innobase/lock/lock0lock.cc49
1 files changed, 20 insertions, 29 deletions
diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc
index c15e5547d8a..99b771a9887 100644
--- a/storage/innobase/lock/lock0lock.cc
+++ b/storage/innobase/lock/lock0lock.cc
@@ -1284,7 +1284,7 @@ wsrep_kill_victim(
}
wsrep_innobase_kill_one_trx(trx->mysql_thd,
- (const trx_t*) trx, lock->trx, TRUE);
+ trx, lock->trx, TRUE);
}
}
}
@@ -5669,22 +5669,20 @@ lock_rec_queue_validate(
/* impl_trx cannot be committed until lock_mutex_exit()
because lock_trx_release_locks() acquires lock_sys->mutex */
- if (impl_trx != NULL) {
- const lock_t* other_lock
- = lock_rec_other_has_expl_req(
- LOCK_S, block, true, heap_no,
- impl_trx);
-
+ if (!impl_trx) {
+ } else if (const lock_t* other_lock
+ = lock_rec_other_has_expl_req(
+ LOCK_S, block, true, heap_no,
+ impl_trx)) {
/* The impl_trx is holding an implicit lock on the
given record 'rec'. So there cannot be another
explicit granted lock. Also, there can be another
explicit waiting lock only if the impl_trx has an
explicit granted lock. */
- if (other_lock != NULL) {
#ifdef WITH_WSREP
- if (wsrep_on(other_lock->trx->mysql_thd) && !lock_get_wait(other_lock) ) {
-
+ if (wsrep_on(other_lock->trx->mysql_thd)) {
+ if (!lock_get_wait(other_lock) ) {
ib::info() << "WSREP impl BF lock conflict for my impl lock:\n BF:" <<
((wsrep_thd_is_BF(impl_trx->mysql_thd, FALSE)) ? "BF" : "normal") << " exec: " <<
wsrep_thd_exec_mode(impl_trx->mysql_thd) << " conflict: " <<
@@ -5702,18 +5700,16 @@ lock_rec_queue_validate(
wsrep_thd_query(otrx->mysql_thd);
}
- if (wsrep_on(other_lock->trx->mysql_thd) && !lock_rec_has_expl(
- LOCK_X | LOCK_REC_NOT_GAP,
- block, heap_no, impl_trx)) {
+ if (!lock_rec_has_expl(LOCK_X | LOCK_REC_NOT_GAP,
+ block, heap_no,
+ impl_trx)) {
ib::info() << "WSREP impl BF lock conflict";
}
-#else /* !WITH_WSREP */
- ut_a(lock_get_wait(other_lock));
- ut_a(lock_rec_has_expl(
- LOCK_X | LOCK_REC_NOT_GAP,
- block, heap_no, impl_trx));
+ } else
#endif /* WITH_WSREP */
- }
+ ut_ad(lock_get_wait(other_lock));
+ ut_ad(lock_rec_has_expl(LOCK_X | LOCK_REC_NOT_GAP,
+ block, heap_no, impl_trx));
}
}
@@ -7575,23 +7571,18 @@ DeadlockChecker::select_victim() const
#ifdef WITH_WSREP
if (wsrep_thd_is_BF(m_start->mysql_thd, TRUE)) {
return(m_wait_lock->trx);
- } else {
-#endif /* WITH_WSREP */
- return(m_start);
-#ifdef WITH_WSREP
}
-#endif
+#endif /* WITH_WSREP */
+ return(m_start);
}
#ifdef WITH_WSREP
if (wsrep_thd_is_BF(m_wait_lock->trx->mysql_thd, TRUE)) {
return(m_start);
- } else {
-#endif /* WITH_WSREP */
- return(m_wait_lock->trx);
-#ifdef WITH_WSREP
}
-#endif
+#endif /* WITH_WSREP */
+
+ return(m_wait_lock->trx);
}
/** Looks iteratively for a deadlock. Note: the joining transaction may