Commit 88f2ec6f authored by Nirbhay Choubey's avatar Nirbhay Choubey

MDEV-10041: Server crashes sporadically during bootstrap while running wsrep tests

The crash is caused due to a race condition where wsrep
startup threads invoke ha_maria::implicit_commit() method
while maria_hton is partially initialized. The fix is to
skip this method if plugins are uninitialized.
parent e1c6f28f
...@@ -2839,9 +2839,10 @@ int ha_maria::implicit_commit(THD *thd, bool new_trn) ...@@ -2839,9 +2839,10 @@ int ha_maria::implicit_commit(THD *thd, bool new_trn)
int error; int error;
uint locked_tables; uint locked_tables;
DYNAMIC_ARRAY used_tables; DYNAMIC_ARRAY used_tables;
extern my_bool plugins_are_initialized;
DBUG_ENTER("ha_maria::implicit_commit"); DBUG_ENTER("ha_maria::implicit_commit");
if (!maria_hton || !(trn= THD_TRN)) if (!maria_hton || !plugins_are_initialized || !(trn= THD_TRN))
DBUG_RETURN(0); DBUG_RETURN(0);
if (!new_trn && (thd->locked_tables_mode == LTM_LOCK_TABLES || if (!new_trn && (thd->locked_tables_mode == LTM_LOCK_TABLES ||
thd->locked_tables_mode == LTM_PRELOCKED_UNDER_LOCK_TABLES)) thd->locked_tables_mode == LTM_PRELOCKED_UNDER_LOCK_TABLES))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment