mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Nicolas Capponi
23.34.2014 184794cf69c20ac52ad9049da9757b74c4438011
OPENDJ-1441 (CR-4037) Persistent searches on external changelog do not return changes for new replicas and new domains

Fixed a problem introduced in r10918.

In getExistingOrNewDomainMap(DN) method, the MultimasterReplication.isECLEnabledDomain() method is called.
However, this method blocks forever at replication startup because MultimasterReplication state is equals to STARTING
and is only set to RUNNING in code that occurs after in the same thread.

Code sequence is :
1. SynchronizationProviderConfigManager calls MultimasterReplication.initializeSynchronizationProvider()
try to call MultimasterReplication.isECLEnabledDomain() but MultimasterReplication state is equals
to STARTING so it waits indefinitely on a state change
2. SynchronizationProviderConfigManager calls DirectoryServer.registerSynchronizationProvider(provider)
MultimasterReplication state is set to RUNNING

Add a check on registeredMultiDomainCursors to ensure that isECLEnabledDomain() is not called when
the replication server is starting (as no cursors can be created yet).
1 files modified
4 ■■■ changed files
opends/src/server/org/opends/server/replication/server/changelog/file/FileChangelogDB.java 4 ●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/changelog/file/FileChangelogDB.java
@@ -240,7 +240,9 @@
      return previousValue;
    }
    if (MultimasterReplication.isECLEnabledDomain(baseDN))
    // When called at replication startup, the isECLEnabledDomain() method blocks on STARTING state.
    // Checking cursors list ensure that it is never called in the startup case.
    if (!registeredMultiDomainCursors.isEmpty() && MultimasterReplication.isECLEnabledDomain(baseDN))
    {
      // we just created a new domain => update all cursors
      for (MultiDomainDBCursor cursor : registeredMultiDomainCursors)