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

Jean-Noel Rouvignac
04.14.2014 26976832d0dc62a838dce055ca8b9e0cc5fb272a
refs
author Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Thursday, September 4, 2014 16:14 +0200
committer Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Thursday, September 4, 2014 16:14 +0200
commit26976832d0dc62a838dce055ca8b9e0cc5fb272a
tree 10d4cdb3fc69d2a5e2991cb036141fc21c630d91 tree | zip | gz
parent fdcf81df738c71f3cbbfff1272e79c5c4a98e3bb view | diff
OPENDJ-1540 (CR-4436) Persistent searches on cn=changelog with changesOnly=true should not return the base changelog entry

I did the following changes:

- Persistent searches on cn=changelog with changesOnly=true no longer return the base changelog entry
- Fixed a functional bug with setting hasSubordinates on the base changelog entry:
-- hasSubordinates must be computed regardless of the search parameters, result can also be cached in memory once and for all
- As a consequence, it means we can immediately return the base changelog entry for initial searches without even looking for any subordinate changelog entries.
- Fixed a race condition when registering persistent searches: first set the cookie in the attachments then register the persistent searches
- implementing numSubordinates() was not required and it might be buggy, so returned -1 instead.


ChangelogBackend.java:
In notifyEntryAdded() (a.k.a. persistent search phase), never return the base changelog entry.
Removed EntrySender and moved all its methods back into ChangelogBackend + stored the MultiDomainServerState cookie as an attachment of the SearchOperation.
Renamed search*() to internalSearch*().
In hasSubordinates(), reimplemented it in a more efficient way + added baseChangelogHasSubordinates() and baseEntryHasSubordinates field to memoize its result.
In numSubordinates(), is not required, so just returned -1 + removed NumSubordinatesSearchOperation.
In registerPersistentSearch(), register the persistent searches after setting the cookie attachment on the search operation
Completed javadocs.

In registerPersistentSearch(), forced changesOnly=true persistent searches to never return the changelog base entry.
Renamed Entry.hasReturnedBaseEntry field to mustReturnBaseEntry to fit the fact the changelog base entry might never be returned + inverted all the boolean expressions related to this field.
2 files modified
511 ■■■■ changed files
opendj-sdk/opends/src/messages/messages/replication.properties 4 ●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/ChangelogBackend.java 507 ●●●● diff | view | raw | blame | history