replication-manager
replication-manager copied to clipboard
Switchover & Failover with inter-cluster and filtered replications
Setup :
Cluster parent : P Cluster Child (C) composed of C1 and C2.
There is a replication from P to C(primary) so for exemple C1. When an event comes to C1, filter is applied.
- If event is NOT filtered, it will go to the C1's binary logs, and there is no issue.
- If event IS FILTERED, gtid_slave_pos & gtid_current_pos will be updated by MariaDB to the read/ignored position BUT NOT written to C1's binlogs. In this case, we can have a switchover (or failover) issue : C2 will reconnect to P correctly. C1 will try to connect to C2 with Parent domain position ignored. C2 will answer "There is no such position in my binary logs".
As discussed :
- Replication manager - for switchover : Add a "flush binary logs" before to switchover, in order to force the last binlog entry to be replicated.
- Replication manager : Write a helper who can read into gtid_binlog_pos the last position written to binlog - so that can be found on the "old secondary" C2 server.
- MariaDB : See if we can add a parameter to not update "slave_pos" and "current_pos" if event is ignored by filter; or write a "NO-OP: Ignored by filter" into binlogs in order to keep up-to-date the binlog position.