From acfcc9e05552e3d2fe37f8d9b8ac0827a204ee3a Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 21 Jul 2014 12:53:41 +0000
Subject: [PATCH] OPENDJ-1441 (CR-4037) Persistent searches on external changelog do not return changes for new replicas and new domains

---
 opends/src/server/org/opends/server/replication/server/changelog/file/FileChangelogDB.java |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/server/changelog/file/FileChangelogDB.java b/opends/src/server/org/opends/server/replication/server/changelog/file/FileChangelogDB.java
index a194d6d..65a95fc 100644
--- a/opends/src/server/org/opends/server/replication/server/changelog/file/FileChangelogDB.java
+++ b/opends/src/server/org/opends/server/replication/server/changelog/file/FileChangelogDB.java
@@ -41,6 +41,7 @@
 import org.opends.server.replication.common.CSN;
 import org.opends.server.replication.common.MultiDomainServerState;
 import org.opends.server.replication.common.ServerState;
+import org.opends.server.replication.plugin.MultimasterReplication;
 import org.opends.server.replication.protocol.UpdateMsg;
 import org.opends.server.replication.server.ChangelogState;
 import org.opends.server.replication.server.ReplicationServer;
@@ -237,10 +238,13 @@
       return previousValue;
     }
 
-    // we just created a new domain => update all cursors
-    for (MultiDomainDBCursor cursor : registeredMultiDomainCursors)
+    if (MultimasterReplication.isECLEnabledDomain(baseDN))
     {
-      cursor.addDomain(baseDN, null);
+      // we just created a new domain => update all cursors
+      for (MultiDomainDBCursor cursor : registeredMultiDomainCursors)
+      {
+        cursor.addDomain(baseDN, null);
+      }
     }
     return newValue;
   }
@@ -417,10 +421,6 @@
    */
   public void clearDB() throws ChangelogException
   {
-    if (debugEnabled())
-    {
-      TRACER.debugInfo("clear the FileChangelogDB");
-    }
     if (!dbDirectory.exists())
     {
       return;
@@ -868,7 +868,7 @@
             }
           }
 
-          for (final Map<Integer, FileReplicaDB> domainMap: domainToReplicaDBs.values())
+          for (final Map<Integer, FileReplicaDB> domainMap : domainToReplicaDBs.values())
           {
             for (final FileReplicaDB replicaDB : domainMap.values())
             {

--
Gitblit v1.10.0