From 04944b4d109970aa52ff0af4009136cfceb4f006 Mon Sep 17 00:00:00 2001 From: Teemu Ollakka Date: Tue, 13 Oct 2020 17:51:51 +0300 Subject: [PATCH] Unlock before releasing aborted transaction in provider. Having aborted transaction holding a lock when releasing the transaction in provider may cause a deadlock if: - The transaction was BF aborted before it was known that the latest fragment was successfully replicated, - Transaction was going to be released on provider side, but it waited for commit order, - BF thread tried to grab lock for BF aborting, perhaps for second time. As a fix, unlock the lock protecting victim transaction for the duration of transaction release. --- src/transaction.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/transaction.cpp b/src/transaction.cpp index 37dc0d1..277a16b 100644 --- a/src/transaction.cpp +++ b/src/transaction.cpp @@ -841,7 +841,9 @@ int wsrep::transaction::after_statement() { ret = release_commit_order(lock); } + lock.unlock(); provider().release(ws_handle_); + lock.lock(); } if (state() != s_executing && state() != s_prepared)