Skip to content

Commit

Permalink
Ticket #47737 - Under heavy stress, failure of turning a tombstone in…
Browse files Browse the repository at this point in the history
…to glue makes the server hung

Description: Turning a tombstone entry to a glue entry is done in a
while loop (create_glue_entry:urp_glue.c) Unless the transformation
is successful (or LDAP_NO_SUCH_OBJECT), it cannot exit from the loop.
But under a stress, there could be a tombstone and a conflict entry
coexist, and do_create_glue_entry keeps returning LDAP_ALREADY_EXISTS.
In such a case, we need to give up creating a glue.

https://fedorahosted.org/389/ticket/47737

Reviewed by rmeggins@redhat.com (Thank you, Rich!)
(cherry picked from commit a84dab5)
(cherry picked from commit 97fa6d2)
(cherry picked from commit b92eb1a)
  • Loading branch information
nhosoi committed Mar 9, 2014
1 parent e1f92c0 commit 2786adb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ldap/servers/plugins/replication/urp_glue.c
Expand Up @@ -169,7 +169,6 @@ do_create_glue_entry(const Slapi_RDN *rdn, const Slapi_DN *superiordn, const cha
sdn = slapi_sdn_new_dn_byval(slapi_sdn_get_ndn(superiordn));
slapi_sdn_add_rdn(sdn,rdn);


/* must take care of multi-valued rdn: split rdn into different lines introducing
* '\n' between each type/value pair.
*/
Expand All @@ -187,8 +186,7 @@ do_create_glue_entry(const Slapi_RDN *rdn, const Slapi_DN *superiordn, const cha
rdnstr = slapi_ch_realloc(rdnstr, alloc_len);
rdnpair = &rdnstr[rdnstr_len];
}
slapi_ldif_put_type_and_value_with_options(&rdnpair, rdntype,
rdnval, rdnval_len, LDIF_OPT_NOWRAP);
slapi_ldif_put_type_and_value_with_options(&rdnpair, rdntype, rdnval, rdnval_len, LDIF_OPT_NOWRAP);
*rdnpair = '\0';
}
estr= slapi_ch_smprintf(glue_entry, slapi_sdn_get_ndn(sdn), rdnstr, uniqueid,
Expand Down Expand Up @@ -247,6 +245,12 @@ create_glue_entry ( Slapi_PBlock *pb, char *sessionid, Slapi_DN *dn, const char
sessionid, dnstr, uniqueid);
done= 1;
break;
case LDAP_ALREADY_EXISTS:
slapi_log_error ( SLAPI_LOG_FATAL, repl_plugin_name,
"%s: Skipped creating glue entry %s uniqueid=%s reason Entry Already Exists\n",
sessionid, dnstr, uniqueid);
done= 1;
break;
case LDAP_NO_SUCH_OBJECT:
/* The parent is missing */
{
Expand Down

0 comments on commit 2786adb

Please sign in to comment.