Skip to content

Instantly share code, notes, and snippets.

@ronin13

ronin13/fix.diff Secret

Created April 17, 2013 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ronin13/3e944f259e7be2bb4d32 to your computer and use it in GitHub Desktop.
Save ronin13/3e944f259e7be2bb4d32 to your computer and use it in GitHub Desktop.
=== modified file 'Percona-Server/sql/log_event.cc'
--- Percona-Server/sql/log_event.cc 2013-04-05 17:15:41 +0000
+++ Percona-Server/sql/log_event.cc 2013-04-17 15:44:59 +0000
@@ -3716,6 +3716,21 @@
DBUG_RETURN(Log_event::EVENT_SKIP_COUNT);
}
}
+#ifdef WITH_WSREP
+ else if (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));
}
@@ -5752,6 +5767,20 @@
thd->variables.option_bits&= ~OPTION_BEGIN;
DBUG_RETURN(Log_event::EVENT_SKIP_COUNT);
}
+#ifdef WITH_WSREP
+ else if (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 */
=== modified file 'Percona-Server/sql/slave.cc'
--- Percona-Server/sql/slave.cc 2013-04-05 17:15:41 +0000
+++ Percona-Server/sql/slave.cc 2013-04-17 15:44:48 +0000
@@ -2395,23 +2395,6 @@
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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment