diff options
author | Nirbhay Choubey <nirbhay@mariadb.com> | 2015-11-18 02:11:20 -0500 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@mariadb.com> | 2015-11-18 02:11:20 -0500 |
commit | f47124c9ef58d0f0e02d6c0ce616a7397420f99b (patch) | |
tree | eb0af2007480a98a12851a4db47ea5ffdf57ec21 /sql | |
parent | 836275bb203a47104eb7f28aa409924b91abc801 (diff) | |
download | mariadb-git-f47124c9ef58d0f0e02d6c0ce616a7397420f99b.tar.gz |
Incorrect statements binlogged on slave with do_domain_ids=(...)
In domain ID based filtering, a flag is used to filter-out
the events that belong to a particular domain. This flag gets
set when IO thread receives a GTID_EVENT for the domain on
filter list and its reset at the last event in the GTID group.
The resetting, however, was wrongly done before the decision to
write/filter the event from relay log is made. As a result, the
last event in the group will always pass through the filter.
Fixed by deferring the reset logic. Also added a test case.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/slave.cc | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/sql/slave.cc b/sql/slave.cc index 235b26f81ae..58cb508f8c8 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -5875,22 +5875,6 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) } };); - if (mi->using_gtid != Master_info::USE_GTID_NO && - mi->domain_id_filter.is_group_filtered() && - mi->events_queued_since_last_gtid > 0 && - ((mi->last_queued_gtid_standalone && - !Log_event::is_part_of_group((Log_event_type)(uchar) - buf[EVENT_TYPE_OFFSET])) || - (!mi->last_queued_gtid_standalone && - ((uchar)buf[EVENT_TYPE_OFFSET] == XID_EVENT || - ((uchar)buf[EVENT_TYPE_OFFSET] == QUERY_EVENT && - Query_log_event::peek_is_commit_rollback(buf, event_len, - checksum_alg)))))) - { - /* Reset the domain_id_filter flag. */ - mi->domain_id_filter.reset_filter(); - } - if (mi->using_gtid != Master_info::USE_GTID_NO && mi->gtid_event_seen) { if (unlikely(mi->gtid_reconnect_event_skip_count)) @@ -6076,6 +6060,9 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) */ mi->gtid_current_pos.update(&mi->last_queued_gtid); mi->events_queued_since_last_gtid= 0; + + /* Reset the domain_id_filter flag. */ + mi->domain_id_filter.reset_filter(); } skip_relay_logging: |