From cc98695069d613fb483650235920b70f1022f4d5 Mon Sep 17 00:00:00 2001
From: pgamba <pgamba@localhost>
Date: Thu, 29 Nov 2007 08:43:16 +0000
Subject: [PATCH] Fix #2630 dsrepl pre-external-initialization does not work with bin copy

---
 opends/src/server/org/opends/server/replication/server/ServerHandler.java |   32 ++++++++++++++++++++++----------
 1 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/server/ServerHandler.java b/opends/src/server/org/opends/server/replication/server/ServerHandler.java
index 15de178..a6b3e74 100644
--- a/opends/src/server/org/opends/server/replication/server/ServerHandler.java
+++ b/opends/src/server/org/opends/server/replication/server/ServerHandler.java
@@ -146,7 +146,7 @@
   private short replicationServerId;
 
   private short protocolVersion;
-  private long generationId=-1;
+  private long generationId = -1;
 
 
   /**
@@ -219,7 +219,7 @@
     rcvWindowSizeHalf = windowSize/2;
     maxRcvWindow = windowSize;
     rcvWindow = windowSize;
-    long localGenerationId=-1;
+    long localGenerationId = -1;
     try
     {
       if (baseDn != null)
@@ -557,7 +557,9 @@
         // Create a thread to send heartbeat messages.
         if (heartbeatInterval > 0)
         {
-          heartbeatThread = new HeartbeatThread("replication Heartbeat",
+          heartbeatThread = new HeartbeatThread(
+              "replication Heartbeat to " + serverURL +
+              " for " + this.baseDn,
               session, heartbeatInterval);
           heartbeatThread.start();
         }
@@ -1738,7 +1740,7 @@
   /**
    * Resets the generationId for this domain.
    */
-  public void resetGenerationId()
+  public void warnBadGenerationId()
   {
     // Notify the peer that it is now invalid regarding the generationId
     // We are now waiting a startServer message from this server with
@@ -1764,10 +1766,20 @@
    * @throws IOException When it occurs while sending the message,
    *
    */
-   public void sendGenerationId(ResetGenerationId msg)
-   throws IOException
-   {
-     generationId = msg.getGenerationId();
-     session.publish(msg);
-   }
+  public void forwardGenerationIdToRS(ResetGenerationId msg)
+  throws IOException
+  {
+    session.publish(msg);
+  }
+
+  /**
+   * Set a new generation ID.
+   *
+   * @param generationId The new generation ID
+   *
+   */
+  public void setGenerationId(long generationId)
+  {
+    this.generationId = generationId;
+  }
 }

--
Gitblit v1.10.0