4e70ab5 Ticket #48755 - moving an entry could make the online init fail

Authored and Committed by nhosoi 7 years ago
    Ticket #48755 - moving an entry could make the online init fail
    
    Bug Description: Online init (aka Total update, bulk import) scans the
    primary id2entry db in the order of ID.  If Entry A is moved under a
    new superior Entry B which was generated after Entry A, when Entry A
    is sent to a consumer using online init, its parent entry does not
    exist on the consumer and the online init fails.
    
    Fix Description:
    - Added a command BACK_INFO_IS_ENTRYRDN to slapi_back_get_info, which
      returns the status of entryrdn switch maintained in the backend.
    
    - If slapi_backend_get_info(BACK_INFO_IS_ENTRYRDN) returns true for
      the replicated backend, repl5_tot_run searches the entry with the
      filter:
        (|(parentid>=1)(objectclass=ldapsubentry)(objectclass=nstombstone))
      instead of:
        (|(objectclass=ldapsubentry)(objectclass=nstombstone)(nsuniqueid=*))".
    
    - In addition, idl_new_range_fetch had to be modified so that ...
      * A range search for parentid ignores nsslapd-idlistscanlimit by
        setting SLAPI_OP_RANGE_NO_ALLIDS as well as it skips sorting the
    	IDlist by ID by setting SLAPI_OP_RANGE_NO_IDL_SORT.
      * In case SLAPI_OP_RANGE_NO_IDL_SORT is set, idl_new_range_fetch
        checks whether the key (in this case parentid) is in the IDlist.
    	If it exists, the ID is appended.  If it does not, the ID is in
    	the leftover list and appended when the parent ID is found in the
    	IDlist.
    
    - Increased the version of rdn-format-# in DBVERSION to 3.
    
    - Upgrade script 91reindex.pl.in is added which reindex the parentid
      index file in the integer order if the version of rdn-format-# in
      DBVERSION is less than 3.
    
    https://fedorahosted.org/389/ticket/48755
    
    Reviewed by wibrown@redhat.com and lkrispen@redhat.com (Thanks, William and Ludwig!)
    
    (cherry picked from commit 3606b78bacce984ab2226755c5921dffac9552c2)
    
        
file modified
+2 -1
file modified
+2 -1
file modified
+2 -2
file modified
+4 -0