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

Jean-Noel Rouvignac
31.40.2014 90506e9b23401358f100dafdd684938d9b274393
refs
author Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Monday, March 31, 2014 11:40 +0200
committer Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Monday, March 31, 2014 11:40 +0200
commit90506e9b23401358f100dafdd684938d9b274393
tree e8ab90655e1d624e022a0a103bd16d893a174c46 tree | zip | gz
parent ae57abea41b1a1c805fee27ffcfeabc0ae07e969 view | diff
OPENDJ-1177 Re-implement changelog purging logic

Code review: Matthew Swift

Code fix after r10601.
Several problems shown by continuous integration:
* Deadlocks,
* Long waits

JEReplicaDB.java:
In clear(), calling collectAllPermits() while holding the flushLock actually prevented flushing to happen because it also needed the flushLock. Calling collectAllPermits() does not require to hold the flushLock, and once this method returns the msgQueue should be empty anyway and all the changes should have been pushed to the DB (flush() first removes messages from msgQueue, then add to DB, then releases all permits). In effect, there is no need to synchronize on flushLock anymore.
In trim(), the check for queue being below low mark was wrong (comparing queue size with number of bytes): extracted isQueueAboveLowMark() and fixed its definition + removed synchronized (flushLock) because it is now deemed unnecessary.
In generateCursorFrom(), Removed unnecessary call to flush() because that method is also called from JEReplicaDBCursor ctor.
1 files modified
117 ■■■■ changed files
opends/src/server/org/opends/server/replication/server/changelog/je/JEReplicaDB.java 117 ●●●● diff | view | raw | blame | history