Commit 49b87749 authored by Jan Lindström's avatar Jan Lindström

MDEV-24546 : AddressSanitizer: initialization-order-fiasco on address ... in...

MDEV-24546 : AddressSanitizer: initialization-order-fiasco on address ... in Sys_var_integer from __static_initialization_and_destruction_0, possibly inside global var wsrep_gtid_server

Galera parameter wsrep_gtid_domain_id was defined using a class where
actual parameter was not a first member. Fixed this by using normal
variable and assigning this value to class member value.
parent fae87e0c
...@@ -6051,8 +6051,10 @@ static Sys_var_uint Sys_wsrep_gtid_domain_id( ...@@ -6051,8 +6051,10 @@ static Sys_var_uint Sys_wsrep_gtid_domain_id(
"wsrep_gtid_domain_id", "When wsrep_gtid_mode is set, this value is " "wsrep_gtid_domain_id", "When wsrep_gtid_mode is set, this value is "
"used as gtid_domain_id for galera transactions and also copied to the " "used as gtid_domain_id for galera transactions and also copied to the "
"joiner nodes during state transfer. It is ignored, otherwise.", "joiner nodes during state transfer. It is ignored, otherwise.",
GLOBAL_VAR(wsrep_gtid_server.domain_id), CMD_LINE(REQUIRED_ARG), GLOBAL_VAR(wsrep_gtid_domain_id), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(0, UINT_MAX32), DEFAULT(0), BLOCK_SIZE(1)); VALID_RANGE(0, UINT_MAX32), DEFAULT(0), BLOCK_SIZE(1),
NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
ON_UPDATE(wsrep_gtid_domain_id_update));
static Sys_var_ulonglong Sys_wsrep_gtid_seq_no( static Sys_var_ulonglong Sys_wsrep_gtid_seq_no(
"wsrep_gtid_seq_no", "wsrep_gtid_seq_no",
......
...@@ -110,6 +110,7 @@ ulong wsrep_mysql_replication_bundle; ...@@ -110,6 +110,7 @@ ulong wsrep_mysql_replication_bundle;
bool wsrep_gtid_mode; // Enable WSREP native GTID support bool wsrep_gtid_mode; // Enable WSREP native GTID support
Wsrep_gtid_server wsrep_gtid_server; Wsrep_gtid_server wsrep_gtid_server;
uint wsrep_gtid_domain_id=0; // Domain id on above structure
/* Other configuration variables and their default values. */ /* Other configuration variables and their default values. */
my_bool wsrep_incremental_data_collection= 0; // Incremental data collection my_bool wsrep_incremental_data_collection= 0; // Incremental data collection
......
...@@ -101,6 +101,7 @@ extern ulong wsrep_running_rollbacker_threads; ...@@ -101,6 +101,7 @@ extern ulong wsrep_running_rollbacker_threads;
extern bool wsrep_new_cluster; extern bool wsrep_new_cluster;
extern bool wsrep_gtid_mode; extern bool wsrep_gtid_mode;
extern my_bool wsrep_strict_ddl; extern my_bool wsrep_strict_ddl;
extern uint wsrep_gtid_domain_id;
enum enum_wsrep_reject_types { enum enum_wsrep_reject_types {
WSREP_REJECT_NONE, /* nothing rejected */ WSREP_REJECT_NONE, /* nothing rejected */
......
...@@ -961,3 +961,11 @@ void wsrep_free_status (THD* thd) ...@@ -961,3 +961,11 @@ void wsrep_free_status (THD* thd)
{ {
thd->wsrep_status_vars.clear(); thd->wsrep_status_vars.clear();
} }
bool wsrep_gtid_domain_id_update(sys_var* self, THD *thd, enum_var_type)
{
WSREP_DEBUG("wsrep_gtid_domain_id_update: %llu",
wsrep_gtid_domain_id);
wsrep_gtid_server.domain_id= wsrep_gtid_domain_id;
return false;
}
...@@ -105,6 +105,7 @@ extern bool wsrep_debug_update UPDATE_ARGS; ...@@ -105,6 +105,7 @@ extern bool wsrep_debug_update UPDATE_ARGS;
extern bool wsrep_gtid_seq_no_check CHECK_ARGS; extern bool wsrep_gtid_seq_no_check CHECK_ARGS;
extern bool wsrep_gtid_domain_id_update UPDATE_ARGS;
#else /* WITH_WSREP */ #else /* WITH_WSREP */
#define wsrep_provider_init(X) #define wsrep_provider_init(X)
......
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