This is an automated email from the git hooks/post-receive script.
lkrispen pushed a change to branch master
in repository 389-ds-base.
from 8fc58fd Revise VERSION number
new 6b1cbc8 Ticket: 49180 - errors log filled with attrlist_replace -
attr_replace
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.
Summary of changes:
ldap/servers/plugins/replication/repl5_ruv.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by thread
This is an automated email from the git hooks/post-receive script.
lkrispen pushed a commit to branch master
in repository 389-ds-base.
commit 6b1cbc8f626df946260c3dcd2a1f985edd24921b
Author: Ludwig Krispenz <lkrispen(a)redhat.com>
Date: Tue Sep 26 15:51:41 2017 +0200
Ticket: 49180 - errors log filled with attrlist_replace - attr_replace
Bug: If a RUV contains the same URL with different replica IDs the created referrals
contain duplicates
Fix: check duplicate referrals
Reviewed by: Mark, thanks
---
ldap/servers/plugins/replication/repl5_ruv.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/ldap/servers/plugins/replication/repl5_ruv.c
b/ldap/servers/plugins/replication/repl5_ruv.c
index 40dc092..7bfdc34 100644
--- a/ldap/servers/plugins/replication/repl5_ruv.c
+++ b/ldap/servers/plugins/replication/repl5_ruv.c
@@ -1386,7 +1386,17 @@ ruv_replica_count(const RUV *ruv)
* Extract all the referral URL's from the RUV (but self URL),
* returning them in an array of strings, that
* the caller must free.
+ * We also check and remove duplicates (caused by unclean RUVs)
*/
+static int
+ruv_referral_exists(unsigned char *purl, char **refs, int count)
+{
+ for (size_t j=0; j<count; j++) {
+ if (0 == slapi_utf8casecmp(purl, (unsigned char *)refs[j]))
+ return 1;
+ }
+ return 0;
+}
char **
ruv_get_referrals(const RUV *ruv)
{
@@ -1407,7 +1417,8 @@ ruv_get_referrals(const RUV *ruv)
/* Add URL into referrals if doesn't match self URL */
if ((replica->replica_purl != NULL) &&
(slapi_utf8casecmp((unsigned char *)replica->replica_purl,
- (unsigned char *)mypurl) != 0)) {
+ (unsigned char *)mypurl) != 0) &&
+ !ruv_referral_exists((unsigned char *)replica->replica_purl, r, i)) {
r[i] = slapi_ch_strdup(replica->replica_purl);
i++;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.