This is an automated email from the git hooks/post-receive script.
lkrispen pushed a commit to branch 389-ds-base-1.3.8
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.3.8 by this push:
new 94e6f12 Ticket 50078 - cannot add cenotaph in read only consumer
94e6f12 is described below
commit 94e6f128f5e8cf39e318d01ed93f159c127153cc
Author: Ludwig Krispenz <lkrispen(a)redhat.com>
AuthorDate: Tue Dec 11 11:06:44 2018 +0100
Ticket 50078 - cannot add cenotaph in read only consumer
Bug: For modrdn operations a cenotaph entry is created to be used in later conflict
resolution procedures, this is done by an internal add operation and
fails on hubs and consumers
Fix: Add the "bypass referral" flag to the internal add operation to allow
it
Reviewed by: Thierry, thanks
---
dirsrvtests/tests/tickets/ticket50078_test.py | 68 +++++++++++++++++++++++++++
ldap/servers/plugins/replication/urp.c | 2 +-
2 files changed, 69 insertions(+), 1 deletion(-)
diff --git a/dirsrvtests/tests/tickets/ticket50078_test.py
b/dirsrvtests/tests/tickets/ticket50078_test.py
new file mode 100644
index 0000000..3f6c5ec
--- /dev/null
+++ b/dirsrvtests/tests/tickets/ticket50078_test.py
@@ -0,0 +1,68 @@
+import pytest
+from lib389.utils import *
+from lib389.topologies import topology_m1h1c1
+from lib389.idm.user import UserAccounts
+
+from lib389._constants import (DEFAULT_SUFFIX, REPLICA_RUV_FILTER, defaultProperties,
+ REPLICATION_BIND_DN, REPLICATION_BIND_PW,
REPLICATION_BIND_METHOD,
+ REPLICATION_TRANSPORT, SUFFIX, RA_NAME, RA_BINDDN,
RA_BINDPW,
+ RA_METHOD, RA_TRANSPORT_PROT, SUFFIX)
+
+logging.getLogger(__name__).setLevel(logging.DEBUG)
+log = logging.getLogger(__name__)
+
+TEST_USER = "test_user"
+
+def test_ticket50078(topology_m1h1c1):
+ """
+ Test that for a MODRDN operation the cenotaph entry is created on
+ a hub or consumer.
+ """
+
+ M1 = topology_m1h1c1.ms["master1"]
+ H1 = topology_m1h1c1.hs["hub1"]
+ C1 = topology_m1h1c1.cs["consumer1"]
+ #
+ # Test replication is working
+ #
+ if M1.testReplication(DEFAULT_SUFFIX, topology_m1h1c1.cs["consumer1"]):
+ log.info('Replication is working.')
+ else:
+ log.fatal('Replication is not working.')
+ assert False
+
+ ua = UserAccounts(M1, DEFAULT_SUFFIX)
+ ua.create(properties={
+ 'uid': "%s%d" % (TEST_USER, 1),
+ 'cn' : "%s%d" % (TEST_USER, 1),
+ 'sn' : 'user',
+ 'uidNumber' : '1000',
+ 'gidNumber' : '2000',
+ 'homeDirectory' : '/home/testuser'
+ })
+
+ user = ua.get('%s1' % TEST_USER)
+ log.info(" Rename the test entry %s..." % user)
+ user.rename('uid=test_user_new')
+
+ # wait until replication is in sync
+ if M1.testReplication(DEFAULT_SUFFIX, topology_m1h1c1.cs["consumer1"]):
+ log.info('Replication is working.')
+ else:
+ log.fatal('Replication is not working.')
+ assert False
+
+ # check if cenotaph was created on hub and consumer
+ ents = H1.search_s(DEFAULT_SUFFIX, ldap.SCOPE_SUBTREE,
filterstr="(&(objectclass=nstombstone)(cenotaphid=*))")
+ assert len(ents) == 1
+
+ ents = C1.search_s(DEFAULT_SUFFIX, ldap.SCOPE_SUBTREE,
filterstr="(&(objectclass=nstombstone)(cenotaphid=*))")
+ assert len(ents) == 1
+
+
+
+if __name__ == '__main__':
+ # Run isolated
+ # -s for DEBUG mode
+ CURRENT_FILE = os.path.realpath(__file__)
+ pytest.main("-s %s" % CURRENT_FILE)
diff --git a/ldap/servers/plugins/replication/urp.c
b/ldap/servers/plugins/replication/urp.c
index 11c5da7..37fe773 100644
--- a/ldap/servers/plugins/replication/urp.c
+++ b/ldap/servers/plugins/replication/urp.c
@@ -911,7 +911,7 @@ urp_fixup_add_cenotaph (Slapi_PBlock *pb, char *sessionid, CSN
*opcsn)
cenotaph,
NULL,
repl_get_plugin_identity(PLUGIN_MULTIMASTER_REPLICATION),
-
OP_FLAG_REPL_FIXUP|OP_FLAG_NOOP|OP_FLAG_CENOTAPH_ENTRY);
+
OP_FLAG_REPL_FIXUP|OP_FLAG_NOOP|OP_FLAG_CENOTAPH_ENTRY|SLAPI_OP_FLAG_BYPASS_REFERRALS);
slapi_add_internal_pb(add_pb);
slapi_pblock_get(add_pb, SLAPI_PLUGIN_INTOP_RESULT, &ret);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.