[Commits] fe4047d: MDEV-9224 : Database lockup on flush in galera

Nirbhay Choubey nirbhay at mariadb.com
Tue Dec 22 22:02:18 EET 2015


revision-id: fe4047dc39090f626408d91999dd4a8f0869ab13 (mariadb-galera-10.0.22-10-gfe4047d)
parent(s): 080da551ea171f8a43633ab27b56875938643dd0
author: Nirbhay Choubey
committer: Nirbhay Choubey
timestamp: 2015-12-22 15:02:18 -0500
message:

MDEV-9224 : Database lockup on flush in galera

A deadlock can occur when the wsrep applier thread while
executing FLUSH TABLES waits for MDL lock owned by other
local transactions, which in turn are waiting for commit
order if their seqno comes after one assigned to FLUSH
TABLES.
Fixed by making sure that the wsrep applier thread while
executing FLUSH TABLES does not wait for table share(s)
to be removed from table definition cache.

---
 sql/sql_reload.cc | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/sql/sql_reload.cc b/sql/sql_reload.cc
index 63809fa..ef69996 100644
--- a/sql/sql_reload.cc
+++ b/sql/sql_reload.cc
@@ -313,6 +313,16 @@ bool reload_acl_and_cache(THD *thd, unsigned long long options,
         }
       }
 
+#ifdef WITH_WSREP
+      if (thd->wsrep_applier)
+      {
+        /*
+          In case of applier thread, do not wait for table share(s) to be
+          removed from table definition cache.
+        */
+        options|= REFRESH_FAST;
+      }
+#endif
       if (close_cached_tables(thd, tables,
                               ((options & REFRESH_FAST) ?  FALSE : TRUE),
                               (thd ? thd->variables.lock_wait_timeout :


More information about the commits mailing list