Commit 7ca1e2ab authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-11422 rpl.rpl_parallel_optimistic_nobinlog failed in buildbot with...

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 fec844ac
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().
parent 6816c80c
...@@ -5665,9 +5665,6 @@ innobase_kill_query( ...@@ -5665,9 +5665,6 @@ innobase_kill_query(
/* Cancel a pending lock request if there are any */ /* Cancel a pending lock request if there are any */
bool lock_mutex_taken = false; bool lock_mutex_taken = false;
bool trx_mutex_taken = false; bool trx_mutex_taken = false;
bool already_have_lock_mutex = false;
bool already_have_trx_mutex = false;
dberr_t err = DB_SUCCESS;
if (trx->lock.wait_lock) { if (trx->lock.wait_lock) {
WSREP_DEBUG("Killing victim trx %p BF %d trx BF %d trx_id " IB_ID_FMT " ABORT %d thd %p" 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( ...@@ -5681,38 +5678,30 @@ innobase_kill_query(
} }
if (!wsrep_thd_is_BF(trx->mysql_thd, FALSE)) { if (!wsrep_thd_is_BF(trx->mysql_thd, FALSE)) {
ut_ad(!lock_mutex_own());
lock_mutex_enter(); lock_mutex_enter();
lock_mutex_taken = true; lock_mutex_taken = true;
} else {
already_have_lock_mutex = true;
} }
if (trx->abort_type != TRX_WSREP_ABORT) { if (trx->abort_type != TRX_WSREP_ABORT) {
ut_ad(!trx_mutex_own(trx));
trx_mutex_enter(trx); trx_mutex_enter(trx);
trx_mutex_taken = true; trx_mutex_taken = true;
} else {
already_have_trx_mutex = true;
} }
err = lock_trx_handle_wait(trx, #ifdef UNIV_DEBUG
(lock_mutex_taken || already_have_lock_mutex), dberr_t err =
(trx_mutex_taken || already_have_trx_mutex)); #endif
lock_trx_handle_wait(trx, true, true);
ut_ad(err == DB_SUCCESS || err == DB_LOCK_WAIT
|| err == DB_DEADLOCK);
if (lock_mutex_taken) { if (lock_mutex_taken) {
ut_ad(lock_mutex_own());
lock_mutex_exit(); lock_mutex_exit();
} }
if (trx_mutex_taken) { if (trx_mutex_taken) {
ut_ad(trx_mutex_own(trx));
trx_mutex_exit(trx); trx_mutex_exit(trx);
} }
if (err != DB_SUCCESS && err != DB_LOCK_WAIT) {
ib::warn() << "Killing connection failed " << ut_strerr(err) << "("<<err<<")";
}
} }
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment