OPENDJ-1174 Transfer responsibility for populating the ChangeNumberIndexDB to ChangelogDB
Code review: Matthew Swift
Fixing failing unit tests, removed the following stack trace which makes test and code fail.
[testng] Failed Test: org.opends.server.replication.plugin.HistoricalCsnOrderingTest#buildAndPublishMissingChangesSeveralEntriesTest
[testng] Failure Cause: com.sleepycat.je.ThreadInterruptedException: (JE 5.0.97) Environment must be closed, caused by: com.sleepycat.je.ThreadInterruptedException: Environment invalid because of previous exception: (JE 5.0.97) <https://builds.forgerock.org/job/OpenDJ%20-%20trunk%20-%20postcommit/ws/build/unit-tests/package-instance/HistoricalCsnOrdering> Thread interrupted prior to logging the commit THREAD_INTERRUPTED: InterruptedException may cause incorrect internal state, unable to continue. Environment is invalid and must be closed.
[testng] com.sleepycat.je.ThreadInterruptedException.wrapSelf(ThreadInterruptedException.java:99)
[testng] com.sleepycat.je.dbi.EnvironmentImpl.checkIfInvalid(EnvironmentImpl.java:1594)
[testng] com.sleepycat.je.Database.checkEnv(Database.java:2154)
[testng] com.sleepycat.je.Database.getDatabaseName(Database.java:1939)
[testng] org.opends.server.replication.server.changelog.je.ReplicationDbEnv.closeDB(ReplicationDbEnv.java:457)
[testng] org.opends.server.replication.server.changelog.je.ReplicationDbEnv.shutdown(ReplicationDbEnv.java:435)
[testng] org.opends.server.replication.server.changelog.je.JEChangelogDB.shutdownDB(JEChangelogDB.java:409)
[testng] org.opends.server.replication.server.ReplicationServer.shutdown(ReplicationServer.java:702)
[testng] org.opends.server.replication.server.ReplicationServer.remove(ReplicationServer.java:1028)
[testng] org.opends.server.replication.plugin.HistoricalCsnOrderingTest.buildAndPublishMissingChangesSeveralEntriesTest(HistoricalCsnOrderingTest.java:308)
DirectoryThread.java:
In initiateShutdown(), removed the call to Thread.interrupt() added in r9911.
ChangeNumberIndexer.java:
Overrode initiateShutdown() to stop this thread on shutdown: used notify() to wake up the thread if it was waiting.
In run(), checked whether shutdown has been initiated for this thread before calling wait(): this protects against missed notifications.
JEReplicaDB.java:
In run(), removed call to Thread.currentThread().interrupt().