-sync_add_retry:
- op->o_tag = LDAP_REQ_MODIFY;
- op->orm_modlist = modlist;
- rc = be->be_modify( op, &rs );
- if ( rc != LDAP_SUCCESS ) {
- if ( rc == LDAP_REFERRAL ||
- rc == LDAP_NO_SUCH_OBJECT ||
- rc == DB_NOTFOUND ) {
- op->o_tag = LDAP_REQ_ADD;
- op->ora_e = e;
- rc = be->be_add( op, &rs );
- if ( rc != LDAP_SUCCESS ) {
- if ( rc == LDAP_ALREADY_EXISTS ) {
- goto sync_add_retry;
- } else if ( rc == LDAP_REFERRAL ||
- rc == LDAP_NO_SUCH_OBJECT ||
- rc == DB_NOTFOUND ) {
- syncrepl_add_glue(ld, op, e,
- modlist, syncstate,
- syncUUID, syncCookie);
- } else {
+
+ rc = LDAP_SUCCESS;
+
+ if ( si->syncUUID_ndn ) {
+ op->o_req_dn = *si->syncUUID_ndn;
+ op->o_req_ndn = *si->syncUUID_ndn;
+ op->o_tag = LDAP_REQ_DELETE;
+ rc = be->be_delete( op, &rs );
+ }
+
+ if ( rc == LDAP_SUCCESS ||
+ rc == LDAP_REFERRAL ||
+ rc == LDAP_NO_SUCH_OBJECT ||
+ rc == DB_NOTFOUND ) {
+ op->o_tag = LDAP_REQ_ADD;
+ op->ora_e = e;
+ op->o_req_dn = e->e_name;
+ op->o_req_ndn = e->e_nname;
+ rc = be->be_add( op, &rs );
+ if ( rc != LDAP_SUCCESS ) {
+ if ( rc == LDAP_ALREADY_EXISTS ) {