The test case is the following: 1- Create M1-M2 2- Create an entry 3- Disable replication M1<-->M2 4- Delete the entry on M1 5- Modify the entry on M2 6- Enable replication
The MOD (5) fails when replicated on M1, so the test entry differs on M1 and M2. This is likely a side effect of Ticket 47396.
Test case attached
attachment ticket47787_test.py
attachment 0001-Ticket-47787-A-replicated-MOD-fails-Unwilling-to-per.patch
attachment 0001-Ticket-47787-test-case.patch
Ticket has been cloned to Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1092097
testing this fix with freeIPA unit tests (see https://fedorahosted.org/freeipa/ticket/4279#comment:6 for freeIPA tests)
those tests are immediately failing because of the need of 47721 so I need to cumulate the fixes
{{{ 85106f0 Ticket 47721 - Schema Replication Issue (follow up) 96ab39f Ticket 47721 - Schema Replication Issue (follow up + cleanup) 6ebea73 Ticket 47721 - Schema Replication Issue 30f47c5 Ticket 47676 : (cont.) Replication of the schema fails 'master branch' -> 1.2.11 or 1.3.1 9558f55 Ticket 47676 : Replication of the schema fails 'master branch' -> 1.2.11 or 1.3.1 0ba131b Ticket 47541 - Fix Jenkins errors adce8c6 Ticket 47541 - Replication of the schema may overwrite consumer 'attributetypes' even if consumer definition 0d344e3 Bump version 1.3.2.17 4799be9 Ticket 47787: A replicated MOD fails (Unwilling to perform) if it targets a tombstone
}}}
to do the test I backported the fixes in 1.3.2
I hit a hang the first time I ran the test. I do not know if the hang is systematic or not. With the help of Ludwig (thanks for your tremendous help), here are the detail of the hang: The Thread 33 is waiting on the lock 115 because the page where the lock is implemented is hold by transaction 800058ad
Locks grouped by lockers: Locker Mode Count Status ----------------- Object ---------------
... 115 dd=122 locks held 0 write locks 0 pid/thread 12326/139830151333632 flags 0 priority 100 115 READ 1 WAIT changelog/id2entry.db page 2 ... 120 dd=111 locks held 0 write locks 0 pid/thread 12326/139830151333632 flags 0 priority 100 121 dd=110 locks held 0 write locks 0 pid/thread 12326/139830151333632 flags 0 priority 100 ... 149 dd=70 locks held 1 write locks 0 pid/thread 12326/139830151333632 flags 10 priority 100 149 READ 1 HELD userRoot/numsubordinates.db handle 0 ... =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Locks grouped by object: Locker Mode Count Status ----------------- Object --------------- ... 800058ad WRITE 1 HELD changelog/id2entry.db page 2 115 READ 1 WAIT changelog/id2entry.db page 2 ... 800058ad dd= 1 locks held 15 write locks 11 pid/thread 12326/139829938759424 flags 0 priority 100 800058ad READ 2 HELD userRoot/member.db page 23 800058ad WRITE 1 HELD changelog/numsubordinates.db page 1 800058ad WRITE 1 HELD changelog/id2entry.db page 2 800058ad WRITE 1 HELD changelog/entryrdn.db page 33 800058ad WRITE 2 HELD changelog/entryrdn.db page 35 800058ad WRITE 1 HELD changelog/ancestorid.db page 1 800058ad WRITE 1 HELD changelog/entryusn.db page 4 800058ad WRITE 1 HELD changelog/parentid.db page 1 800058ad WRITE 1 HELD changelog/nsuniqueid.db page 10 800058ad WRITE 1 HELD changelog/changenumber.db page 4 800058ad WRITE 3 HELD changelog/objectclass.db page 1 800058ad WRITE 1 HELD changelog/id2entry.db page 147 800058ad READ 2 HELD changelog/entryrdn.db page 35 800058ad READ 3 HELD changelog/entryrdn.db page 33 800058ad READ 1 HELD changelog/nsuniqueid.db page 10
The transaction 800058ad is triggered by thread 8
{{{ Thread 8 (Thread 0x7f2cb1d42700 (LWP 12366)):
This thread is doing a MOD
{{{
[30/Apr/2014:07:18:59 -0400] conn=5 op=59 MOD dn="ou=ca,ou=requests,o=ipaca"
but deeper in the stack it ends into an internal search
{{{ (gdb) frame 10 #10 0x00007f2cdcc5aa51 in find_entry_internal_dn (flags=0, txn=0x7f2cb1d34560, lock=0, sdn=0x7f2cea121e50, be=0x7f2ce98f65f0, pb=0x7f2cea0daa60) at ldap/servers/slapd/back-ldbm/findentry.c:130 130 (e = dn2entry_ext( be, sdn, txn, flags & TOMBSTONE_INCLUDED, &err )) (gdb) print *sdn $7 = {flag = 15 '\017', udn = 0x7f2cea14a2e0 "cn=group1,cn=groups,cn=accounts,dc=idm,dc=lab,dc=bos,dc=redhat,dc=com", dn = 0x7f2cea121ed0 "cn=group1,cn=groups,cn=accounts,dc=idm,dc=lab,dc=bos,dc=redhat,dc=com", ndn = 0x7f2ce9f141f0 "cn=group1,cn=groups,cn=accounts,dc=idm,dc=lab,dc=bos,dc=redhat,dc=com", ndn_len = 69}
An interesting point is that the entry "cn=group1" was a tombstone and a replicated update modify it.
[30/Apr/2014:07:18:13 -0400] conn=171 op=5 DEL dn="cn=group1,cn=groups,cn=accounts,dc=idm,dc=lab,dc=bos,dc=redhat,dc=com" ... [30/Apr/2014:07:18:13 -0400] conn=171 op=5 RESULT err=0 tag=107 nentries=0 etime=0 csn=5360dbf7000f00060000 ... [30/Apr/2014:07:18:13 -0400] conn=23 op=85 MOD dn="cn=group1,cn=groups,cn=accounts,dc=idm,dc=lab,dc=bos,dc=redhat,dc=com" ... [30/Apr/2014:07:18:13 -0400] conn=23 op=85 RESULT err=0 tag=103 nentries=0 etime=0 csn=5360dbf7001100040000
The purpose of this ticket (47787) is to allow successful update on a tombstone if the update comes from replication. A good point is that we see the update successful.. a bad point is that we have this hang (sigh !)
Possibly fix for 47787 introduces this hang... or just reveal it.
{{{ [30/Apr/2014:07:14:13 -0400] - slapd started. Listening on All Interfaces port 389 for LDAP requests [30/Apr/2014:07:14:13 -0400] - Listening on All Interfaces port 636 for LDAPS requests [30/Apr/2014:07:14:13 -0400] - Listening on /var/run/slapd-IDM-LAB-BOS-REDHAT-COM.socket for LDAPI requests [30/Apr/2014:07:18:59 -0400] - database error -30993 [30/Apr/2014:07:18:59 -0400] - database error -30993 }}}
(attaching the backstack, DB env dump, logs)
attachment hang.tar.gz
The thread 8 is looping in _entryrdn_get_elem, where it continuously gets DB_DEADLOCK from each attempt to cursor->c_get. The key->data = "dc=idm,dc=lab,dc=bos,dc=redhat,dc=com"
The hang is looking as a separated issue. I created https://fedorahosted.org/389/ticket/47797 for it.
The hang being not systematic, I was able to test successfully the fix with freeipa unit tests.
Ran 1744 tests in 794.788s
FAILED (SKIP=64, errors=11, failures=1)
During that run, the fix works as it was able to apply successfully a MOD on a tombstone (if coming from replication) and replication continue without problem.
{{{ [06/May/2014:06:36:05 -0400] conn=175 fd=97 slot=97 connection from 10.16.78.61 to 10.16.78.61 ... [06/May/2014:06:36:06 -0400] conn=175 op=5 DEL dn="cn=group1,cn=groups,cn=accounts,dc=idm,dc=lab,dc=bos,dc=redhat,dc=com" ... [06/May/2014:06:36:06 -0400] conn=27 op=88 EXT oid="2.16.840.1.113730.3.5.12" name="replication-multimaster-extop" [06/May/2014:06:36:06 -0400] conn=27 op=88 RESULT err=0 tag=120 nentries=0 etime=0 [06/May/2014:06:36:06 -0400] conn=27 op=89 MOD dn="cn=ipausers,cn=groups,cn=accounts,dc=idm,dc=lab,dc=bos,dc=redhat,dc=com" ... [06/May/2014:06:36:06 -0400] conn=175 op=5 RESULT err=0 tag=107 nentries=0 etime=0 csn=5368bb1b000200090000 [06/May/2014:06:36:06 -0400] conn=27 op=89 RESULT err=0 tag=103 nentries=0 etime=0 csn=5368bb1a000200040000 [06/May/2014:06:36:06 -0400] conn=27 op=90 MOD dn="cn=group1,cn=groups,cn=accounts,dc=idm,dc=lab,dc=bos,dc=redhat,dc=com" [06/May/2014:06:36:06 -0400] conn=27 op=90 RESULT err=0 tag=103 nentries=0 etime=0 csn=5368bb1a000300040000 [06/May/2014:06:36:06 -0400] conn=27 op=91 MOD dn="cn=ipausers,cn=groups,cn=accounts,dc=idm,dc=lab,dc=bos,dc=redhat,dc=com" [06/May/2014:06:36:06 -0400] conn=27 op=91 RESULT err=0 tag=103 nentries=0 etime=0 csn=5368bb1a000400040000
'''Push to master'''
git merge ticketfreeipa_4279
Updating 24d44ba..804d923 Fast-forward dirsrvtests/tickets/ticket47787_test.py | 630 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ldap/servers/slapd/back-ldbm/ldbm_modify.c | 2 +- 2 files changed, 631 insertions(+), 1 deletion(-) create mode 100644 dirsrvtests/tickets/ticket47787_test.py
git push origin master
Counting objects: 18, done. Delta compression using up to 4 threads. Compressing objects: 100% (10/10), done. Writing objects: 100% (10/10), 6.17 KiB, done. Total 10 (delta 6), reused 0 (delta 0) To ssh://git.fedorahosted.org/git/389/ds.git 24d44ba..804d923 master -> master
commit 804d923ea44a7d96e49e550ff8d1fc3ff128f5c2 Author: Thierry bordaz (tbordaz) tbordaz@redhat.com Date: Fri Apr 25 15:07:08 2014 +0200
git cherry-pick 804d923ea44a7d96e49e550ff8d1fc3ff128f5c2 [389-ds-base-1.3.2 c13feee] Ticket 47787 - A replicated MOD fails (Unwilling to perform) if it targets a tombstone 2 files changed, 631 insertions(+), 1 deletion(-) create mode 100644 dirsrvtests/tickets/ticket47787_test.py
git push origin '''389-ds-base-1.3.2'''
Counting objects: 18, done. Delta compression using up to 4 threads. Compressing objects: 100% (9/9), done. Writing objects: 100% (10/10), 6.17 KiB, done. Total 10 (delta 5), reused 0 (delta 0) To ssh://git.fedorahosted.org/git/389/ds.git 86b34ca..c13feee 389-ds-base-1.3.2 -> 389-ds-base-1.3.2
git cherry-pick 804d923ea44a7d96e49e550ff8d1fc3ff128f5c2 [389-ds-base-1.3.1 1a9e1d8] Ticket 47787 - A replicated MOD fails (Unwilling to perform) if it targets a tombstone 2 files changed, 631 insertions(+), 1 deletion(-) create mode 100644 dirsrvtests/tickets/ticket47787_test.py
git push origin '''389-ds-base-1.3.1'''
Counting objects: 16, done. Delta compression using up to 4 threads. Compressing objects: 100% (8/8), done. Writing objects: 100% (10/10), 6.12 KiB, done. Total 10 (delta 5), reused 0 (delta 0) To ssh://git.fedorahosted.org/git/389/ds.git efa23ce..1a9e1d8 389-ds-base-1.3.1 -> 389-ds-base-1.3.1
git push origin '''389-ds-base-1.2.11'''
Counting objects: 16, done. Delta compression using up to 4 threads. Compressing objects: 100% (8/8), done. Writing objects: 100% (10/10), 6.13 KiB, done. Total 10 (delta 5), reused 0 (delta 0) To ssh://git.fedorahosted.org/git/389/ds.git ca407f8..0ee8496 389-ds-base-1.2.11 -> 389-ds-base-1.2.11
attachment 0001-Ticket-47787-Make-the-test-case-more-robust.patch
ack
Counting objects: 9, done. Delta compression using up to 4 threads. Compressing objects: 100% (5/5), done. Writing objects: 100% (5/5), 815 bytes, done. Total 5 (delta 3), reused 0 (delta 0) To ssh://git.fedorahosted.org/git/389/ds.git 3b5f3fa..52e57de master -> master
Metadata Update from @tbordaz: - Issue assigned to tbordaz - Issue set to the milestone: 1.2.11.30
389-ds-base is moving from Pagure to Github. This means that new issues and pull requests will be accepted only in 389-ds-base's github repository.
This issue has been cloned to Github and is available here: - https://github.com/389ds/389-ds-base/issues/1118
If you want to receive further updates on the issue, please navigate to the github issue and click on subscribe button.
subscribe
Thank you for understanding. We apologize for all inconvenience.
Metadata Update from @spichugi: - Issue close_status updated to: wontfix (was: Fixed)