https://bugzilla.redhat.com/show_bug.cgi?id=612771
https://bugzilla.redhat.com/attachment.cgi?id=431626&action=diff
https://bugzilla.redhat.com/attachment.cgi?id=431626&action=edit
http://directory.fedoraproject.org/wiki/Upgrade_to_New_DN_Format#Another_...
Fix Description:
This patch fixes the upgradednformat utility to eliminate the
duplicated DNs found in the upgrading time. If DN: attr0=value0,
attr1=value1,...,attrn=valuen exists in the DB and identical DN
is found, the second DN is renamed to attr0=dup_value0,attr1=value1,
...,attrn=valuen. The modification is logged in the error log.
Detailed Change Description:
70upgradednformat.pl - replaced the server up/down checking code
with the conservative algorithm.
ancestorid.c - When creating a new ancestorid index file, changed
to truncate (initialize) the file.
back-ldbm.h - introduced a new macro DBOPEN_TRUNCATE to specify
the truncated db open (used for opening ancestorid)
introduced an error code LDBM_ERROR_FOUND_DUPDN to
represent the duplicated DN error.
dblayer.c - added a code to open a db file with the truncated
option (DB_TRUNCATE).
import-threads.c - instead of e_deleted_attrs, use e_aux_attrs
to stash attributes to delete in the worker
thread and/or entrydn and parentid foreman
function.
upgradedn_producer - for the UPGRADEDNFORMAT mode, use
obsolete dn normalizer to distinguish
the duplicated DNs.
foreman_do_parentid - in case parent& child relationship
has been updated in the upgradednformat,
takes care of the changes.
foreman_do_entrydn - if a duplicated DN is detected, return
the specific error code LDBM_ERROR_FOUND_DUPDN.
import_foreman - if received LDBM_ERROR_FOUND_DUPDN
from foreman_do_entrydn, replace the DN
to<leaf_attr>=dup_<leaf_value>,<rest> and
pass it to foreman_do_entrydn again.
- enabled the parentid index update
(foreman_do_parentid) for the
UPGRADEDNFORMAT case, too.
import.c - for the UPGRADEDNFORMAT mode, only indexes which
associates with the DN syntax attribute were
reindexed. CN and OU are added to the list.
import.h - added a macro IMPORT_ADD_OP_ATTRS_SAVE_OLD_PID to
specify the original parentid is stored in e_aux_attrs
before replaced with the new one, which is used in
foreman_do_parentid.
ldif2ldbm.c - add_op_attrs - if the macro IMPORT_ADD_OP_ATTRS_SAVE_OLD_PID
is passed, the parentid is set to e_aux_attrs.
ldbm_back_ldbm2index - initialized the local txn object.
dn.c - resurrected once dead old slapi_dn_normalize as
slapi_dn_normalize_original used in upgradedn_producer.
entry.c - create an entry using the obsolete dn normalizer
slapi_dn_normalize_original if
SLAPI_STR2ENTRY_USE_OBSOLETE_DNFORMAT flag is passed.
slap.h - introduced e_aux_attrs to Slapi_Entry
slapi-plugin.h - defined a macro SLAPI_STR2ENTRY_USE_OBSOLETE_DNFORMAT