From 2c566d7a7e051824c920cd8657d1fa0af64db92f Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Mon, 22 Jun 2009 12:29:34 +0000
Subject: [PATCH] The code in ReplicationCliMain assumed that when the first server where replication was enabled always had the server itself registered in the ADS. This is not true when all the suffixes had already been disabled in that server. With this fix the user can enable and disable replication for all suffixes without problems on a given server.
---
opendj-sdk/opends/src/server/org/opends/server/tools/dsreplication/ReplicationCliMain.java | 30 +++++++++++++++++++++++++++---
1 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/opendj-sdk/opends/src/server/org/opends/server/tools/dsreplication/ReplicationCliMain.java b/opendj-sdk/opends/src/server/org/opends/server/tools/dsreplication/ReplicationCliMain.java
index fc5106b..0e82973 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/tools/dsreplication/ReplicationCliMain.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/tools/dsreplication/ReplicationCliMain.java
@@ -4603,7 +4603,7 @@
{
adsCtx1.createAdministrator(getAdministratorProperties(uData));
}
- if (registry2.size() == 0)
+ if (!ADSContext.isRegistered(server2, registry2))
{
server2.updateAdsPropertiesWithServerProperties();
registerServer(adsCtx1, server2.getAdsProperties());
@@ -4612,6 +4612,11 @@
{
registerServer(adsCtx1, registry2.iterator().next());
}
+ if (!ADSContext.isRegistered(server1, registry1))
+ {
+ server1.updateAdsPropertiesWithServerProperties();
+ registerServer(adsCtx1, server1.getAdsProperties());
+ }
ctxSource = ctx1;
ctxDestination = ctx2;
@@ -4624,7 +4629,7 @@
{
adsCtx2.createAdministrator(getAdministratorProperties(uData));
}
- if (registry1.size() == 0)
+ if (!ADSContext.isRegistered(server1, registry1))
{
server1.updateAdsPropertiesWithServerProperties();
registerServer(adsCtx2, server1.getAdsProperties());
@@ -4633,6 +4638,11 @@
{
registerServer(adsCtx2, registry1.iterator().next());
}
+ if (!ADSContext.isRegistered(server2, registry2))
+ {
+ server2.updateAdsPropertiesWithServerProperties();
+ registerServer(adsCtx2, server2.getAdsProperties());
+ }
ctxSource = ctx2;
ctxDestination = ctx1;
@@ -4664,6 +4674,13 @@
}
server1.updateAdsPropertiesWithServerProperties();
registerServer(adsCtx2, server1.getAdsProperties());
+ Set<Map<ADSContext.ServerProperty, Object>> registry2 =
+ adsCtx2.readServerRegistry();
+ if (!ADSContext.isRegistered(server2, registry2))
+ {
+ server2.updateAdsPropertiesWithServerProperties();
+ registerServer(adsCtx2, server2.getAdsProperties());
+ }
ctxSource = ctx2;
ctxDestination = ctx1;
@@ -4678,6 +4695,13 @@
}
server2.updateAdsPropertiesWithServerProperties();
registerServer(adsCtx1, server2.getAdsProperties());
+ Set<Map<ADSContext.ServerProperty, Object>> registry1 =
+ adsCtx1.readServerRegistry();
+ if (!ADSContext.isRegistered(server1, registry1))
+ {
+ server1.updateAdsPropertiesWithServerProperties();
+ registerServer(adsCtx1, server1.getAdsProperties());
+ }
ctxSource = ctx1;
ctxDestination = ctx2;
@@ -5247,7 +5271,7 @@
// contents of the ADS.
try
{
- Thread.sleep(2000);
+ Thread.sleep(5000);
}
catch (Throwable t)
{
--
Gitblit v1.10.0