From c4d69f17753f375e8cfd18c33de291cdf13504f9 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Aug 2011 11:38:52 +0200 Subject: MWL#234: Support for marking binlog events to not be replicated, and for telling slaves not to replicate events with such mark --- sql/log_event.h | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'sql/log_event.h') diff --git a/sql/log_event.h b/sql/log_event.h index 4ea511f45b5..b3a6d0c9d48 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -490,6 +490,19 @@ struct sql_ex_info */ #define LOG_EVENT_RELAY_LOG_F 0x40 +/** + @def LOG_EVENT_DO_NOT_REPLICATE_F + + Flag set by application creating the event (with @@do_not_replicate); the + slave will skip replication of such events if + --replicate-ignore-do-not-replicate is set. + + This is a MariaDB flag; we allocate it from the end of the available + values to reduce risk of conflict with new MySQL flags. +*/ +#define LOG_EVENT_DO_NOT_REPLICATE_F 0x8000 + + /** @def OPTIONS_WRITTEN_TO_BIN_LOG @@ -656,6 +669,11 @@ typedef struct st_print_event_info uint charset_database_number; uint thread_id; bool thread_id_printed; + /* + Track when @@do_not_replicate changes so we need to output a SET + statement for it. + */ + int do_not_replicate; st_print_event_info(); @@ -910,8 +928,8 @@ public: /** Some 16 flags. See the definitions above for LOG_EVENT_TIME_F, - LOG_EVENT_FORCED_ROTATE_F, LOG_EVENT_THREAD_SPECIFIC_F, and - LOG_EVENT_SUPPRESS_USE_F for notes. + LOG_EVENT_FORCED_ROTATE_F, LOG_EVENT_THREAD_SPECIFIC_F, + LOG_EVENT_SUPPRESS_USE_F, and LOG_EVENT_DO_NOT_REPLICATE_F for notes. */ uint16 flags; @@ -3915,6 +3933,8 @@ public: DBUG_PRINT("enter", ("m_incident: %d", m_incident)); m_message.str= NULL; /* Just as a precaution */ m_message.length= 0; + /* Replicate the incident irregardless of @@do_not_replicate. */ + flags&= ~LOG_EVENT_DO_NOT_REPLICATE_F; DBUG_VOID_RETURN; } @@ -3924,6 +3944,8 @@ public: DBUG_ENTER("Incident_log_event::Incident_log_event"); DBUG_PRINT("enter", ("m_incident: %d", m_incident)); m_message= msg; + /* Replicate the incident irregardless of @@do_not_replicate. */ + flags&= ~LOG_EVENT_DO_NOT_REPLICATE_F; DBUG_VOID_RETURN; } #endif -- cgit v1.2.1 From b1a13cb15a2cca5dece24c860f64b5ee012ed199 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Aug 2011 13:18:34 +0200 Subject: MWL#234: After-review fixes, including better names for the new system variables. --- sql/log_event.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'sql/log_event.h') diff --git a/sql/log_event.h b/sql/log_event.h index b3a6d0c9d48..153c2999bf6 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -491,16 +491,16 @@ struct sql_ex_info #define LOG_EVENT_RELAY_LOG_F 0x40 /** - @def LOG_EVENT_DO_NOT_REPLICATE_F + @def LOG_EVENT_SKIP_REPLICATION_F - Flag set by application creating the event (with @@do_not_replicate); the + Flag set by application creating the event (with @@skip_replication); the slave will skip replication of such events if - --replicate-ignore-do-not-replicate is set. + --replicate-events-marked-for-skip is false. This is a MariaDB flag; we allocate it from the end of the available values to reduce risk of conflict with new MySQL flags. */ -#define LOG_EVENT_DO_NOT_REPLICATE_F 0x8000 +#define LOG_EVENT_SKIP_REPLICATION_F 0x8000 /** @@ -670,10 +670,10 @@ typedef struct st_print_event_info uint thread_id; bool thread_id_printed; /* - Track when @@do_not_replicate changes so we need to output a SET + Track when @@skip_replication changes so we need to output a SET statement for it. */ - int do_not_replicate; + int skip_replication; st_print_event_info(); @@ -929,7 +929,7 @@ public: /** Some 16 flags. See the definitions above for LOG_EVENT_TIME_F, LOG_EVENT_FORCED_ROTATE_F, LOG_EVENT_THREAD_SPECIFIC_F, - LOG_EVENT_SUPPRESS_USE_F, and LOG_EVENT_DO_NOT_REPLICATE_F for notes. + LOG_EVENT_SUPPRESS_USE_F, and LOG_EVENT_SKIP_REPLICATION_F for notes. */ uint16 flags; @@ -3933,8 +3933,8 @@ public: DBUG_PRINT("enter", ("m_incident: %d", m_incident)); m_message.str= NULL; /* Just as a precaution */ m_message.length= 0; - /* Replicate the incident irregardless of @@do_not_replicate. */ - flags&= ~LOG_EVENT_DO_NOT_REPLICATE_F; + /* Replicate the incident irregardless of @@skip_replication. */ + flags&= ~LOG_EVENT_SKIP_REPLICATION_F; DBUG_VOID_RETURN; } @@ -3944,8 +3944,8 @@ public: DBUG_ENTER("Incident_log_event::Incident_log_event"); DBUG_PRINT("enter", ("m_incident: %d", m_incident)); m_message= msg; - /* Replicate the incident irregardless of @@do_not_replicate. */ - flags&= ~LOG_EVENT_DO_NOT_REPLICATE_F; + /* Replicate the incident irregardless of @@skip_replication. */ + flags&= ~LOG_EVENT_SKIP_REPLICATION_F; DBUG_VOID_RETURN; } #endif -- cgit v1.2.1 From 9313032283f1650d11fb36066f31d966e8492bdc Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Aug 2011 11:51:02 +0200 Subject: MWL#234: Implement option to switch between master-side and client-side filtering of @@skip_replication events. --- sql/log_event.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/log_event.h') diff --git a/sql/log_event.h b/sql/log_event.h index 153c2999bf6..aeab4bc230c 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -495,7 +495,7 @@ struct sql_ex_info Flag set by application creating the event (with @@skip_replication); the slave will skip replication of such events if - --replicate-events-marked-for-skip is false. + --replicate-events-marked-for-skip is not set to REPLICATE. This is a MariaDB flag; we allocate it from the end of the available values to reduce risk of conflict with new MySQL flags. -- cgit v1.2.1