summaryrefslogtreecommitdiff
path: root/sql/wsrep_hton.cc
diff options
context:
space:
mode:
authorsjaakola <seppo.jaakola@iki.fi>2014-11-12 14:59:04 +0200
committerNirbhay Choubey <nirbhay@mariadb.com>2015-05-08 17:41:04 -0400
commit21bc3e3fdab516b86fbc1c33966d068471460ce2 (patch)
treeee01e7936bf97c6eeef61cab46a680ccd8cbcda0 /sql/wsrep_hton.cc
parent9fdae3eb60746a07ade11236e513d393969e7afd (diff)
downloadmariadb-git-21bc3e3fdab516b86fbc1c33966d068471460ce2.tar.gz
refs #2 - added binlog stmt cache reset after commit. This is needed for non-InnoDB statements
Diffstat (limited to 'sql/wsrep_hton.cc')
-rw-r--r--sql/wsrep_hton.cc23
1 files changed, 19 insertions, 4 deletions
diff --git a/sql/wsrep_hton.cc b/sql/wsrep_hton.cc
index 1e16c0907c8..284c9d26d62 100644
--- a/sql/wsrep_hton.cc
+++ b/sql/wsrep_hton.cc
@@ -98,17 +98,32 @@ void wsrep_register_hton(THD* thd, bool all)
*/
void wsrep_post_commit(THD* thd, bool all)
{
- if (thd->wsrep_exec_mode == LOCAL_COMMIT)
+ switch (thd->wsrep_exec_mode)
{
- DBUG_ASSERT(thd->wsrep_trx_meta.gtid.seqno != WSREP_SEQNO_UNDEFINED);
- if (wsrep->post_commit(wsrep, &thd->wsrep_ws_handle))
+ case LOCAL_COMMIT:
{
+ DBUG_ASSERT(thd->wsrep_trx_meta.gtid.seqno != WSREP_SEQNO_UNDEFINED);
+ if (wsrep->post_commit(wsrep, &thd->wsrep_ws_handle))
+ {
DBUG_PRINT("wsrep", ("set committed fail"));
WSREP_WARN("set committed fail: %llu %d",
(long long)thd->real_id, thd->get_stmt_da()->status());
+ }
+ wsrep_cleanup_transaction(thd);
+ break;
}
- wsrep_cleanup_transaction(thd);
+ 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;
}
+
}
/*