From fdd4869955da5a5f181d0d44756d3da0bdd35594 Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Wed, 13 Apr 2011 22:24:13 +0000
Subject: [PATCH] Another fix for OpenDJ-97: Very many minor problems with the error logging for replication

---
 opends/src/server/org/opends/server/replication/service/ReplicationBroker.java |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/service/ReplicationBroker.java b/opends/src/server/org/opends/server/replication/service/ReplicationBroker.java
index 347158c..1e8de0f 100644
--- a/opends/src/server/org/opends/server/replication/service/ReplicationBroker.java
+++ b/opends/src/server/org/opends/server/replication/service/ReplicationBroker.java
@@ -2601,15 +2601,21 @@
               {
                 // The best replication server is no more the one we are
                 // currently using. Disconnect properly then reconnect.
-                int bestServerId = -1;
-                if (bestServerInfo != null)
+                Message message;
+                if (bestServerInfo == null)
                 {
-                  bestServerId = bestServerInfo.getServerId();
+                  message = NOTE_LOAD_BALANCE_REPLICATION_SERVER.get(
+                      serverId, replicationServerID,
+                      failingSession.getReadableRemoteAddress(),
+                      baseDn);
                 }
-                Message message = NOTE_NEW_BEST_REPLICATION_SERVER
-                    .get(serverId, replicationServerID,
-                        failingSession.getReadableRemoteAddress(),
-                        bestServerId, baseDn);
+                else
+                {
+                  message = NOTE_NEW_BEST_REPLICATION_SERVER.get(
+                      serverId, replicationServerID,
+                      failingSession.getReadableRemoteAddress(),
+                      bestServerInfo.getServerId(), baseDn);
+                }
                 logError(message);
                 reStart(true);
               }

--
Gitblit v1.10.0