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

Jean-Noel Rouvignac
19.11.2014 355365ea3f95fdfec5cac95588044b91354096c8
refs
author Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Tuesday, August 19, 2014 13:11 +0200
committer Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Tuesday, August 19, 2014 13:11 +0200
commit355365ea3f95fdfec5cac95588044b91354096c8
tree 77482aca65a6ebdc57b099a9c55ca8f644103be7 tree | zip | gz
parent f7c7451528a613beed5e8775610cc5bd8eb07041 view | diff
OPENDJ-1441 (CR-4303) Persistent searches on external changelog do not return changes for new replicas and new domains

Fixing a deadlock situation with ExternalChangeLogTest.
When removing domains, the cursors were not properly closed by ChangeNumberIndexer.run() before calling Object.wait().
Relied on the fact that DBCursors are not thread safe so if client code calls MultiDomainDBCursor.removeDomain(), then the cursor is immediately removed.
I did not see the problem before because unit tests on trunk execute by default with file based changelog db.


ChangeNumberIndexer.java:
In run(), simplified the code that removes the domain cursors.

CompositeDBCursor.java:
Removed removeNoLongerNeededCursors() and removedCursorsIterator() + extracted method removeCursor() from it.
Added another removeCursor() which also removes from the exhaustedCursors.

MultiDomainDBCursor.java
Consequence of the change to CompositeDBCursor.
Removed removeDomains field and removedCursorsIterator().
In removeDomain(), now call CompositeDBCursor.removeCursor().

DomainDBCursor.java:
Consequence of the change to CompositeDBCursor.
5 files modified
111 ■■■■■ changed files
opends/src/server/org/opends/server/replication/server/changelog/je/ChangeNumberIndexer.java 35 ●●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/changelog/je/CompositeDBCursor.java 45 ●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/changelog/je/DomainDBCursor.java 9 ●●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/changelog/je/MultiDomainDBCursor.java 13 ●●●●● diff | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/changelog/je/CompositeDBCursorTest.java 9 ●●●●● diff | view | raw | blame | history