Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash when replicating orphaned tombstone entry #298

Closed
389-ds-bot opened this issue Sep 12, 2020 · 15 comments
Closed

crash when replicating orphaned tombstone entry #298

389-ds-bot opened this issue Sep 12, 2020 · 15 comments
Labels
closed: fixed Migration flag - Issue
Milestone

Comments

@389-ds-bot
Copy link

Cloned from Pagure issue: https://pagure.io/389-ds-base/issue/298


seems to be related to orphan tombstone entries - not sure if it is the tombstone entry that is being replicated, or if it is attempting to urp with the tombstone entry on the consumer side

@389-ds-bot 389-ds-bot added the closed: fixed Migration flag - Issue label Sep 12, 2020
@389-ds-bot 389-ds-bot added this to the 1.2.10.2 milestone Sep 12, 2020
@389-ds-bot
Copy link
Author

Comment from rmeggins (@richm) at 2012-02-16 02:44:57

stack of the crashed thread
389stacktrace.txt

@389-ds-bot
Copy link
Author

Comment from rmeggins (@richm) at 2012-02-16 02:47:11

This is an example of an orphaned entry:

rdn: nsuniqueid=cb711181-397411e1-8d5b8e63-25f4fc76,cn=KDC
nsUniqueId: cb711181-397411e1-8d5b8e63-25f4fc76
objectClass;vucsn-4f08b6eb000200150000: nsContainer
objectClass;vucsn-4f08b6eb000200150000: ipaConfigObject
objectClass;vucsn-4f08b6eb000200150000: top
objectClass;vucsn-4f10d589002500040000: nsTombstone
ipaConfigString;vucsn-4f08b6eb000200150000: enabledService
ipaConfigString;vucsn-4f08b6eb000200150000: startOrder 10
cn;vucsn-4f08b6eb000200150000;mdcsn-4f08b6eb000200150000: KDC
creatorsName;vucsn-4f08b6eb000200150000: cn=directory manager
modifiersName;vucsn-4f08b6eb000200150000: cn=directory manager
createTimestamp;vucsn-4f08b6eb000200150000: 20120107211605Z
modifyTimestamp;vucsn-4f08b6eb000200150000: 20120107211605Z
parentid: 7385
entryid: 7390
entryusn: 1005398
nsParentUniqueId: 86e57683-397411e1-8d5b8e63-25f4fc76
nscpEntryDN: cn=kdc,cn=fqdn.domain.tld,cn=masters,cn=ipa,cn=etc,dc=domain,dc=tld

The id 7385 does not exist in the database. Neither 7390 nor 7385 were in the entryrdn index.

@389-ds-bot
Copy link
Author

Comment from nhosoi (@nhosoi) at 2012-02-18 05:53:12

output from valgrind
valgrind.out.txt

@389-ds-bot
Copy link
Author

Comment from nhosoi (@nhosoi) at 2012-02-18 05:55:36

The main reason of the crash looks the way how urp_fixup_add_entry passes the to-be-added entry to slapi_add_entry_internal_set_pb. The entry is consumed in the add operation, but the urp continues accessing it.

@389-ds-bot
Copy link
Author

@389-ds-bot
Copy link
Author

Comment from nhosoi (@nhosoi) at 2012-02-18 07:11:01

Fix description:

  1. The cause of the crash was freeing a to-be-added entry in
    tombstone_to_glue although the entry is consumed in
    slapi_add_entry_internal_set_pb/slapi_add_internal_pb.
    This patch removes the redundant slapi_entry_free from
    tombstone_to_glue.
  2. Introducing is_suffix_dn_ext to pass is_tombstone flag
    for getting the proper parent sdn of a tombstoned entry.
  3. Logic handling ancestor tombstone was broken.
    In _entryrdn_insert_key, if _entryrdn_get_tombstone_elem finds
    a child node, it was checking if the node is a tombstone or
    not immediately. It should have been done in the next loop.
  4. Reducing repeated "WARNING: bad entry: ID ##" messages.

@389-ds-bot
Copy link
Author

Comment from nhosoi (@nhosoi) at 2012-02-22 00:10:37

Reviewed by Rich (Thank you!!!)

Pushed to master.

$ git checkout master
Switched to branch 'master'
[nhosoi@kiki ldapserver 1964]$ git merge 298
Updating 85d44fc..2e5ee4d
Fast-forward
ldap/servers/plugins/replication/urp.c | 13 +++++--
ldap/servers/plugins/replication/urp.h | 1 +
ldap/servers/plugins/replication/urp_tombstone.c | 3 +-
ldap/servers/slapd/add.c | 13 ++++---
ldap/servers/slapd/back-ldbm/import-threads.c | 4 +-
ldap/servers/slapd/back-ldbm/import.c | 11 +++---
ldap/servers/slapd/back-ldbm/import.h | 11 ++++--
ldap/servers/slapd/back-ldbm/ldbm_add.c | 3 +-
ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c | 43 ++++++++--------------
ldap/servers/slapd/back-ldbm/ldif2ldbm.c | 4 ++-
10 files changed, 53 insertions(+), 53 deletions(-)

$ git push
Counting objects: 35, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (18/18), done.
Writing objects: 100% (18/18), 2.68 KiB, done.
Total 18 (delta 16), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
85d44fc..2e5ee4d master -> master

@389-ds-bot
Copy link
Author

Comment from nhosoi (@nhosoi) at 2012-02-22 00:21:36

Cherry-picked and pushed to 389-ds-base-1.2.10, as well.

$ git cherry-pick 2e5ee4d
[ds1210 214b58a] Trac Ticket 298 - crash when replicating orphaned tombstone entry
10 files changed, 53 insertions(+), 53 deletions(-)

$ git push origin ds1210:389-ds-base-1.2.10
Counting objects: 35, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (18/18), done.
Writing objects: 100% (18/18), 2.70 KiB, done.
Total 18 (delta 16), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
f676eb1..d7e1c25 ds1210 -> 389-ds-base-1.2.10

@389-ds-bot
Copy link
Author

Comment from nhosoi (@nhosoi) at 2012-02-22 00:22:45

Note: test case is automated.

@389-ds-bot
Copy link
Author

Comment from rmeggins (@richm) at 2012-02-23 05:56:06

commit changeset:6939b2d3b0db4bd5abea981217e539179be228a8/389-ds-base
Author: Rich Megginson richm@redhat.com
Date: Wed Feb 22 16:26:05 2012 -0700
Fix description: The previous fix for
4. Reducing repeated "WARNING: bad entry: ID ##" messages.
introduced a regression that caused the import to crash. This fixes
the crash by restoring the bad entry ID logic.
Reviewed by: nhosoi (Thanks!)

@389-ds-bot
Copy link
Author

Comment from rmeggins (@richm) at 2012-02-23 21:53:31

commit changeset:48ba947361c9995832d2157aa3e4bab32b5376d5/389-ds-base
Author: Rich Megginson richm@redhat.com
Date: Wed Feb 22 16:26:05 2012 -0700
1.2.10 branch

@389-ds-bot
Copy link
Author

Comment from rmeggins (@richm) at 2012-02-23 21:56:23

commit changeset:d7e1c25b9543965c50a5c09d2271cd4068149d56/389-ds-base
Author: Noriko Hosoi nhosoi@redhat.com
Date: Tue Feb 21 10:17:00 2012 -0800
1.2.10 branch
(cherry picked from commit changeset:2e5ee4d10c24f7d102fc7461f23f77ac631dc507/389-ds-base)

@389-ds-bot
Copy link
Author

Comment from rmeggins (@richm) at 2012-02-23 21:59:48

Ticket has been cloned to Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=796770

@389-ds-bot
Copy link
Author

Comment from nkinder (@nkinder) at 2012-08-28 04:14:40

Added initial screened field value.

@389-ds-bot
Copy link
Author

Comment from nhosoi (@nhosoi) at 2017-02-11 22:58:08

Metadata Update from @nhosoi:

  • Issue assigned to nhosoi
  • Issue set to the milestone: 1.2.10.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: fixed Migration flag - Issue
Projects
None yet
Development

No branches or pull requests

1 participant