Trac Ticket 2 - If node entries are tombstone'd,
subordinate entries fail to get the full DN.
https://fedorahosted.org/389/ticket/2
Related Bugs:
Bug 736431 - parent tombstone entry could be reaped even if its child
tombstone entries still exist
Bug 767024 - MMR: when a subtree is deleted and the backend is exported
with -r, importing the ldif fails
Fix Descriptions:
- The key format of entryrdn index has been modified to allow traversing
tombstoned node entries.
old key format:
[PC]entryID: <rdn> (nsuniqueid=<UNIQUEID>,<rdn>)
new key format:
[PC]entryID
To traverse the DIT on entryrdn, rdn's are not needed. Just using
entryID should work. Also, the rdn strings are stored in the entryrdn
value. Thus, this key format change eliminates the redundancy.
The main motivation of the change: a tombstone entry has a DN format
"nsuniqueid=<UNIQUEID>,<original_dn>". If any of the ancestor entries
of the tombstone entry were trying to get the full DN using entryrdn,
there was no way to figure out the node's nsuniqueid from the leaf DN.
That is, once an entire subtree was deleted, the leaf entries lost the
ability to get the full DN using the entryrdn index. This fix makes
entryrdn to regain it.
- Once an entry has become a tombstone entry, ordinary operation such
as search does not expect the entry is returned. But it is needed
when reaping the tombstone entries. To support the 2 conflicting
requirements, a flag TOMBSTONE_INCLUDED is added. Passing the flag
to dn2entry_ext, it returns the tombstoned entry.
Also, there could be an entry which rdn attribute is nsuniqueid,
but is not a tombstone entry. To support such a case, a set of
new get parent APIs, which take a flag ls_tombstone to switch
between the 2 behaviors.
slapi_dn_find_parent_ext
slapi_dn_parent_ext
slapi_sdn_get_parent_ext
slapi_sdn_get_backend_parent_ext
- Introduced a system attribute tombstoneNumSubordinates to hold the
subordinate count of the tombstone'd node. Once a normal entry is
turned to be a tombstone entry, it loses the numSubordinates attribute.
The attribute value is used to determine the normal entry is a leaf
or a node. The analogous knowledge is necessary to determine if the
tomb stone entry can be reaped or not. TombstoneNumSubordinates has
been introduced to fulfill the goal. As long as the tombstoneNum-
subordinates value is not 0, the tombstone entry won't be reaped.
The tombstoneNumsubordinates attribute value pair is added/modified
when the child entries are deleted (note: child entries never be
added since we don't allow to add a subordinate entry to a tombstone
entry). Also, when an ldif file which contains tombstone entries
is imported, the tombstoneNumSubordinates value is added to a tomb-
stone node entry in the same way as the numSubordinates is to a normal
node entry. To support the new behavior, parentid index is now main-
tained for the tombstone entries, as well.
- Added an upgrade script: 91subtreereindex.pl to reformat entryrdn
index file.
- To check the upgrade is needed or not, introduced BDB_RDNFORMAT_VERSION:
The current version is 1.
bdb/4.8/libback-ldbm/newidl/rdn-format-1/dn-4514
- Modified an upgrade script 81changelog.pl to force to remove the
unnecessary changelog related files.