andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone
dc8c34
From c98ffe09746624bdf6ca7ffcc6180c4bfe038b08 Mon Sep 17 00:00:00 2001
dc8c34
From: Ludwig Krispenz <lkrispen@redhat.com>
dc8c34
Date: Tue, 23 Jun 2015 16:24:40 +0200
dc8c34
Subject: [PATCH 349/363] Ticket 48195 - Slow replication when deleting large 
dc8c34
 quantities of multi-valued attributes
dc8c34
dc8c34
https://fedorahosted.org/389/ticket/48195
dc8c34
dc8c34
In update resoultion for entry deletion, there is still use of valuearray_find() to find an existingvalue to update its csn.
dc8c34
with the fix for ticket #346 there exists slapi_valueset_find() which uses the possibility to do a binary search on the
dc8c34
values.
dc8c34
Fix: do not use valuearray_find
dc8c34
dc8c34
Review: ?
dc8c34
(cherry picked from commit 993e37a876032cff7654a49a6743d7f7715cb77f)
dc8c34
---
dc8c34
 ldap/servers/slapd/valueset.c | 6 +++---
dc8c34
 1 file changed, 3 insertions(+), 3 deletions(-)
dc8c34
dc8c34
diff --git a/ldap/servers/slapd/valueset.c b/ldap/servers/slapd/valueset.c
dc8c34
index 52c04b8..42623cf 100644
dc8c34
--- a/ldap/servers/slapd/valueset.c
dc8c34
+++ b/ldap/servers/slapd/valueset.c
dc8c34
@@ -1398,10 +1398,10 @@ valueset_update_csn_for_valuearray(Slapi_ValueSet *vs, const Slapi_Attr *a, Slap
dc8c34
 		int del_index = -1, del_count = 0;
dc8c34
 		for (i=0;valuestoupdate[i]!=NULL;++i)
dc8c34
 		{
dc8c34
-			int index= valuearray_find(a, vs->va, valuestoupdate[i]);
dc8c34
-			if(index!=-1)
dc8c34
+			Slapi_Value *v = slapi_valueset_find(a, vs, valuestoupdate[i]);
dc8c34
+			if(v)
dc8c34
 			{
dc8c34
-				value_update_csn(vs->va[index],t,csn);
dc8c34
+				value_update_csn(v,t,csn);
dc8c34
 				valuearrayfast_add_value_passin(&vaf_valuesupdated,valuestoupdate[i]);
dc8c34
 				valuestoupdate[i]= NULL;
dc8c34
 				del_count++;
dc8c34
-- 
dc8c34
2.4.3
dc8c34