Skip to content

Commit 7ca1e2a

Browse files
committed
MDEV-11422 rpl.rpl_parallel_optimistic_nobinlog failed in buildbot with "InnoDB: Killing connection failed Deadlock"
innobase_kill_query(): Remove the bogus warning message (for the valid outcome err==DB_DEADLOCK) that was added in commit fec844a Author: Jan Lindström <jan.lindstrom@mariadb.com> Date: Tue Sep 6 09:43:16 2016 +0300 Merge InnoDB 5.7 from mysql-5.7.14. Also, remove some redundant variables and add a debug assertion for enforcing the proper outcome of lock_trx_handle_wait().
1 parent 6816c80 commit 7ca1e2a

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

storage/innobase/handler/ha_innodb.cc

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5665,9 +5665,6 @@ innobase_kill_query(
56655665
/* Cancel a pending lock request if there are any */
56665666
bool lock_mutex_taken = false;
56675667
bool trx_mutex_taken = false;
5668-
bool already_have_lock_mutex = false;
5669-
bool already_have_trx_mutex = false;
5670-
dberr_t err = DB_SUCCESS;
56715668

56725669
if (trx->lock.wait_lock) {
56735670
WSREP_DEBUG("Killing victim trx %p BF %d trx BF %d trx_id " IB_ID_FMT " ABORT %d thd %p"
@@ -5681,38 +5678,30 @@ innobase_kill_query(
56815678
}
56825679

56835680
if (!wsrep_thd_is_BF(trx->mysql_thd, FALSE)) {
5684-
ut_ad(!lock_mutex_own());
56855681
lock_mutex_enter();
56865682
lock_mutex_taken = true;
5687-
} else {
5688-
already_have_lock_mutex = true;
56895683
}
56905684

56915685
if (trx->abort_type != TRX_WSREP_ABORT) {
5692-
ut_ad(!trx_mutex_own(trx));
56935686
trx_mutex_enter(trx);
56945687
trx_mutex_taken = true;
5695-
} else {
5696-
already_have_trx_mutex = true;
56975688
}
56985689

5699-
err = lock_trx_handle_wait(trx,
5700-
(lock_mutex_taken || already_have_lock_mutex),
5701-
(trx_mutex_taken || already_have_trx_mutex));
5690+
#ifdef UNIV_DEBUG
5691+
dberr_t err =
5692+
#endif
5693+
lock_trx_handle_wait(trx, true, true);
5694+
5695+
ut_ad(err == DB_SUCCESS || err == DB_LOCK_WAIT
5696+
|| err == DB_DEADLOCK);
57025697

57035698
if (lock_mutex_taken) {
5704-
ut_ad(lock_mutex_own());
57055699
lock_mutex_exit();
57065700
}
57075701

57085702
if (trx_mutex_taken) {
5709-
ut_ad(trx_mutex_own(trx));
57105703
trx_mutex_exit(trx);
57115704
}
5712-
5713-
if (err != DB_SUCCESS && err != DB_LOCK_WAIT) {
5714-
ib::warn() << "Killing connection failed " << ut_strerr(err) << "("<<err<<")";
5715-
}
57165705
}
57175706

57185707
DBUG_VOID_RETURN;

0 commit comments

Comments
 (0)