From d9b21dcf9e0a987e0ffb2cd8f6f59e9f6357a50f Mon Sep 17 00:00:00 2001
From: coulbeck <coulbeck@localhost>
Date: Thu, 19 Oct 2006 15:32:47 +0000
Subject: [PATCH] Fix for [Issue 798] break infinite loop when problems with naming resolution conflict.  Reviewed by gbellato. The fix is to replay the operation a maximum of 10 times.  There is a unit test for this issue that uses the short-circuit plugin to force the infinite replay loop.

---
 opends/src/server/org/opends/server/synchronization/SynchronizationDomain.java |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/opends/src/server/org/opends/server/synchronization/SynchronizationDomain.java b/opends/src/server/org/opends/server/synchronization/SynchronizationDomain.java
index f02c35d..922bfe6 100644
--- a/opends/src/server/org/opends/server/synchronization/SynchronizationDomain.java
+++ b/opends/src/server/org/opends/server/synchronization/SynchronizationDomain.java
@@ -1038,10 +1038,11 @@
     Operation op = null;
     boolean done = false;
     ChangeNumber changeNumber = null;
+    int retryCount = 10;
 
     try
     {
-      while (!done)
+      while (!done && retryCount-- > 0)
       {
         op = msg.createOperation(conn);
 
@@ -1093,6 +1094,18 @@
           done = true;
         }
       }
+
+      if (!done)
+      {
+        // Continue with the next change but the servers could now become
+        // inconsistent.
+        // TODO : REPAIR : Should let the repair tool know about this
+        int msgID = MSGID_LOOP_REPLAYING_OPERATION;
+        String message = getMessage(msgID, op.toString());
+        logError(ErrorLogCategory.SYNCHRONIZATION,
+            ErrorLogSeverity.SEVERE_ERROR, message, msgID);
+        updateError(changeNumber);
+      }
     }
     catch (ASN1Exception e)
     {

--
Gitblit v1.10.0