diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2020-03-11 17:52:49 +0100 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2020-03-11 17:52:49 +0100 |
commit | fad47df9957d754bec12d4d327c77ae04f71d903 (patch) | |
tree | 58aaf6077adcb0bc0003228d30bed59687527650 /sql/slave.cc | |
parent | 9d7ed94f6a526748eff29dae2939a3fd341f118b (diff) | |
parent | b7362d5fbc37dec340aeacd1fb0967c4226c022a (diff) | |
download | mariadb-git-fad47df9957d754bec12d4d327c77ae04f71d903.tar.gz |
Merge branch '10.4' into 10.5
Diffstat (limited to 'sql/slave.cc')
-rw-r--r-- | sql/slave.cc | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/sql/slave.cc b/sql/slave.cc index aba10b8bd6e..436d5e0b5c5 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -3997,19 +3997,26 @@ apply_event_and_update_pos_apply(Log_event* ev, THD* thd, rpl_group_info *rgi, exec_res= ev->apply_event(rgi); #ifdef WITH_WSREP - if (WSREP_ON) - { - mysql_mutex_lock(&thd->LOCK_thd_data); - if (exec_res && - thd->wsrep_trx().state() != wsrep::transaction::s_executing) - { - WSREP_DEBUG("SQL apply failed, res %d conflict state: %s", - exec_res, wsrep_thd_transaction_state_str(thd)); - rli->abort_slave= 1; - rli->report(ERROR_LEVEL, ER_UNKNOWN_COM_ERROR, rgi->gtid_info(), - "Node has dropped from cluster"); + if (WSREP_ON) { + if (exec_res) { + mysql_mutex_lock(&thd->LOCK_thd_data); + switch(thd->wsrep_trx().state()) { + case wsrep::transaction::s_must_replay: + /* this transaction will be replayed, + so not raising slave error here */ + WSREP_DEBUG("SQL apply failed for MUST_REPLAY, res %d", exec_res); + exec_res = 0; + break; + default: + WSREP_DEBUG("SQL apply failed, res %d conflict state: %s", + exec_res, wsrep_thd_transaction_state_str(thd)); + rli->abort_slave= 1; + rli->report(ERROR_LEVEL, ER_UNKNOWN_COM_ERROR, rgi->gtid_info(), + "Node has dropped from cluster"); + break; + } + mysql_mutex_unlock(&thd->LOCK_thd_data); } - mysql_mutex_unlock(&thd->LOCK_thd_data); } #endif |