opends/src/server/org/opends/server/replication/server/ReplicationServer.java
@@ -43,6 +43,7 @@ import java.io.StringReader; import java.net.*; import java.util.*; import java.util.concurrent.CopyOnWriteArraySet; import org.opends.messages.Category; import org.opends.messages.Message; @@ -165,8 +166,9 @@ private ECLWorkflowElement eclwe; private WorkflowImpl externalChangeLogWorkflowImpl = null; // FIXME: why is this a set of ports? Do we claim to support multiple ports? private static HashSet<Integer> localPorts = new HashSet<Integer>(); // This is required for unit testing, so that we can keep track of all the // replication servers which are running in the VM. private static Set<Integer> localPorts = new CopyOnWriteArraySet<Integer>(); // Monitors for synchronizing domain creation with the connect thread. private final Object domainTicketLock = new Object(); opends/src/server/org/opends/server/replication/service/ReplicationBroker.java
@@ -1819,6 +1819,11 @@ private static Map<Integer, ReplicationServerInfo> filterServersOnSameHost( Map<Integer, ReplicationServerInfo> bestServers) { /* * Initially look for all servers on the same host. If we find one in the * same VM, then narrow the search. */ boolean filterServersInSameVM = false; Map<Integer, ReplicationServerInfo> result = new HashMap<Integer, ReplicationServerInfo>(); for (Integer rsId : bestServers.keySet()) @@ -1835,13 +1840,21 @@ if (isLocalReplicationServerPort(port)) { // An RS in the same VM will always have priority. if (!filterServersInSameVM) { // Narrow the search to only include servers in this VM. result.clear(); filterServersInSameVM = true; } result.put(rsId, replicationServerInfo); break; } else if (!filterServersInSameVM) { result.put(rsId, replicationServerInfo); } else { result.put(rsId, replicationServerInfo); // Skip: we have found some RSs in the same VM, but this RS is not. } } }