Commit 00afd639 authored by Teemu Ollakka's avatar Teemu Ollakka Committed by Nirbhay Choubey

refs codership/mysql-wsrep#90 made wsrep_OSU_method session variable

parent 03a8f83e
......@@ -6233,8 +6233,8 @@ int ha_wsrep_abort_transaction(THD *bf_thd, THD *victim_thd, my_bool signal)
{
DBUG_ENTER("ha_wsrep_abort_transaction");
if (!WSREP(bf_thd) &&
!(bf_thd->wsrep_OSU_method == WSREP_OSU_RSU &&
bf_thd->wsrep_exec_mode == TOTAL_ORDER)) {
!(bf_thd->variables.wsrep_OSU_method == WSREP_OSU_RSU &&
bf_thd->wsrep_exec_mode == TOTAL_ORDER)) {
DBUG_RETURN(0);
}
......
......@@ -1203,7 +1203,6 @@ THD::THD()
wsrep_consistency_check = NO_CONSISTENCY_CHECK;
wsrep_status_vars = 0;
wsrep_mysql_replicated = 0;
wsrep_OSU_method = WSREP_OSU_NONE;
wsrep_TOI_pre_query = NULL;
wsrep_TOI_pre_query_len = 0;
#endif
......@@ -1610,7 +1609,6 @@ void THD::init(void)
wsrep_PA_safe= true;
wsrep_consistency_check = NO_CONSISTENCY_CHECK;
wsrep_mysql_replicated = 0;
wsrep_OSU_method = WSREP_OSU_NONE;
wsrep_TOI_pre_query = NULL;
wsrep_TOI_pre_query_len = 0;
......
......@@ -657,6 +657,7 @@ typedef struct system_variables
my_bool wsrep_dirty_reads;
uint wsrep_sync_wait;
ulong wsrep_retry_autocommit;
ulong wsrep_OSU_method;
#endif
double long_query_time_double;
......@@ -2792,7 +2793,6 @@ class THD :public Statement,
wsrep_consistency_check;
wsrep_stats_var* wsrep_status_vars;
int wsrep_mysql_replicated;
ulong wsrep_OSU_method;
const char* wsrep_TOI_pre_query; /* a query to apply before
the actual TOI query */
size_t wsrep_TOI_pre_query_len;
......
......@@ -4682,7 +4682,7 @@ static Sys_var_uint Sys_wsrep_sync_wait(
static const char *wsrep_OSU_method_names[]= { "TOI", "RSU", NullS };
static Sys_var_enum Sys_wsrep_OSU_method(
"wsrep_OSU_method", "Method for Online Schema Upgrade",
GLOBAL_VAR(wsrep_OSU_method_options), CMD_LINE(OPT_ARG),
SESSION_VAR(wsrep_OSU_method), CMD_LINE(OPT_ARG),
wsrep_OSU_method_names, DEFAULT(WSREP_OSU_TOI),
NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
ON_UPDATE(0));
......
......@@ -1392,12 +1392,6 @@ int wsrep_to_isolation_begin(THD *thd, char *db_, char *table_,
thd->query(), thd->thread_id);
}
/*
Save current global value into thd to persist the used method
even if global wsrep_OSU_method_options changes during isolation
*/
thd->wsrep_OSU_method= wsrep_OSU_method_options;
/*
It makes sense to set auto_increment_* to defaults in TOI operations.
Must be done before wsrep_TOI_begin() since Query_log_event encapsulating
......@@ -1413,12 +1407,13 @@ int wsrep_to_isolation_begin(THD *thd, char *db_, char *table_,
if (thd->variables.wsrep_on && thd->wsrep_exec_mode==LOCAL_STATE)
{
switch (thd->wsrep_OSU_method) {
switch (thd->variables.wsrep_OSU_method) {
case WSREP_OSU_TOI: ret = wsrep_TOI_begin(thd, db_, table_,
table_list); break;
case WSREP_OSU_RSU: ret = wsrep_RSU_begin(thd, db_, table_); break;
default:
WSREP_ERROR("Unsupported OSU method: %lu", thd->wsrep_OSU_method);
WSREP_ERROR("Unsupported OSU method: %lu",
thd->variables.wsrep_OSU_method);
ret= -1;
break;
}
......@@ -1440,18 +1435,17 @@ void wsrep_to_isolation_end(THD *thd)
{
if (thd->wsrep_exec_mode == TOTAL_ORDER)
{
switch(thd->wsrep_OSU_method)
switch(thd->variables.wsrep_OSU_method)
{
case WSREP_OSU_TOI: wsrep_TOI_end(thd); break;
case WSREP_OSU_RSU: wsrep_RSU_end(thd); break;
default:
WSREP_WARN("Unsupported wsrep OSU method at isolation end: %lu",
thd->wsrep_OSU_method);
thd->variables.wsrep_OSU_method);
break;
}
wsrep_cleanup_transaction(thd);
}
thd->wsrep_OSU_method= WSREP_OSU_NONE;
}
#define WSREP_MDL_LOG(severity, msg, req, gra) \
......
......@@ -96,7 +96,6 @@ extern my_bool wsrep_certify_nonPK;
extern long wsrep_max_protocol_version;
extern long wsrep_protocol_version;
extern ulong wsrep_forced_binlog_format;
extern ulong wsrep_OSU_method_options;
extern my_bool wsrep_desync;
extern my_bool wsrep_recovery;
extern my_bool wsrep_replicate_myisam;
......
......@@ -575,8 +575,8 @@ int wsrep_abort_thd(void *bf_thd_ptr, void *victim_thd_ptr, my_bool signal)
DBUG_ENTER("wsrep_abort_thd");
if ( (WSREP(bf_thd) ||
( (WSREP_ON || bf_thd->wsrep_OSU_method == WSREP_OSU_RSU) &&
bf_thd->wsrep_exec_mode == TOTAL_ORDER) ) &&
( (WSREP_ON || bf_thd->variables.wsrep_OSU_method == WSREP_OSU_RSU) &&
bf_thd->wsrep_exec_mode == TOTAL_ORDER) ) &&
victim_thd)
{
WSREP_DEBUG("wsrep_abort_thd, by: %llu, victim: %llu", (bf_thd) ?
......
......@@ -35,7 +35,6 @@ const char* wsrep_node_name = 0;
const char* wsrep_node_address = 0;
const char* wsrep_node_incoming_address = 0;
const char* wsrep_start_position = 0;
ulong wsrep_OSU_method_options;
int wsrep_init_vars()
{
......
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