andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone
Blob Blame History Raw
From c98ffe09746624bdf6ca7ffcc6180c4bfe038b08 Mon Sep 17 00:00:00 2001
From: Ludwig Krispenz <lkrispen@redhat.com>
Date: Tue, 23 Jun 2015 16:24:40 +0200
Subject: [PATCH 349/363] Ticket 48195 - Slow replication when deleting large 
 quantities of multi-valued attributes

https://fedorahosted.org/389/ticket/48195

In update resoultion for entry deletion, there is still use of valuearray_find() to find an existingvalue to update its csn.
with the fix for ticket #346 there exists slapi_valueset_find() which uses the possibility to do a binary search on the
values.
Fix: do not use valuearray_find

Review: ?
(cherry picked from commit 993e37a876032cff7654a49a6743d7f7715cb77f)
---
 ldap/servers/slapd/valueset.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ldap/servers/slapd/valueset.c b/ldap/servers/slapd/valueset.c
index 52c04b8..42623cf 100644
--- a/ldap/servers/slapd/valueset.c
+++ b/ldap/servers/slapd/valueset.c
@@ -1398,10 +1398,10 @@ valueset_update_csn_for_valuearray(Slapi_ValueSet *vs, const Slapi_Attr *a, Slap
 		int del_index = -1, del_count = 0;
 		for (i=0;valuestoupdate[i]!=NULL;++i)
 		{
-			int index= valuearray_find(a, vs->va, valuestoupdate[i]);
-			if(index!=-1)
+			Slapi_Value *v = slapi_valueset_find(a, vs, valuestoupdate[i]);
+			if(v)
 			{
-				value_update_csn(vs->va[index],t,csn);
+				value_update_csn(v,t,csn);
 				valuearrayfast_add_value_passin(&vaf_valuesupdated,valuestoupdate[i]);
 				valuestoupdate[i]= NULL;
 				del_count++;
-- 
2.4.3