Failover Response when Replica Applier is Latent
During a failover, the manager will wait until the Replica that is the candidate for promotion to Primary has applied all stored THL events before promoting that node to Primary.
This wait time can be configured via the property=manager.failover.thl.apply.wait.timeout=0 property.
The default value is 0, which means "wait indefinitely until all stored THL events are applied".
Any value other than zero invites data loss due to the fact that once the Replica is promoted to Primary, any unapplied stored events in the THL will be ignored, and therefore lost.
Whenever a failover occurs, the Replica with most events stored in the local THL is selected so that when the events are eventually applied, the data is as close to the original Primary as possible with the least number of events missed.
That is usually, but not always, the most up-to-date Replica, which is the one with the most events applied.
There should be a good balance between the value for property=manager.failover.thl.apply.wait.timeout and the value for
property=policy-relay-from-slave, which is the "maximum Replica latency" - this means the number of seconds to which a
Replica must be current with the Primary in order to qualify as a candidate for failover. The default is 15 minutes (900 seconds).