summaryrefslogtreecommitdiff
path: root/sql/wsrep_hton.cc
diff options
context:
space:
mode:
authorJulius Goryavsky <julius.goryavsky@mariadb.com>2020-06-05 18:32:37 +0200
committerJulius Goryavsky <julius.goryavsky@mariadb.com>2020-06-05 18:32:37 +0200
commit5f55f69e4a237deb98cd4fc7d6ea9a17a8fe63bb (patch)
treed9031bb02e1807d0324b9f802dcf72eb8e3768a6 /sql/wsrep_hton.cc
parentefc70da5fd0459ff44153529d13651741cc32bc4 (diff)
parent3f019d1771d4e6e21f941b72a83e0663f15b376f (diff)
downloadmariadb-git-5f55f69e4a237deb98cd4fc7d6ea9a17a8fe63bb.tar.gz
Merge 10.1 into 10.2
Diffstat (limited to 'sql/wsrep_hton.cc')
-rw-r--r--sql/wsrep_hton.cc22
1 files changed, 17 insertions, 5 deletions
diff --git a/sql/wsrep_hton.cc b/sql/wsrep_hton.cc
index 459cd368355..575c57c5d24 100644
--- a/sql/wsrep_hton.cc
+++ b/sql/wsrep_hton.cc
@@ -37,6 +37,8 @@ extern "C" int thd_binlog_format(const MYSQL_THD thd);
void wsrep_cleanup_transaction(THD *thd)
{
if (!WSREP(thd)) return;
+ DBUG_ASSERT(thd->wsrep_conflict_state != MUST_REPLAY &&
+ thd->wsrep_conflict_state != REPLAYING);
if (wsrep_emulate_bin_log) thd_binlog_trx_reset(thd);
thd->wsrep_ws_handle.trx_id= WSREP_UNDEFINED_TRX_ID;
@@ -137,7 +139,11 @@ void wsrep_post_commit(THD* thd, bool all)
/* non-InnoDB statements may have populated events in stmt cache
=> cleanup
*/
- WSREP_DEBUG("cleanup transaction for LOCAL_STATE");
+ if (thd->wsrep_conflict_state != MUST_REPLAY)
+ {
+ WSREP_DEBUG("cleanup transaction for LOCAL_STATE: %s",
+ WSREP_QUERY(thd));
+ }
/*
Run post-rollback hook to clean up in the case if
some keys were populated for the transaction in provider
@@ -146,13 +152,18 @@ void wsrep_post_commit(THD* thd, bool all)
rolls back to savepoint after first operation.
*/
if (all && thd->wsrep_conflict_state != MUST_REPLAY &&
- wsrep && wsrep->post_rollback(wsrep, &thd->wsrep_ws_handle))
+ thd->wsrep_conflict_state != REPLAYING &&
+ wsrep->post_rollback(wsrep, &thd->wsrep_ws_handle))
{
WSREP_WARN("post_rollback fail: %llu %d",
(long long)thd->thread_id, thd->get_stmt_da()->status());
}
- wsrep_cleanup_transaction(thd);
- break;
+ if (thd->wsrep_conflict_state != MUST_REPLAY &&
+ thd->wsrep_conflict_state != REPLAYING)
+ {
+ wsrep_cleanup_transaction(thd);
+ }
+ break;
}
default: break;
}
@@ -566,7 +577,8 @@ wsrep_run_wsrep_commit(THD *thd, bool all)
DBUG_ASSERT(thd->wsrep_trx_meta.gtid.seqno != WSREP_SEQNO_UNDEFINED);
/* fall through */
case WSREP_TRX_FAIL:
- WSREP_DEBUG("commit failed for reason: %d", rcode);
+ WSREP_DEBUG("commit failed for reason: %d conf %d",
+ rcode, thd->wsrep_conflict_state);
DBUG_PRINT("wsrep", ("replicating commit fail"));
wsrep_thd_set_query_state(thd, QUERY_EXEC);