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

pgamba
13.14.2008 b3c070bb2107aec085fa3f16ba1c118a71e30a7b
refs
author pgamba <pgamba@localhost>
Wednesday, February 13, 2008 10:14 +0100
committer pgamba <pgamba@localhost>
Wednesday, February 13, 2008 10:14 +0100
commitb3c070bb2107aec085fa3f16ba1c118a71e30a7b
tree ed3732f25753ba20163cfc3aec1a1792d5a46365 tree | zip | gz
parent 7c3be53eb192e08786165c9cc573ce0a5fab4116 view | diff
Fix 2911 - dsreplication pre/post-external initialisation fails to clear all the changelogs

The following changes fixes the fact that the 'server-state' information, visible under cn=monitor, is erroneous (not updated) when an OpenDS instance starts and there were some changes done on the topology while
this server was stopped. This bug can always be seen when running the scenario to reproduce #Issue 2911.

This issue comes from the fact that, at start time, the main thread creates and start the ReplicationDomain thread, that itself creates and starts the replication listener threads.
Then the listener thread start receiving some updates, and the replay thread start replaying them.
While, with a race condition, in the main thread, the multimaster replication registers the post op plugin of the replication.
So the first operations are successfully replayed but the necessary replication post op plugin is not called by the core server and the server-state is not updated.

To fix properly that issue, we need to wait for the Replication Master Synchro provider to be successfully registered in the core, before starting listening for the replication updates. So a new method called
'completeSynchronizationProvider()' (any better proposal is welcome) is added to the SynchronizationProvider API for that purpose.

A side effect is that a ReplicationDomain must now be started after creation. Some replication tests, that create ReplicationDomain on the fly, are also fixed here.

6 files modified
49 ■■■■ changed files
opends/src/server/org/opends/server/api/SynchronizationProvider.java 11 ●●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/core/DirectoryServer.java 2 ●●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/replication/plugin/MultimasterReplication.java 27 ●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/replication/plugin/ReplicationDomain.java 4 ●●● diff | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/DependencyTest.java 4 ●●●● diff | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/ReplicationServerFailoverTest.java 1 ●●●● diff | view | raw | blame | history