mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
refs codership/mysql-wsrep#90 made wsrep_OSU_method session variable
This commit is contained in:
committed by
Nirbhay Choubey
parent
03a8f83e2c
commit
00afd63984
@ -6233,8 +6233,8 @@ int ha_wsrep_abort_transaction(THD *bf_thd, THD *victim_thd, my_bool signal)
|
|||||||
{
|
{
|
||||||
DBUG_ENTER("ha_wsrep_abort_transaction");
|
DBUG_ENTER("ha_wsrep_abort_transaction");
|
||||||
if (!WSREP(bf_thd) &&
|
if (!WSREP(bf_thd) &&
|
||||||
!(bf_thd->wsrep_OSU_method == WSREP_OSU_RSU &&
|
!(bf_thd->variables.wsrep_OSU_method == WSREP_OSU_RSU &&
|
||||||
bf_thd->wsrep_exec_mode == TOTAL_ORDER)) {
|
bf_thd->wsrep_exec_mode == TOTAL_ORDER)) {
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1203,7 +1203,6 @@ THD::THD()
|
|||||||
wsrep_consistency_check = NO_CONSISTENCY_CHECK;
|
wsrep_consistency_check = NO_CONSISTENCY_CHECK;
|
||||||
wsrep_status_vars = 0;
|
wsrep_status_vars = 0;
|
||||||
wsrep_mysql_replicated = 0;
|
wsrep_mysql_replicated = 0;
|
||||||
wsrep_OSU_method = WSREP_OSU_NONE;
|
|
||||||
wsrep_TOI_pre_query = NULL;
|
wsrep_TOI_pre_query = NULL;
|
||||||
wsrep_TOI_pre_query_len = 0;
|
wsrep_TOI_pre_query_len = 0;
|
||||||
#endif
|
#endif
|
||||||
@ -1610,7 +1609,6 @@ void THD::init(void)
|
|||||||
wsrep_PA_safe= true;
|
wsrep_PA_safe= true;
|
||||||
wsrep_consistency_check = NO_CONSISTENCY_CHECK;
|
wsrep_consistency_check = NO_CONSISTENCY_CHECK;
|
||||||
wsrep_mysql_replicated = 0;
|
wsrep_mysql_replicated = 0;
|
||||||
wsrep_OSU_method = WSREP_OSU_NONE;
|
|
||||||
wsrep_TOI_pre_query = NULL;
|
wsrep_TOI_pre_query = NULL;
|
||||||
wsrep_TOI_pre_query_len = 0;
|
wsrep_TOI_pre_query_len = 0;
|
||||||
|
|
||||||
|
@ -657,6 +657,7 @@ typedef struct system_variables
|
|||||||
my_bool wsrep_dirty_reads;
|
my_bool wsrep_dirty_reads;
|
||||||
uint wsrep_sync_wait;
|
uint wsrep_sync_wait;
|
||||||
ulong wsrep_retry_autocommit;
|
ulong wsrep_retry_autocommit;
|
||||||
|
ulong wsrep_OSU_method;
|
||||||
#endif
|
#endif
|
||||||
double long_query_time_double;
|
double long_query_time_double;
|
||||||
|
|
||||||
@ -2792,7 +2793,6 @@ public:
|
|||||||
wsrep_consistency_check;
|
wsrep_consistency_check;
|
||||||
wsrep_stats_var* wsrep_status_vars;
|
wsrep_stats_var* wsrep_status_vars;
|
||||||
int wsrep_mysql_replicated;
|
int wsrep_mysql_replicated;
|
||||||
ulong wsrep_OSU_method;
|
|
||||||
const char* wsrep_TOI_pre_query; /* a query to apply before
|
const char* wsrep_TOI_pre_query; /* a query to apply before
|
||||||
the actual TOI query */
|
the actual TOI query */
|
||||||
size_t wsrep_TOI_pre_query_len;
|
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 const char *wsrep_OSU_method_names[]= { "TOI", "RSU", NullS };
|
||||||
static Sys_var_enum Sys_wsrep_OSU_method(
|
static Sys_var_enum Sys_wsrep_OSU_method(
|
||||||
"wsrep_OSU_method", "Method for Online Schema Upgrade",
|
"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),
|
wsrep_OSU_method_names, DEFAULT(WSREP_OSU_TOI),
|
||||||
NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
|
NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
|
||||||
ON_UPDATE(0));
|
ON_UPDATE(0));
|
||||||
|
@ -1392,12 +1392,6 @@ int wsrep_to_isolation_begin(THD *thd, char *db_, char *table_,
|
|||||||
thd->query(), thd->thread_id);
|
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.
|
It makes sense to set auto_increment_* to defaults in TOI operations.
|
||||||
Must be done before wsrep_TOI_begin() since Query_log_event encapsulating
|
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)
|
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_,
|
case WSREP_OSU_TOI: ret = wsrep_TOI_begin(thd, db_, table_,
|
||||||
table_list); break;
|
table_list); break;
|
||||||
case WSREP_OSU_RSU: ret = wsrep_RSU_begin(thd, db_, table_); break;
|
case WSREP_OSU_RSU: ret = wsrep_RSU_begin(thd, db_, table_); break;
|
||||||
default:
|
default:
|
||||||
WSREP_ERROR("Unsupported OSU method: %lu", thd->wsrep_OSU_method);
|
WSREP_ERROR("Unsupported OSU method: %lu",
|
||||||
|
thd->variables.wsrep_OSU_method);
|
||||||
ret= -1;
|
ret= -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1440,18 +1435,17 @@ void wsrep_to_isolation_end(THD *thd)
|
|||||||
{
|
{
|
||||||
if (thd->wsrep_exec_mode == TOTAL_ORDER)
|
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_TOI: wsrep_TOI_end(thd); break;
|
||||||
case WSREP_OSU_RSU: wsrep_RSU_end(thd); break;
|
case WSREP_OSU_RSU: wsrep_RSU_end(thd); break;
|
||||||
default:
|
default:
|
||||||
WSREP_WARN("Unsupported wsrep OSU method at isolation end: %lu",
|
WSREP_WARN("Unsupported wsrep OSU method at isolation end: %lu",
|
||||||
thd->wsrep_OSU_method);
|
thd->variables.wsrep_OSU_method);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
wsrep_cleanup_transaction(thd);
|
wsrep_cleanup_transaction(thd);
|
||||||
}
|
}
|
||||||
thd->wsrep_OSU_method= WSREP_OSU_NONE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define WSREP_MDL_LOG(severity, msg, req, gra) \
|
#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_max_protocol_version;
|
||||||
extern long wsrep_protocol_version;
|
extern long wsrep_protocol_version;
|
||||||
extern ulong wsrep_forced_binlog_format;
|
extern ulong wsrep_forced_binlog_format;
|
||||||
extern ulong wsrep_OSU_method_options;
|
|
||||||
extern my_bool wsrep_desync;
|
extern my_bool wsrep_desync;
|
||||||
extern my_bool wsrep_recovery;
|
extern my_bool wsrep_recovery;
|
||||||
extern my_bool wsrep_replicate_myisam;
|
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");
|
DBUG_ENTER("wsrep_abort_thd");
|
||||||
|
|
||||||
if ( (WSREP(bf_thd) ||
|
if ( (WSREP(bf_thd) ||
|
||||||
( (WSREP_ON || bf_thd->wsrep_OSU_method == WSREP_OSU_RSU) &&
|
( (WSREP_ON || bf_thd->variables.wsrep_OSU_method == WSREP_OSU_RSU) &&
|
||||||
bf_thd->wsrep_exec_mode == TOTAL_ORDER) ) &&
|
bf_thd->wsrep_exec_mode == TOTAL_ORDER) ) &&
|
||||||
victim_thd)
|
victim_thd)
|
||||||
{
|
{
|
||||||
WSREP_DEBUG("wsrep_abort_thd, by: %llu, victim: %llu", (bf_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_address = 0;
|
||||||
const char* wsrep_node_incoming_address = 0;
|
const char* wsrep_node_incoming_address = 0;
|
||||||
const char* wsrep_start_position = 0;
|
const char* wsrep_start_position = 0;
|
||||||
ulong wsrep_OSU_method_options;
|
|
||||||
|
|
||||||
int wsrep_init_vars()
|
int wsrep_init_vars()
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user