Commit b0d30e23 authored by Seppo Jaakola's avatar Seppo Jaakola

References lp:1169326 - merged fix from LP wsrep-5.5-23

Now at revision 3874 in  lp:~codership/codership-mysql/5.5-23
parent bf9d5b7f
......@@ -4042,6 +4042,21 @@ Query_log_event::do_shall_skip(Relay_log_info *rli)
DBUG_RETURN(Log_event::EVENT_SKIP_COUNT);
}
}
#ifdef WITH_WSREP
else if (wsrep_mysql_replication_bundle && WSREP_ON && thd->wsrep_mysql_replicated > 0 &&
(!strncasecmp(query , "BEGIN", 5) || !strncasecmp(query , "COMMIT", 6)))
{
if (++thd->wsrep_mysql_replicated < (int)wsrep_mysql_replication_bundle)
{
WSREP_DEBUG("skipping wsrep commit %d", thd->wsrep_mysql_replicated);
DBUG_RETURN(Log_event::EVENT_SKIP_IGNORE);
}
else
{
thd->wsrep_mysql_replicated = 0;
}
}
#endif
DBUG_RETURN(Log_event::do_shall_skip(rli));
}
......@@ -6200,6 +6215,20 @@ Xid_log_event::do_shall_skip(Relay_log_info *rli)
thd->variables.option_bits&= ~OPTION_BEGIN;
DBUG_RETURN(Log_event::EVENT_SKIP_COUNT);
}
#ifdef WITH_WSREP
else if (wsrep_mysql_replication_bundle && WSREP_ON)
{
if (++thd->wsrep_mysql_replicated < (int)wsrep_mysql_replication_bundle)
{
WSREP_DEBUG("skipping wsrep commit %d", thd->wsrep_mysql_replicated);
DBUG_RETURN(Log_event::EVENT_SKIP_IGNORE);
}
else
{
thd->wsrep_mysql_replicated = 0;
}
}
#endif
DBUG_RETURN(Log_event::do_shall_skip(rli));
}
#endif /* !MYSQL_CLIENT */
......
......@@ -2602,23 +2602,6 @@ int apply_event_and_update_pos(Log_event* ev, THD* thd, Relay_log_info* rli)
ev->thd = thd; // because up to this point, ev->thd == 0
int reason= ev->shall_skip(rli);
#ifdef WITH_WSREP
if (WSREP_ON && (ev->get_type_code() == XID_EVENT ||
(ev->get_type_code() == QUERY_EVENT && thd->wsrep_mysql_replicated > 0 &&
(!strncasecmp(((Query_log_event*)ev)->query , "BEGIN", 5) ||
!strncasecmp(((Query_log_event*)ev)->query , "COMMIT", 6) ))))
{
if (++thd->wsrep_mysql_replicated < (int)wsrep_mysql_replication_bundle)
{
WSREP_DEBUG("skipping wsrep commit %d", thd->wsrep_mysql_replicated);
reason = Log_event::EVENT_SKIP_IGNORE;
}
else
{
thd->wsrep_mysql_replicated = 0;
}
}
#endif
if (reason == Log_event::EVENT_SKIP_COUNT)
sql_slave_skip_counter= --rli->slave_skip_counter;
mysql_mutex_unlock(&rli->data_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment