Fix for #4209 ECL: trailing changelog entries after purge can make ECL search result incoherent
Description
Example:
Using 1 suffix, 2 DSes on which write operations are done when replication is enabled.
After a given time (24 h by default config), the replication db is trimed.
Searching the ECL, returns then the latest change done for each (DS, suffix).
This result is not correct :
- because the db is supposed to be trimmed
- because it does not respect time consistency, since it contains some old changes (for example from DS1) while it does not contain some more recent changes (for example
from DS2).
Roughly, this happens because the ECL relies on the "logical" replication changelog db, and because of the triming policy of the changelog db.
With more details, the replication db is made of one db instance by (DS, suffix) tuple. Trimming the "changelog db" consists in trimming each db instance, and for each
instance to always leave at least the latest change (for some reason purely replication oriented).
The fix of the ECL consists in :
- at the beginning of the ECL search processing, getting the latest trim date from each replication server domain (stored when trim is done)
- when each change is processed, to skip it when it is older than the latest trim date of the domain.
From the above example:
Now the ECL is empty after the changelog db trimming.
Diff
Code and new unit test