From 43f2a85a05410053a43e9aa632d17b28d8114215 Mon Sep 17 00:00:00 2001
From: pgamba <pgamba@localhost>
Date: Thu, 25 Oct 2007 08:45:25 +0000
Subject: [PATCH] Fix generationID computation when the backend contains multiple suffix

---
 opendj-sdk/opends/src/server/org/opends/server/replication/plugin/ReplicationDomain.java |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/ReplicationDomain.java b/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/ReplicationDomain.java
index 0f9c08c..3e8edc1 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/ReplicationDomain.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/ReplicationDomain.java
@@ -2289,7 +2289,7 @@
   public long computeGenerationId() throws DirectoryException
   {
     Backend backend = retrievesBackend(baseDN);
-    long bec = backend.getEntryCount();
+    long bec = backend.numSubordinates(baseDN, true) + 1;
     this.acquireIEContext();
     ieContext.checksumOutput = true;
     ieContext.entryCount = (bec<1000?bec:1000);
@@ -2710,7 +2710,8 @@
       os = new CheckedOutputStream(ros, new Adler32());
       try
       {
-        os.write((Long.toString(ieContext.entryCount)).getBytes());
+        os.write((Long.toString(backend.numSubordinates(baseDN, true) + 1)).
+            getBytes());
       }
       catch(Exception e)
       {

--
Gitblit v1.10.0