dc02a21390ac3b24e2eaa2505c823a33fd3eee07 |
|
23-Jun-2015 |
Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com> |
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. |