Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1044154 - multi master replication allows schema violation
multi master replication allows schema violation
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: 389-ds-base (Show other bugs)
7.0
Unspecified Unspecified
medium Severity unspecified
: rc
: ---
Assigned To: Rich Megginson
Viktor Ashirov
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-12-17 16:31 EST by Nathan Kinder
Modified: 2015-03-05 04:31 EST (History)
3 users (show)

See Also:
Fixed In Version: 389-ds-base-1.3.3.1-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-03-05 04:31:45 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0416 normal SHIPPED_LIVE Important: 389-ds-base security, bug fix, and enhancement update 2015-03-05 09:26:33 EST

  None (edit)
Description Nathan Kinder 2013-12-17 16:31:14 EST
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/389/ticket/601

If an attribute is required by the schema any attempt to delete all values will fail without replication or on a single master.
But if the attribute has two values it is possible to simultaneously delete one value on one master and the other value on the other master - the individual operation is allowed as one value remains. After the two masters have replayed their changes to each other bot values have disappeared.
Comment 2 Viktor Ashirov 2014-12-10 18:31:28 EST
$ rpm -qa  | grep 389
389-ds-base-1.3.3.1-9.el7.x86_64
389-ds-base-debuginfo-1.3.3.1-9.el7.x86_64
389-ds-base-libs-1.3.3.1-9.el7.x86_64

I can reproduce the problem. 
I set up MMR (M1 - 1189, M2 - 1289)

[1] Add test entry
$ ldapmodify -D "cn=Directory Manager" -w Secret123  -H ldap://localhost:1189 -a << EOF
dn: cn=user,ou=People,dc=example,dc=com
objectClass: inetUser
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
cn: user
sn: user-M1
sn: user-M2
EOF
adding new entry "cn=user,ou=People,dc=example,dc=com"

[2] Check that it was synchronized 
$ ldapsearch -h rhel7ds.brq.redhat.com -p 1189 -D "cn=Directory Manager" -w "Secret123" -b "dc=example,dc=com"  "(cn=user)" sn -LLL
dn: cn=user,ou=People,dc=example,dc=com
sn: user-M1
sn: user-M2

$ ldapsearch -h rhel7ds.brq.redhat.com -p 1289 -D "cn=Directory Manager" -w "Secret123" -b "dc=example,dc=com"  "(cn=user)" sn -LLL
dn: cn=user,ou=People,dc=example,dc=com
sn: user-M1
sn: user-M2

[3] Stop M2
$ sudo systemctl stop dirsrv@M2

[4] Delete sn on M1
$ ldapmodify -D "cn=Directory Manager" -w Secret123  -H ldap://localhost:1189 << EOF
dn: cn=user,ou=People,dc=example,dc=com
changetype: modify
delete: sn
sn: user-M1
EOF
modifying entry "cn=user,ou=People,dc=example,dc=com"


$ ldapsearch -h rhel7ds.brq.redhat.com -p 1189 -D "cn=Directory Manager" -w "Secret123" -b "dc=example,dc=com"  "(cn=user)" sn -LLL
dn: cn=user,ou=People,dc=example,dc=com
cn: user
sn: user-M2

[5] Stop M1 and start M2
$ sudo systemctl stop dirsrv@M1
$ sudo systemctl start dirsrv@M2

[6] Delete sn on M2
$ ldapmodify -D "cn=Directory Manager" -w Secret123  -H ldap://localhost:1289 << EOF
dn: cn=user,ou=People,dc=example,dc=com
changetype: modify
delete: sn
sn: user-M2
EOF
modifying entry "cn=user,ou=People,dc=example,dc=com"

$ ldapsearch -h rhel7ds.brq.redhat.com -p 1289 -D "cn=Directory Manager" -w "Secret123" -b "dc=example,dc=com"  "(cn=user)" sn -LLL
dn: cn=user,ou=People,dc=example,dc=com
sn: user-M1

[7] Restart both M1 and M2
$ sudo systemctl restart dirsrv.target

[8] sn attribute was removed on both M1 and M2, though it violates the schema
$ ldapsearch -h rhel7ds.brq.redhat.com -p 1189 -D "cn=Directory Manager" -w "Secret123" -b "dc=example,dc=com"  "(cn=user)"  -LLL
dn: cn=user,ou=People,dc=example,dc=com
objectClass: inetUser
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
cn: user

$ ldapsearch -h rhel7ds.brq.redhat.com -p 1289 -D "cn=Directory Manager" -w "Secret123" -b "dc=example,dc=com"  "(cn=user)"  -LLL
dn: cn=user,ou=People,dc=example,dc=com
objectClass: inetUser
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
cn: user

In the errors log: 
[11/Dec/2014:00:07:42 +0100] - Entry "cn=user,ou=People,dc=example,dc=com" missing attribute "sn" required by object class "person"
Comment 3 Ludwig 2014-12-11 11:37:43 EST
The situation cannot be prevented. The fix consists of detecting this situation and log an error and add a replication conflict attribute: nsds5ReplConflict

So the fix works as expected
Comment 4 Viktor Ashirov 2014-12-11 11:56:13 EST
Sorry, it wasn't obvious from the description :(

$ ldapsearch -D "cn=Directory Manager" -w Secret123 -h localhost -p 1189 -b "dc=example,dc=com" "nsds5ReplConflict=*" \* nsds5ReplConflict -LLL
dn: cn=user,ou=People,dc=example,dc=com
objectClass: inetUser
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
cn: user
nsds5ReplConflict: Schema violation


nsds5ReplConflict attribute was added on both masters. Marking as VERIFIED.
Comment 6 errata-xmlrpc 2015-03-05 04:31:45 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-0416.html

Note You need to log in before you can comment on or make changes to this bug.