Skip to content

Commit fe4047d

Browse files
author
Nirbhay Choubey
committed
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.
1 parent 080da55 commit fe4047d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

sql/sql_reload.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,16 @@ bool reload_acl_and_cache(THD *thd, unsigned long long options,
313313
}
314314
}
315315

316+
#ifdef WITH_WSREP
317+
if (thd->wsrep_applier)
318+
{
319+
/*
320+
In case of applier thread, do not wait for table share(s) to be
321+
removed from table definition cache.
322+
*/
323+
options|= REFRESH_FAST;
324+
}
325+
#endif
316326
if (close_cached_tables(thd, tables,
317327
((options & REFRESH_FAST) ? FALSE : TRUE),
318328
(thd ? thd->variables.lock_wait_timeout :

0 commit comments

Comments
 (0)