Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.4.21, 10.5.12
-
None
Description
Howto reproduce:
Lets take a leader - replica cluster on domain 0 on leader of this cluster add extra source of replication on an domain 1 server with a table or database filter. Insert 1 record on domain 0 and insert 1 record on domain 1 on the filter.
Issue:
Switchover is not possible on domain 0 as the gtid_slave_pos on the old leader is increase by the filter but not increase on his replica as not in binlog.
Fixing:
The possible fix should be not to increase gtid_slave_pos and gtid_current_pos when the event is filtered , this would impact reconnect of the replication to refetch prior position to any non filtered replication events . Can slow down the reconnect in case of a majority of filtered events but can be mitigated by having the filtered events in the relay log and check here if the last event is filtered before connection if not it is safe to set slave_pos to the highest gtid in relay log
An other fix would be to write the event in the binlog with an extra flag filtered and stream it to the replica as well , so the position exits and a parameter can be added at any layer of the replication tree to restore those events
replicate-ingore-filters = boolean [ON] don't apply filtered event OFF apply filtered event
Attachments
Issue Links
- relates to
-
MDEV-26706 Enable per table gtid domain_id
- Open
Hello Kristian Nielsen;
Thanks for time.
After verifiying, my setup is :
On all the setup, i only use NAMED replicas.
Primary cluster : srv 1 and srv2(gtid domain 11).
There is many writes, with some of them who are useless on the downstream clusters.
Replicas connected to this server are named : C1
Second cluster : srv3 and srv4
Writes made on this cluster are gtid domain 3.
use only a subset of Cluster 1; and add many tables arround it.
Replicas conencted to srv3 or srv4 (dependting the primary) are named : C2
On cluster 2; i have :
gtid_strict_mode=OFF
gtid_ignore_duplicates=OFF
C1.replicate-rewrite-db="DB1->DB2"
C1.replicate-do-table=DB2TBL1
C1.replicate-do-table=DB2.TBL2
There is no filters on C2 named flow.
For now, the setup is :
srv2 <--
(C1)-srv1-(C1+filters)->srv3-(C2)-->srv4I'll plan to change gtid_ignore_duplicates to ON; and test again fail-overs between srv3 and srv4.