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.