mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
06.51.2013 b161a27ed6c0b7d72b241e9990f9917c1ca9c0ac
refs
author Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Wednesday, November 6, 2013 16:51 +0100
committer Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Wednesday, November 6, 2013 16:51 +0100
commitb161a27ed6c0b7d72b241e9990f9917c1ca9c0ac
tree 270ddaffe142d7fdc36a6a9bf64547ca070c5cd1 tree | zip | gz
parent 59852bea543cdbb92fecb30ea3fff37e969fc7c5 view | diff
OPENDJ-1053 Improve logging of replication load balancing and fail-over in order to diagnose the causes of these events



Functional tests found a ConcurrentModificationException with r9753 (see at the end of the commit message):
The code was removing elements from a Collection while it was iterating on the exact same Collection.



ReplicationBroker.java:
In inner class LocalEvaluation:
- Renamed "filteredRSs" to "accepted".
- Added getAcceptedRSInfos() to allow iterating on them without triggering ConcurrentModificationException.
In rejectAll*(), called getAcceptedRSInfos().
In getCSN(), renamed parameters.

Fixed ConcurrentModificationException.

ComputeBestServerTest.java:
Added a test2ServersUpToDateAnd1EvenMoreUpToDate() to exhibit the ConcurrentModificationException.
Extracted method newServerState() and used it in all tests.
In all test methods but one, do not update the ServerState with unused CSNs because they make the tests harder to read. Did not change test3Servers() because I believe it is good to keep one test testing the unneded CSNs do not impact the test results.




java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793)
at java.util.HashMap$ValueIterator.next(HashMap.java:822)
at org.opends.server.replication.service.ReplicationBroker.rejectAllWithRSOnDifferentVMThanDS(ReplicationBroker.java:1908)
at org.opends.server.replication.service.ReplicationBroker.filterServersOnSameHost(ReplicationBroker.java:1878)
at org.opends.server.replication.service.ReplicationBroker.computeBestReplicationServer(ReplicationBroker.java:1600)
at org.opends.server.replication.service.ReplicationBroker.connectAsDataServer(ReplicationBroker.java:820)
at org.opends.server.replication.service.ReplicationBroker.connect(ReplicationBroker.java:691)
at org.opends.server.replication.service.ReplicationBroker.start(ReplicationBroker.java:221)
at org.opends.server.replication.service.ReplicationDomain.enableService(ReplicationDomain.java:3024)
at org.opends.server.replication.service.ReplicationDomain.changeConfig(ReplicationDomain.java:3054)
at org.opends.server.replication.plugin.LDAPReplicationDomain.applyConfigurationChange(LDAPReplicationDomain.java:4089)
at org.opends.server.replication.plugin.LDAPReplicationDomain.applyConfigurationChange(LDAPReplicationDomain.java:96)
at org.opends.server.admin.server.ServerManagedObjectChangeListenerAdaptor.applyConfigurationChange(ServerManagedObjectChangeListenerAdaptor.java:74)
at org.opends.server.admin.server.ConfigChangeListenerAdaptor.applyConfigurationChange(ConfigChangeListenerAdaptor.java:342)
at org.opends.server.extensions.ConfigFileHandler.replaceEntry(ConfigFileHandler.java:1610)
at org.opends.server.workflowelement.localbackend.LocalBackendModifyOperation.processModify(LocalBackendModifyOperation.java:599)
at org.opends.server.workflowelement.localbackend.LocalBackendModifyOperation.processLocalModify(LocalBackendModifyOperation.java:299)
at org.opends.server.workflowelement.localbackend.LocalBackendWorkflowElement.execute(LocalBackendWorkflowElement.java:690)
at org.opends.server.core.WorkflowImpl.execute(WorkflowImpl.java:197)
at org.opends.server.core.WorkflowTopologyNode.execute(WorkflowTopologyNode.java:100)
at org.opends.server.core.ModifyOperationBasis.run(ModifyOperationBasis.java:451)
at org.opends.server.core.SynchronousStrategy.enqueueRequest(SynchronousStrategy.java:49)
at org.opends.server.protocols.ldap.LDAPClientConnection.addOperationInProgress(LDAPClientConnection.java:1276)
at org.opends.server.protocols.ldap.LDAPClientConnection.processModifyRequest(LDAPClientConnection.java:2268)
at org.opends.server.protocols.ldap.LDAPClientConnection.processLDAPMessage(LDAPClientConnection.java:1745)
at org.opends.server.protocols.ldap.LDAPRequestHandler.run(LDAPRequestHandler.java:194)
2 files modified
299 ■■■■■ changed files
opends/src/server/org/opends/server/replication/service/ReplicationBroker.java 29 ●●●●● diff | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/service/ComputeBestServerTest.java 270 ●●●●● diff | view | raw | blame | history