From 40e614c194cf2adb66c2deb6fca196ba4d7eab58 Mon Sep 17 00:00:00 2001
From: pgamba <pgamba@localhost>
Date: Mon, 07 Sep 2009 15:32:03 +0000
Subject: [PATCH] Fix for #4209 ECL: trailing changelog entries after purge can make ECL search result incoherent

---
 opends/src/server/org/opends/server/replication/server/ECLServerHandler.java |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/server/ECLServerHandler.java b/opends/src/server/org/opends/server/replication/server/ECLServerHandler.java
index 4346763..8359381 100644
--- a/opends/src/server/org/opends/server/replication/server/ECLServerHandler.java
+++ b/opends/src/server/org/opends/server/replication/server/ECLServerHandler.java
@@ -154,6 +154,7 @@
     ServerState startState;
     ServerState currentState;
     ServerState stopState;
+    long domainLatestTrimDate;
 
     /**
      * {@inheritDoc}
@@ -230,7 +231,12 @@
         {
           // Here comes a new message !!!
           // non blocking
-          UpdateMsg newMsg = mh.getnextMessage(false);
+          UpdateMsg newMsg;
+          do {
+            newMsg = mh.getnextMessage(false);
+            // older than latest domain trimdate ?
+          } while ((newMsg!=null) &&
+              (newMsg.getChangeNumber().getTime() < domainLatestTrimDate));
 
           if (debugEnabled())
             TRACER.debugInfo(" In ECLServerHandler, for " + mh.getServiceId() +
@@ -639,6 +645,7 @@
           DomainContext newDomainCtxt = new DomainContext();
           newDomainCtxt.active = true;
           newDomainCtxt.rsd = rsd;
+          newDomainCtxt.domainLatestTrimDate = rsd.getLatestDomainTrimDate();
 
           // Assign the start state for the domain
           if (isPersistent ==

--
Gitblit v1.10.0