From 763640e8f9698113b2c001a71a718eecb60ac30c Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Thu, 03 Jul 2014 15:19:12 +0000
Subject: [PATCH] OPENDJ-1453 (CR-3938) Replica offline messages should be synced with updates

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

diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java b/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java
index e6eee2b..9744a22 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java
@@ -67,6 +67,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;
@@ -182,6 +183,7 @@
    */
   private static final DebugTracer TRACER = getTracer();
 
+  private final DSRSShutdownSync dsrsShutdownSync;
   /**
    * The update to replay message queue where the listener thread is going to
    * push incoming update messages.
@@ -452,14 +454,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);
@@ -2017,6 +2022,7 @@
   public void publishReplicaOfflineMsg()
   {
     pendingChanges.putReplicaOfflineMsg();
+    dsrsShutdownSync.replicaOfflineMsgSent(getBaseDN());
   }
 
   /**

--
Gitblit v1.10.0