From aea0892feca2fd3d56c9c810debed6d22389454e Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Fri, 11 Jul 2014 09:54:43 +0000
Subject: [PATCH] OPENDJ-1453 (CR-3938) Replica offline messages should be synced with updates

---
 opendj3-server-dev/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/opendj3-server-dev/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java b/opendj3-server-dev/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java
index d99d8c1..cc581d0 100644
--- a/opendj3-server-dev/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java
+++ b/opendj3-server-dev/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java
@@ -70,6 +70,7 @@
 import org.opends.server.replication.common.ServerStatus;
 import org.opends.server.replication.common.StatusMachineEvent;
 import org.opends.server.replication.protocol.*;
+import org.opends.server.replication.service.DSRSShutdownSync;
 import org.opends.server.replication.service.ReplicationBroker;
 import org.opends.server.replication.service.ReplicationDomain;
 import org.opends.server.tasks.PurgeConflictsHistoricalTask;
@@ -185,6 +186,7 @@
   public static final String DS_SYNC_CONFLICT = "ds-sync-conflict";
   private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
 
+  private final DSRSShutdownSync dsrsShutdownSync;
   /**
    * The update to replay message queue where the listener thread is going to
    * push incoming update messages.
@@ -455,14 +457,17 @@
    *
    * @param configuration    The configuration of this ReplicationDomain.
    * @param updateToReplayQueue The queue for update messages to replay.
+   * @param dsrsShutdownSync Synchronization object for shutdown of combined DS/RS instances.
    * @throws ConfigException In case of invalid configuration.
    */
   LDAPReplicationDomain(ReplicationDomainCfg configuration,
-      BlockingQueue<UpdateToReplay> updateToReplayQueue) throws ConfigException
+      BlockingQueue<UpdateToReplay> updateToReplayQueue,
+      DSRSShutdownSync dsrsShutdownSync) throws ConfigException
   {
     super(configuration, -1);
 
     this.updateToReplayQueue = updateToReplayQueue;
+    this.dsrsShutdownSync = dsrsShutdownSync;
 
     // Get assured configuration
     readAssuredConfig(configuration, false);
@@ -2011,6 +2016,7 @@
   public void publishReplicaOfflineMsg()
   {
     pendingChanges.putReplicaOfflineMsg();
+    dsrsShutdownSync.replicaOfflineMsgSent(getBaseDN());
   }
 
   /**

--
Gitblit v1.10.0