summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorDaniele Sciascia <daniele.sciascia@galeracluster.com>2015-10-15 15:13:29 +0200
committerNirbhay Choubey <nirbhay@mariadb.com>2016-02-22 16:32:45 -0500
commit1d2167685328200a5112aebd05c7232c625c1f09 (patch)
treee37c07e5eb89e8e59dd52e47aee9bff4bb586018 /storage
parent267d429b5a0628e73fdbd95d1934e093adcdb296 (diff)
downloadmariadb-git-1d2167685328200a5112aebd05c7232c625c1f09.tar.gz
refs codership/mysql-wsrep#184
Fixes a deadlock between applier and its victim transaction. The deadlock would manifest when a BF victim was waiting for some lock and was signaled to rollback, and the same time its wait timeout expired. In such cases the victim would return from lock_wait_suspend_thread() with error DB_LOCK_WAIT_TIMEOUT, as opposed to DB_DEADLOCK. As a result only the last statement of the victim would rollback, and eventually it would deadlock with the applier.
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/lock/lock0wait.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/storage/innobase/lock/lock0wait.cc b/storage/innobase/lock/lock0wait.cc
index 579b95a5ebd..29dfffcd496 100644
--- a/storage/innobase/lock/lock0wait.cc
+++ b/storage/innobase/lock/lock0wait.cc
@@ -394,7 +394,8 @@ lock_wait_suspend_thread(
if (lock_wait_timeout < 100000000
&& wait_time > (double) lock_wait_timeout) {
#ifdef WITH_WSREP
- if (!wsrep_is_BF_lock_timeout(trx)) {
+ if (!wsrep_is_BF_lock_timeout(trx)
+ && trx->error_state != DB_DEADLOCK) {
#endif /* WITH_WSREP */
trx->error_state = DB_LOCK_WAIT_TIMEOUT;