Commit ce141d07 authored by Jan Lindström's avatar Jan Lindström

MDEV-24463 : galera.galera_sst_mysqldump_with_key MTR failed: 'INSERT failed:...

MDEV-24463 : galera.galera_sst_mysqldump_with_key MTR failed: 'INSERT failed: 1213: Deadlock found when trying to get lock

We need to complete SST if both new and old start positions are
not same as initial positions. If they are initial positions
just set local uuid and seqno.
parent be5fce16
...@@ -23,7 +23,6 @@ galera_binlog_stmt_autoinc : MDEV-19959 Galera test failure on galera_binlog_stm ...@@ -23,7 +23,6 @@ galera_binlog_stmt_autoinc : MDEV-19959 Galera test failure on galera_binlog_stm
galera_encrypt_tmp_files : Get error failed to enable encryption of temporary files galera_encrypt_tmp_files : Get error failed to enable encryption of temporary files
galera_ftwrl : MDEV-21525 galera.galera_ftwrl galera_ftwrl : MDEV-21525 galera.galera_ftwrl
galera_gcache_recover_manytrx : MDEV-18834 Galera test failure galera_gcache_recover_manytrx : MDEV-18834 Galera test failure
galera_ist_mysqldump : MDEV-24463 galera.galera_sst_mysqldump_with_key MTR failed: 'INSERT failed: 1213: Deadlock found when trying to get lock
galera_kill_largechanges : MDEV-18179 Galera test failure on galera.galera_kill_largechanges galera_kill_largechanges : MDEV-18179 Galera test failure on galera.galera_kill_largechanges
galera_kill_nochanges : MDEV-18280 Galera test failure on galera_split_brain and galera_kill_nochanges galera_kill_nochanges : MDEV-18280 Galera test failure on galera_split_brain and galera_kill_nochanges
galera_many_tables_nopk : MDEV-18182 Galera test failure on galera.galera_many_tables_nopk galera_many_tables_nopk : MDEV-18182 Galera test failure on galera.galera_many_tables_nopk
...@@ -34,8 +33,6 @@ galera_shutdown_nonprim : MDEV-21493 galera.galera_shutdown_nonprim ...@@ -34,8 +33,6 @@ galera_shutdown_nonprim : MDEV-21493 galera.galera_shutdown_nonprim
galera_split_brain : MDEV-18280 Galera test failure on galera_split_brain and galera_kill_nochanges galera_split_brain : MDEV-18280 Galera test failure on galera_split_brain and galera_kill_nochanges
galera_ssl_upgrade : MDEV-19950 Galera test failure on galera_ssl_upgrade galera_ssl_upgrade : MDEV-19950 Galera test failure on galera_ssl_upgrade
galera_sst_mariabackup_encrypt_with_key : MDEV-21484 galera_sst_mariabackup_encrypt_with_key galera_sst_mariabackup_encrypt_with_key : MDEV-21484 galera_sst_mariabackup_encrypt_with_key
galera_sst_mysqldump : MDEV-24463 galera.galera_sst_mysqldump_with_key MTR failed: 'INSERT failed: 1213: Deadlock found when trying to get lock
galera_sst_mysqldump_with_key : MDEV-24463 galera.galera_sst_mysqldump_with_key MTR failed: 'INSERT failed: 1213: Deadlock found when trying to get lock
galera_toi_ddl_nonconflicting : MDEV-21518 galera.galera_toi_ddl_nonconflicting galera_toi_ddl_nonconflicting : MDEV-21518 galera.galera_toi_ddl_nonconflicting
galera_toi_truncate : MDEV-22996 Hang on galera_toi_truncate test case galera_toi_truncate : MDEV-22996 Hang on galera_toi_truncate test case
galera_var_node_address : MDEV-20485 Galera test failure galera_var_node_address : MDEV-20485 Galera test failure
......
...@@ -316,6 +316,9 @@ static bool wsrep_sst_complete (THD* thd, ...@@ -316,6 +316,9 @@ static bool wsrep_sst_complete (THD* thd,
Wsrep_server_state& server_state= Wsrep_server_state::instance(); Wsrep_server_state& server_state= Wsrep_server_state::instance();
enum wsrep::server_state::state state= server_state.state(); enum wsrep::server_state::state state= server_state.state();
bool failed= false; bool failed= false;
char start_pos_buf[FN_REFLEN];
ssize_t len= wsrep::print_to_c_str(sst_gtid, start_pos_buf, FN_REFLEN-1);
start_pos_buf[len]='\0';
// Do not call sst_received if we are not in joiner or // Do not call sst_received if we are not in joiner or
// initialized state on server. This is because it // initialized state on server. This is because it
...@@ -323,13 +326,13 @@ static bool wsrep_sst_complete (THD* thd, ...@@ -323,13 +326,13 @@ static bool wsrep_sst_complete (THD* thd,
// in incorrect state. // in incorrect state.
if ((state == Wsrep_server_state::s_joiner || if ((state == Wsrep_server_state::s_joiner ||
state == Wsrep_server_state::s_initialized)) state == Wsrep_server_state::s_initialized))
{
Wsrep_server_state::instance().sst_received(client_service, Wsrep_server_state::instance().sst_received(client_service,
rcode); rcode);
WSREP_INFO("SST succeeded for position %s", start_pos_buf);
}
else else
{ {
char start_pos_buf[FN_REFLEN];
ssize_t len= wsrep::print_to_c_str(sst_gtid, start_pos_buf, FN_REFLEN-1);
start_pos_buf[len]='\0';
WSREP_ERROR("SST failed for position %s initialized %d server_state %s", WSREP_ERROR("SST failed for position %s initialized %d server_state %s",
start_pos_buf, start_pos_buf,
server_state.is_initialized(), server_state.is_initialized(),
......
...@@ -233,12 +233,24 @@ bool wsrep_set_local_position(THD* thd, const char* const value, ...@@ -233,12 +233,24 @@ bool wsrep_set_local_position(THD* thd, const char* const value,
size_t const uuid_len= wsrep_uuid_scan(value, length, &uuid); size_t const uuid_len= wsrep_uuid_scan(value, length, &uuid);
wsrep_seqno_t const seqno= strtoll(value + uuid_len + 1, NULL, 10); wsrep_seqno_t const seqno= strtoll(value + uuid_len + 1, NULL, 10);
if (sst) { char start_pos_buf[FN_REFLEN];
memcpy(start_pos_buf, value, length);
start_pos_buf[length]='\0';
// If both are same as WSREP_START_POSITION_ZERO just set local
if (!strcmp(start_pos_buf, WSREP_START_POSITION_ZERO) &&
!strcmp(wsrep_start_position, WSREP_START_POSITION_ZERO))
goto set;
else
WSREP_INFO("SST setting local position to %s current %s", start_pos_buf, wsrep_start_position);
if (sst)
return (wsrep_sst_received (thd, uuid, seqno, NULL, 0)); return (wsrep_sst_received (thd, uuid, seqno, NULL, 0));
} else {
set:
local_uuid= uuid; local_uuid= uuid;
local_seqno= seqno; local_seqno= seqno;
}
return false; return false;
} }
...@@ -255,9 +267,14 @@ bool wsrep_start_position_check (sys_var *self, THD* thd, set_var* var) ...@@ -255,9 +267,14 @@ bool wsrep_start_position_check (sys_var *self, THD* thd, set_var* var)
var->save_result.string_value.length); var->save_result.string_value.length);
start_pos_buf[var->save_result.string_value.length]= 0; start_pos_buf[var->save_result.string_value.length]= 0;
WSREP_DEBUG("SST wsrep_start_position check for new position %s old %s",
start_pos_buf, wsrep_start_position);
// Verify the format. // Verify the format.
if (wsrep_start_position_verify(start_pos_buf)) return true; if (wsrep_start_position_verify(start_pos_buf)) return true;
// Give error if position is updated when wsrep is not enabled or // Give error if position is updated when wsrep is not enabled or
// provider is not loaded. // provider is not loaded.
if ((!WSREP_ON || !Wsrep_server_state::instance().is_provider_loaded()) if ((!WSREP_ON || !Wsrep_server_state::instance().is_provider_loaded())
...@@ -274,13 +291,10 @@ bool wsrep_start_position_check (sys_var *self, THD* thd, set_var* var) ...@@ -274,13 +291,10 @@ bool wsrep_start_position_check (sys_var *self, THD* thd, set_var* var)
As part of further verification, we try to update the value and catch As part of further verification, we try to update the value and catch
errors (if any) only when value actually has been changed. errors (if any) only when value actually has been changed.
*/ */
if (strcmp(start_pos_buf, wsrep_start_position))
{
if (wsrep_set_local_position(thd, var->save_result.string_value.str, if (wsrep_set_local_position(thd, var->save_result.string_value.str,
var->save_result.string_value.length, var->save_result.string_value.length,
true)) true))
goto err; goto err;
}
return false; return false;
......
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