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

Jean-Noel Rouvignac
23.06.2015 dc02a21390ac3b24e2eaa2505c823a33fd3eee07
refs
author Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Tuesday, June 23, 2015 10:06 +0200
committer Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Tuesday, June 23, 2015 10:06 +0200
commitdc02a21390ac3b24e2eaa2505c823a33fd3eee07
tree 32e989fe53c59786ab91985cbea82de165f2b759 tree | zip | gz
parent 3794b2a11e287845176b0a4b849725af2d992019 view | diff
OPENDJ-2141 (CR-7337) Cannot find entry in cn=changelog when searching with changelogCookie filter

Joint effort with Nicolas Capponi. Follow up of preparatory refactoring in r12534.

The problem lies in ChangelogCookie.initializeCookieForChangeNumberMode(). Here, the cookie is correctly initialized for the starting change number index record, but incorrectly for all the other replicas. The effect is that other replicas are incorrectly cursoring from the beginning of the replicaDB rather than the change immediately preceding the change number index record.
The fix is to make all replicaDBs cursor from the change immediately preceding the change number index record.


ChangelogBackend.java:
Added updateCookieToMediumConsistencyPoint() method to initialize a cookie from a ECLMultiDomainDBCursor.


ECLMultiDomainDBCursor.java:
Removed badly implemented methods getSnapshot(), toCookie() which returned the wrong result.

CompositeDBCursor.java
Removed badly implemented method getSnapshot() which returned the wrong result.
In cursors comparator, ensured more consistent ordering when the CSNs are equal.

ChangeNumberIndexer.java:
Added cookie field to replace the use of ECLMultiDomainDBCursor.toCookie().
Reimplemented initializeNextChangeCursor(), by calling ChangelogBackend.updateUpTo() + removed getCookieInitializedWithNewestCSN().


FileChangelogDB.java, JEChangelogDB.java:
In getCursorFrom(baseDN, serverId, startCSN, options), catered for the case where the provided startCSN does not come from this serverId.

FileReplicaDB.java, JEReplicaDB.java:
In generateCursorFrom(), catered for the case where the provided startCSN does not come from this serverId.
8 files modified
242 ■■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/backends/ChangelogBackend.java 60 ●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/ChangeNumberIndexer.java 40 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/CompositeDBCursor.java 66 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/ECLMultiDomainDBCursor.java 51 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/FileChangelogDB.java 5 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/FileReplicaDB.java 7 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/je/JEChangelogDB.java 6 ●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/je/JEReplicaDB.java 7 ●●●●● diff | view | raw | blame | history