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

Jean-Noel Rouvignac
29.57.2015 baedb69fcb97c58e201601347f5ec8df0fe00560
refs
author Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Monday, June 29, 2015 10:57 +0200
committer Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Monday, June 29, 2015 10:57 +0200
commitbaedb69fcb97c58e201601347f5ec8df0fe00560
tree 83bd55041de5c729a015202ddb10a996ed77f707 tree | zip | gz
parent 574eb0d27a54c4f3a98c8f8b569b436e4fba3d43 view | diff
OPENDJ-2179 (CR-7413) ECL: full resync step is no longer valid



This was found due to one functional test that was working with 2.6 code base, but no longer works with 2.8.

Here is the sequence of events:

time1 change 1 => changenumber=1, changelogcookie=dc=com:csn1;
time2 ldapsearch (changenumber=1) returns entry with changenumber=1 and changelogcookie=dc=com:csn1;
time3 enable domain dc=fr
time4 change 2 => changenumber=2, changelogcookie=dc=com:csn1;dc=fr:csn2;

2.6:
time5 ldapsearch (changenumber=1) returns entry with changenumber=1 and changelogcookie=dc=com:csn1;dc=fr;
time6 ldapsearch (changelogcookie=dc=com:csn1;) resultcode=UNWILLING_TO_PERFORM message=Full resynch is required...[...]...use dc=com:csn1;dc=fr;
time6 ldapsearch (changelogcookie=dc=com:csn1;dc=fr;) resultcode=SUCCESS returns changes with csn1 and csn2

2.8:
time5 ldapsearch (changenumber=1) returns entry with changenumber=1 and changelogcookie=dc=com:csn1;
time6 ldapsearch (changelogcookie=dc=com:csn1;) resultcode=UNWILLING_TO_PERFORM message=Full resynch is required...[...]...use dc=com:csn1;dc=fr;
time6 ldapsearch (changelogcookie=dc=com:csn1;dc=fr;) resultcode=SUCCESS returns changes with csn1 and csn2

Note the different values for changelogcookie attribute at time4.

I think this difference is due to the fact the change number index DB was storing the previous cookie (thus returning it), while the new change number index DB is not storing it anymore (thus building it on the fly). So the new domain baseDN cannot be included until one change has been seen for it.

I think this error message was originally added as the result of a leaky abstraction: In 2.6, doing a search in the cookie mode was driven by the cookie provided by the user. So when a search was performed using a cookie that did not have all domains, no results would be returned for the missing domains. Hence this restriction was added to force users to iterate over all the domains.

With the new changelog implementation, all domains are iterated by default and this restriction is no longer necessary.

By removing this limitation here is how the results would compare:

time1 change 1 => changenumber=1, changelogcookie=dc=com:csn1;
time2 ldapsearch (changenumber=1) returns entry with changenumber=1 and changelogcookie=dc=com:csn1;
time3 enable domain dc=fr
time4 change 2 => changenumber=2, changelogcookie=dc=com:csn1;dc=fr:csn2;

2.6:
time5 ldapsearch (changenumber=1) returns entry with changenumber=1 and changelogcookie=dc=com:csn1;dc=fr;
time6 ldapsearch (changelogcookie=dc=com:csn1;) resultcode=UNWILLING_TO_PERFORM message=Full resynch is required...[...]...use dc=com:csn1;dc=fr;
time6 ldapsearch (changelogcookie=dc=com:csn1;dc=fr;) resultcode=SUCCESS returns changes with csn1 and csn2

2.8:
time5 ldapsearch (changenumber=1) returns entry with changenumber=1 and changelogcookie=dc=com:csn1;
time6 ldapsearch (changelogcookie=dc=com:csn1;) resultcode=SUCCESS returns changes with csn1 and csn2



ReplicationServer.java:
Removed error ERR_RESYNC_REQUIRED_MISSING_DOMAIN_IN_PROVIDED_COOKIE, no longer necessary with the new changelog implementation.
8 files modified
56 ■■■■■ changed files
opendj-sdk/opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationServer.java 40 ●●●●● diff | view | raw | blame | history
opendj-sdk/opendj-server-legacy/src/messages/org/opends/messages/replication.properties 4 ●●●● diff | view | raw | blame | history
opendj-sdk/opendj-server-legacy/src/messages/org/opends/messages/replication_de.properties 1 ●●●● diff | view | raw | blame | history
opendj-sdk/opendj-server-legacy/src/messages/org/opends/messages/replication_es.properties 1 ●●●● diff | view | raw | blame | history
opendj-sdk/opendj-server-legacy/src/messages/org/opends/messages/replication_fr.properties 1 ●●●● diff | view | raw | blame | history
opendj-sdk/opendj-server-legacy/src/messages/org/opends/messages/replication_ja.properties 1 ●●●● diff | view | raw | blame | history
opendj-sdk/opendj-server-legacy/src/messages/org/opends/messages/replication_zh_CN.properties 1 ●●●● diff | view | raw | blame | history
opendj-sdk/opendj-server-legacy/src/test/java/org/opends/server/backends/ChangelogBackendTestCase.java 7 ●●●●● diff | view | raw | blame | history