Commit 5996c7ba authored by sjaakola's avatar sjaakola Committed by Nirbhay Choubey

refs: MW-279

- At startup time global wsrep_on is set too late and some wsrep paths may be executed
  because of this. e.g. replication slave restart could happen before wsrep_on state is defined.
- This fix checks both global wsrep_on and wsrep_provider values to determine if wsrep
  processing should happen
- Fix affects all instances where WSREP_ON macro is used
parent 0e83726e
...@@ -9205,7 +9205,7 @@ static int mysql_init_variables(void) ...@@ -9205,7 +9205,7 @@ static int mysql_init_variables(void)
strmake_buf(mysql_home, tmpenv); strmake_buf(mysql_home, tmpenv);
#endif #endif
#ifdef WITH_WSREP #ifdef WITH_WSREP
if (WSREP_ON && wsrep_init_vars()) if (wsrep_init_vars())
return 1; return 1;
#endif #endif
return 0; return 0;
......
...@@ -200,8 +200,10 @@ extern void wsrep_prepend_PATH (const char* path); ...@@ -200,8 +200,10 @@ extern void wsrep_prepend_PATH (const char* path);
/* Other global variables */ /* Other global variables */
extern wsrep_seqno_t wsrep_locked_seqno; extern wsrep_seqno_t wsrep_locked_seqno;
#define WSREP_ON \ #define WSREP_ON \
(global_system_variables.wsrep_on) ((global_system_variables.wsrep_on) && \
wsrep_provider && \
strcmp(wsrep_provider, WSREP_NONE))
#define WSREP(thd) \ #define WSREP(thd) \
(WSREP_ON && wsrep && (thd && thd->variables.wsrep_on)) (WSREP_ON && wsrep && (thd && thd->variables.wsrep_on))
......
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