summaryrefslogtreecommitdiff
path: root/sql/wsrep_applier.cc
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2016-02-24 01:21:40 -0500
committerNirbhay Choubey <nirbhay@mariadb.com>2016-02-24 01:21:40 -0500
commitcceec7858f260be23b50265fb026ea68c6aefc20 (patch)
tree52251df59c4a69527435c8d682505537fb6e9692 /sql/wsrep_applier.cc
parent88576b3a805f97be44d98143b6cdfc9b820fcc84 (diff)
parentf67d6fccacfb8a2963f23448cabb67c6178d2a10 (diff)
downloadmariadb-git-cceec7858f260be23b50265fb026ea68c6aefc20.tar.gz
Merge branch '10.0-galera' into bb-10.1-serg
Diffstat (limited to 'sql/wsrep_applier.cc')
-rw-r--r--sql/wsrep_applier.cc27
1 files changed, 20 insertions, 7 deletions
diff --git a/sql/wsrep_applier.cc b/sql/wsrep_applier.cc
index c1c6a90e614..477be1b55d1 100644
--- a/sql/wsrep_applier.cc
+++ b/sql/wsrep_applier.cc
@@ -19,6 +19,7 @@
#include "log_event.h" // class THD, EVENT_LEN_OFFSET, etc.
#include "wsrep_applier.h"
+#include "debug_sync.h"
/*
read the first event from (*buf). The size of the (*buf) is (*buf_len).
@@ -220,6 +221,16 @@ wsrep_cb_status_t wsrep_apply_cb(void* const ctx,
{
THD* const thd((THD*)ctx);
+ // Allow tests to block the applier thread using the DBUG facilities.
+ DBUG_EXECUTE_IF("sync.wsrep_apply_cb",
+ {
+ const char act[]=
+ "now "
+ "wait_for signal.wsrep_apply_cb";
+ DBUG_ASSERT(!debug_sync_set_action(thd,
+ STRING_WITH_LEN(act)));
+ };);
+
thd->wsrep_trx_meta = *meta;
#ifdef WSREP_PROC_INFO
@@ -279,8 +290,7 @@ wsrep_cb_status_t wsrep_apply_cb(void* const ctx,
return rcode;
}
-static wsrep_cb_status_t wsrep_commit(THD* const thd,
- wsrep_seqno_t const global_seqno)
+static wsrep_cb_status_t wsrep_commit(THD* const thd)
{
#ifdef WSREP_PROC_INFO
snprintf(thd->wsrep_info, sizeof(thd->wsrep_info) - 1,
@@ -299,7 +309,11 @@ static wsrep_cb_status_t wsrep_commit(THD* const thd,
#ifdef GTID_SUPPORT
thd->variables.gtid_next.set_automatic();
#endif /* GTID_SUPPORT */
- // TODO: mark snapshot with global_seqno.
+ if (thd->wsrep_apply_toi)
+ {
+ wsrep_set_SE_checkpoint(thd->wsrep_trx_meta.gtid.uuid,
+ thd->wsrep_trx_meta.gtid.seqno);
+ }
}
#ifdef WSREP_PROC_INFO
@@ -313,8 +327,7 @@ static wsrep_cb_status_t wsrep_commit(THD* const thd,
return rcode;
}
-static wsrep_cb_status_t wsrep_rollback(THD* const thd,
- wsrep_seqno_t const global_seqno)
+static wsrep_cb_status_t wsrep_rollback(THD* const thd)
{
#ifdef WSREP_PROC_INFO
snprintf(thd->wsrep_info, sizeof(thd->wsrep_info) - 1,
@@ -351,9 +364,9 @@ wsrep_cb_status_t wsrep_commit_cb(void* const ctx,
wsrep_cb_status_t rcode;
if (commit)
- rcode = wsrep_commit(thd, meta->gtid.seqno);
+ rcode = wsrep_commit(thd);
else
- rcode = wsrep_rollback(thd, meta->gtid.seqno);
+ rcode = wsrep_rollback(thd);
wsrep_set_apply_format(thd, NULL);
thd->mdl_context.release_transactional_locks();