Fixed a readWriteLock deadlock happening on calling ChangelogDB.removeDB() which then calls ReplicationDB.shutdown().
Code is blocked acquiring a writeLock on the dbCloseLock, but a readLock is never unlocked.
Debugging showed that the ChangeNumberIndexDB is holding a cursor on a ReplicationDB, said cursor holds the readLock.
The solution is to not try to call ReplicationDB.shutdown() in ReplicationServerDomain.shutdownDomain() because it will be closed by JEChangelogDB.shutdownDB().
ReplicationServerDomain.java:
Removed the call to ReplicationDB.shutdownDomain(DN).
ReplicationDomainDB.java, JEChangelogDB.java:
Removed shutdownDomain(DN) which was never used outside of a complete shutdown of the ReplicationServer.
Inlined innerShutdownDomain().
JEReplicaDBCursor.java:
In next(), extracted a local variable to protect against a concurrent update to the cursor field.