From b27c0518805fc8c1152b6214f5099f200df86c4a Mon Sep 17 00:00:00 2001
From: gbellato <gbellato@localhost>
Date: Fri, 07 Aug 2009 07:59:01 +0000
Subject: [PATCH] Fix for  4165 : Replica can be slow to replay changes when using large window size

---
 opendj-sdk/opends/src/server/org/opends/server/replication/plugin/RemotePendingChanges.java |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/RemotePendingChanges.java b/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/RemotePendingChanges.java
index dee8335..a19cf59 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/RemotePendingChanges.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/plugin/RemotePendingChanges.java
@@ -265,6 +265,15 @@
           }
         }
       }
+      else
+      {
+        // We reached an operation that is newer than the operation
+        // for which we are doing the dependency check so it is
+        // not possible to find another operation with some dependency.
+        // break the loop to avoid going through the potentially large
+        // list of pending changes.
+        break;
+      }
     }
     return hasDependencies;
   }
@@ -312,6 +321,15 @@
           }
         }
       }
+      else
+      {
+        // We reached an operation that is newer than the operation
+        // for which we are doing the dependency check so it is
+        // not possible to find another operation with some dependency.
+        // break the loop to avoid going through the potentially large
+        // list of pending changes.
+        break;
+      }
     }
     return hasDependencies;
   }
@@ -389,6 +407,15 @@
           }
         }
       }
+      else
+      {
+        // We reached an operation that is newer than the operation
+        // for which we are doing the dependency check so it is
+        // not possible to find another operation with some dependency.
+        // break the loop to avoid going through the potentially large
+        // list of pending changes.
+        break;
+      }
     }
     return hasDependencies;
   }
@@ -465,6 +492,15 @@
           }
         }
       }
+      else
+      {
+        // We reached an operation that is newer than the operation
+        // for which we are doing the dependency check so it is
+        // not possible to find another operation with some dependency.
+        // break the loop to avoid going through the potentially large
+        // list of pending changes.
+        break;
+      }
     }
     return hasDependencies;
   }

--
Gitblit v1.10.0