summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2019-12-03 14:45:06 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2019-12-03 14:45:06 +0100
commitf8b5e147da18d0baa7345aed0deec0fd40666d19 (patch)
treec0b0cbb9bc0f5afd6ca123604a67323bdc521099 /sql/slave.cc
parent543f22a2d0633e645fb49a360c55528d8cb008fb (diff)
parent117c8146de7ccfaf2331225d6fb264de71aa6779 (diff)
downloadmariadb-git-f8b5e147da18d0baa7345aed0deec0fd40666d19.tar.gz
Merge branch '10.1' into 10.2
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc33
1 files changed, 32 insertions, 1 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index 1bc21f8895b..17abf8d53f3 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -304,6 +304,9 @@ handle_slave_background(void *arg __attribute__((unused)))
thd->store_globals();
thd->security_ctx->skip_grants();
thd->set_command(COM_DAEMON);
+#ifdef WITH_WSREP
+ thd->variables.wsrep_on= 0;
+#endif
thd_proc_info(thd, "Loading slave GTID position from table");
if (rpl_load_gtid_slave_state(thd))
@@ -4309,7 +4312,9 @@ pthread_handler_t handle_slave_io(void *arg)
goto err;
}
-
+#ifdef WITH_WSREP
+ thd->variables.wsrep_on= 0;
+#endif
if (RUN_HOOK(binlog_relay_io, thread_start, (thd, mi)))
{
mi->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR, NULL,
@@ -7389,7 +7394,33 @@ err:
sql_print_error("Error reading relay log event: %s", errmsg);
DBUG_RETURN(0);
}
+#ifdef WITH_WSREP
+enum Log_event_type wsrep_peak_event(rpl_group_info *rgi, ulonglong* event_size)
+{
+ mysql_mutex_lock(&rgi->rli->data_lock);
+
+ unsigned long long event_pos= rgi->event_relay_log_pos;
+ unsigned long long future_pos= rgi->future_event_relay_log_pos;
+ /* scan the log to read next event */
+ my_b_seek(rgi->rli->cur_log, future_pos);
+ rgi->rli->event_relay_log_pos= future_pos;
+ rgi->event_relay_log_pos= future_pos;
+
+ Log_event* ev = next_event(rgi, event_size);
+ enum Log_event_type ev_type= (ev) ? ev->get_type_code() : UNKNOWN_EVENT;
+ delete ev;
+
+ /* scan the log back and re-set the positions to original values */
+ rgi->rli->event_relay_log_pos= event_pos;
+ rgi->event_relay_log_pos= event_pos;
+ my_b_seek(rgi->rli->cur_log, future_pos);
+
+ mysql_mutex_unlock(&rgi->rli->data_lock);
+
+ return ev_type;
+}
+#endif /* WITH_WSREP */
/*
Rotate a relay log (this is used only by FLUSH LOGS; the automatic rotation
because of size is simpler because when we do it we already have all relevant