summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2020-03-11 13:27:10 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2020-03-11 13:27:10 +0100
commitb8c0e4967098fa40094229775e3560fa9052005e (patch)
treed2b4f2914776aaecbbc5d3d4aba0c826f8f3b49e /sql/slave.cc
parent5c6c4b13952b0b832b3480bbb1cc9c9889244d33 (diff)
parent440452628d95476674922c6c097825509a002d8d (diff)
downloadmariadb-git-b8c0e4967098fa40094229775e3560fa9052005e.tar.gz
Merge commit '10.3' into 10.4
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc31
1 files changed, 19 insertions, 12 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index 12132ee9d23..714e47424fe 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -3959,19 +3959,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