https://bugs.openldap.org/show_bug.cgi?id=10026
--- Comment #15 from Howard Chu hyc@openldap.org --- (In reply to Ondřej Kuzník from comment #0)
Take MPR plain syncrepl with 3+ providers.
When a provider's own syncrepl session transitions to persist and a it starts a new parallel session towards another host, that session always has to start as a refresh. If that refresh serves entries to us, our handling of si_dirty is not consistent:
- if the existing persist session serves some of these entries to us, we can
"forget" to pass the others to a newly connected consumer
- same if the refresh is abandoned and we start refreshing from a different
provider that might be behind what we were being served (again our consumers could suffer)
- if we restart, si_dirty is forgotten and our consumers suffer even worse
We might need to be told (at the beginning of the refresh?) what the end state we're going for is, so we can keep si_dirty on until then. And somehow persist that knowledge in the DB...
Let's define what syncprov actually needs to remember, then, and maybe that will tell us what needs to be done.
Walking thru the problem description again:
Server A has a consumer talking to server B, that has entered persist. Server A has a consumer that starts talking to server C. This of course must start with a refresh. During that refresh, a number of changes may be received, with no contextCSN update, since that can only be sent when the refresh completes.
If server A's persist connection receives changes while the refresh is happening, and a new consumer connects at this time, some of the refresh changes may be lost?
Server A completes its refresh with server B and gets a contextCSN B0, when it enters persist phase. Server A starts a refresh against server C, including B0 in its cookie. So the changes it receives from C will be newer than B0.
Server A receives a change on its persist session from B, which makes its contextCSN B1.
Consumer D connects to A with a cookie that says what? Older than B0, presumably, so it will do a refresh up to B0 or B1. What happens next?