[Commits] da3fe5c: MDEV-9224 : Database lockup on flush

Nirbhay Choubey nirbhay at mariadb.com
Tue Dec 22 05:40:38 EET 2015


revision-id: da3fe5cb3ed841c6c30f9c980255c5e93c35af6e (mariadb-galera-10.0.22-10-gda3fe5c)
parent(s): 080da551ea171f8a43633ab27b56875938643dd0
author: Nirbhay Choubey
committer: Nirbhay Choubey
timestamp: 2015-12-21 22:40:37 -0500
message:

MDEV-9224 : Database lockup on flush

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_base.cc | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 434830f..644610b 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -521,6 +521,18 @@ bool close_cached_tables(THD *thd, TABLE_LIST *tables,
   if (!tables)
   {
     bool found= true;
+
+#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.
+      */
+      found= false;
+    }
+#endif
+
     set_timespec(abstime, timeout);
     while (found && !thd->killed)
     {


More information about the commits mailing list