summaryrefslogtreecommitdiff
path: root/sql/wsrep_hton.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-06-21 23:47:39 +0200
committerSergei Golubchik <serg@mariadb.org>2018-06-21 23:47:39 +0200
commitb942aa34c10ddfa3fe4977ae60afed5cbdc51083 (patch)
tree0a1a934ca7b728e3ffb81cd2f7c6a858524726d4 /sql/wsrep_hton.cc
parentfe3f9fa9183ea3d10397b6f7f4d422ae9bba00a4 (diff)
parentc09a8b5b36edb494e2bcc93074c06e26cd9f2b92 (diff)
downloadmariadb-git-b942aa34c10ddfa3fe4977ae60afed5cbdc51083.tar.gz
Merge branch '10.1' into 10.2
Diffstat (limited to 'sql/wsrep_hton.cc')
-rw-r--r--sql/wsrep_hton.cc36
1 files changed, 24 insertions, 12 deletions
diff --git a/sql/wsrep_hton.cc b/sql/wsrep_hton.cc
index 4672f286982..1ef4465f173 100644
--- a/sql/wsrep_hton.cc
+++ b/sql/wsrep_hton.cc
@@ -117,7 +117,7 @@ void wsrep_post_commit(THD* thd, bool all)
switch (thd->wsrep_exec_mode)
{
- case LOCAL_COMMIT:
+ case LOCAL_COMMIT:
{
DBUG_ASSERT(thd->wsrep_trx_meta.gtid.seqno != WSREP_SEQNO_UNDEFINED);
if (wsrep && wsrep->post_commit(wsrep, &thd->wsrep_ws_handle))
@@ -129,18 +129,30 @@ void wsrep_post_commit(THD* thd, bool all)
wsrep_cleanup_transaction(thd);
break;
}
- case LOCAL_STATE:
- {
- /*
- Non-InnoDB statements may have populated events in stmt cache => cleanup
- */
- WSREP_DEBUG("cleanup transaction for LOCAL_STATE: %s", thd->query());
- wsrep_cleanup_transaction(thd);
- break;
- }
- default: break;
+ case LOCAL_STATE:
+ {
+ /* non-InnoDB statements may have populated events in stmt cache
+ => cleanup
+ */
+ WSREP_DEBUG("cleanup transaction for LOCAL_STATE");
+ /*
+ Run post-rollback hook to clean up in the case if
+ some keys were populated for the transaction in provider
+ but during commit time there was no write set to replicate.
+ This may happen when client sets the SAVEPOINT and immediately
+ rolls back to savepoint after first operation.
+ */
+ if (all && thd->wsrep_conflict_state != MUST_REPLAY &&
+ wsrep && 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;
+ }
+ default: break;
}
-
}
/*