erthink/ReOpenLDAP

Infinite delta-MMR (accesslog) synchronization (syncrepl drawback)

erthink opened this issue · 0 comments

In some cases delta-mmr (si_logstate == SYNCLOG_LOGBASED) synchronization could not resolve LDAP_ALREADY_EXISTS error(s) even by fallback to full-refresh mode. Or in the other words these errors may occur again after full-refresh cycle (si_logstate = SYNCLOG_FALLBACK) and returning back.
From the outside this visible as endless synchronization attempts which ends to into a dirty state.

The minimal scenario seems like this:

  • setup 2 or more slapd with delta-MMR with syncrepl-DN inside replication scope, but don't create such DN at this step (i.e. syncrepl can't connect now).
  • add syncrepl-DN on each node, this also allows syncrepl to connect.
  • synchronization may cyclically fail on the syncrepl-DN with LDAP_ALREADY_EXISTS.

Probably fix:

  1. Ignore LDAP_ALREADY_EXISTS for LDAP_REQ_ADD when an entry has the same type/class and attributes, but update entry-CSN if incoming value more recent.
  2. Silently ignore LDAP_NO_SUCH_OBJECT for LDAP_REQ_DELETE.