Separate Conflict and Tombstone Entry


Entry format

conflict entry:

   Current format

   dn: nsuniqueid=<UNIQID>+<RDN>,<PARENTDN>
   <attr>: <value>
   [...]    
   nsds5ReplConflict: namingConflict <DN>

   proposing format (internal; Slapi_Entry)
   dn: <RDN>,<PARENTDN>
   objectclass: nsConflict    
   <attr>: <value>
   [...]    
   nsdsEntryType: 1    
   nsds5ReplConflict: namingConflict <DN>

   proposing format (external; search result/exported)
   dn: nsuniqueid=<UNIQID>+<RDN>,<PARENTDN>
   objectclass: nsConflict    
   <attr>: <value>
   [...]    
   nsdsEntryType: 1    
   nsds5ReplConflict: namingConflict <DN>     

tombstone entry:

   current format
   dn: nsuniqueid=<UNIQID>,<RDN>,<PARENTDN>
   objectclass: nsTombstone    
   <attr>: <value>
   [...]    

   proposing format (internal; Slapi_Entry)
   dn: <RDN>,<PARENTDN>
   objectclass: nsTombstone    
   <attr>: <value>
   [...]    
   nsdsEntryType: 2    

   proposing format (external; search result/exported)
   dn: nsuniqueid=<UNIQID>,<RDN>,<PARENTDN>
   objectclass: nsTombstone    
   <attr>: <value>
   [...]    
   nsdsEntryType: 2    

ordinary entry (no changes):

   dn: <RDN>,<PARENTDN>
   <attr>: <value>
   [...]    

Goal

General

The system attribute nsdsEntryType is single-valued and integer. The motivation to have this system attribute is speeding up the entry type checking especially for the search-all “(objectclass=*)” case. We have the type info in the objectclass with the string value “nsConflict/nsTombstone”. But checking the type using the string would be much slower than checking the integer value.

case 1   BaseDN: ”nsuniqueid=+,  Filter: (&(objectclass=nsConflict)(nsuniqueid=))  case 2  BaseDN: ”,  Filter: (&(objectclass=nsConflict)(nsuniqueid=))  Returned DN  nsuniqueid=+,PARENTDN>RDN>UNIQID>PARENTDN>RDN>PARENTDN>RDN>UNIQID>

Add conflict entry

Delete entry/Add tombstone entry

Export

If ‘-r’ is added to the command line, conflict / tombstone entries are exported. The DN contains the special “nsuniqueid=”.UNIQID>

Import

Support the current ldif (no objectClass: nsConflict; no nsdsEntryType) as well as the new ldif.

Resurrection steps users take

Upgrade

entrydn support

By setting “nsslapd-subtree-rename-switch: off” in cn=config, we could go back to the entrydn indexing. We have to introduce extra index files: conflict_entrydn and tombstone_entrydn, as well.

Internal format

To support the multiple conflict / tombstone entries having the same original DN, we allow entries having the same RDN and parentid in id2entry. (Note: the conflict / tombstone entries only)

   dbscan -f id2entry.db output    
   id N    
       rdn: <RDN>
       nsuniqueid: <UNIQID_N>
       parentid: M    
       entryid: N    

   id N+1    
       rdn: <RDN>
       nsuniqueid: <UNIQID_N+1>
       parentid: M    
       entryid: N+1    

Plus conflict_/tombstone_entryrdn should be able to store a list of entryids instead of one. (Again, this is only for the conflict/tombstone entries.)

Another approach to use the special suffix: The following change could be considered

   conflict entry
   dn: <RDN>,<PARENTDN>,<CONFLICTSUFFIX>
   objectclass: nsConflict    
   <attr>: <value>
   [...]    
   entrytype: 1    

   tombstone entry
   dn: <RDN>,<PARENTDN>,<TOMBSTONESUFFIX>
   objectclass: nsTombstone    
   <attr>: <value>
   [...]    
   entrytype: 2    

   Comments on this approach

Ticket #160 – Make replication plugin put conflicts and tombstones in a special suffix Bug 695797 - Invalid host record created during client enrollment with failover Bug 747701 - [RFE] Make replication plugin put conflicts in a special suffix Bug 772294 - Replication conflicts resolution

Last modified on 29 November 2024