Details
-
New Feature
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
26.10.0
-
MXS-SPRINT-275, MXS-SPRINT-276, MXS-SPRINT-277
Description
A semisync primary configured with rpl_semi_sync_master_wait_point=AFTER_SYNC and init-rpl-role=SLAVE will typically truncate its binary log from non-confirmed (missing replica acknowledgement) transactions when recovering after a crash. This is fine if failover has already happened:
1. Either the new primary has the transaction, and the old primary can download and re-apply them. In this case the client needs to do some digging and confirm that the writes went through.
2. The transactions never reached a replica and are totally lost. This is fine, as the client never received an OK.
If, however, the primary recovers before failover, we have an issue: The server may throw away transactions that a replica (or multiple) already possesses. This causes diverging replication. Ideally, MaxScale should detect this situation and fix it. The issue can be fixed simply by having the primary replicate the missing transactions from the most advanced replica. This should be fast, as the primary should not be far behind. The replication connection created for this purpose should be naturally cleaned up right away.