andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone
dc8c34
From 39125fa7991fa85b0f8d4f51e7b5625d6f493475 Mon Sep 17 00:00:00 2001
dc8c34
From: Noriko Hosoi <nhosoi@redhat.com>
dc8c34
Date: Thu, 13 Jun 2013 18:22:21 -0700
dc8c34
Subject: [PATCH] Ticket #569 - examine replication code to reduce amount of
dc8c34
 stored state information
dc8c34
dc8c34
Description: commit c7f6f161f4967635d6f02b029be571d88ec61961
dc8c34
made this change:
dc8c34
  In case the deleted value list in an attribute is empty:
dc8c34
  * this means the entry is deleted and has no more attributes,
dc8c34
  * when writing the attr to disk we would loose the AD-csn.
dc8c34
  * Add an empty value to the set of deleted values. This will
dc8c34
  * never be seen by any client. It will never be moved to the
dc8c34
  * present values and is only used to preserve the AD-csn.
dc8c34
The AD-csn size was not counted for the buffer size to allocate.
dc8c34
This patch adds the size.
dc8c34
dc8c34
https://fedorahosted.org/389/ticket/569
dc8c34
dc8c34
Reviewed by Nathan (Thanks!!)
dc8c34
dc8c34
(cherry picked from commit ca02529c797903139c56bd9b8b90e8cd5bd0c3f4)
dc8c34
dc8c34
Conflicts:
dc8c34
	ldap/servers/slapd/entry.c
dc8c34
dc8c34
(cherry picked from commit 340b9dc5f979d75ab5bb92c7aa61808ff1fddd1f)
dc8c34
---
dc8c34
 ldap/servers/slapd/entry.c | 12 +++++++++++-
dc8c34
 1 file changed, 11 insertions(+), 1 deletion(-)
dc8c34
dc8c34
diff --git a/ldap/servers/slapd/entry.c b/ldap/servers/slapd/entry.c
dc8c34
index 1341296..340844d 100644
dc8c34
--- a/ldap/servers/slapd/entry.c
dc8c34
+++ b/ldap/servers/slapd/entry.c
dc8c34
@@ -1476,7 +1476,17 @@ entry2str_internal_size_attrlist( const Slapi_Attr *attrlist, int entry2str_ctrl
dc8c34
 			/* ";adcsn-" + a->a_deletioncsn */
dc8c34
 			if ( a->a_deletioncsn )
dc8c34
 			{
dc8c34
-				elen+= 1 + LDIF_CSNPREFIX_MAXLENGTH + CSN_STRSIZE;
dc8c34
+				elen += 1 + LDIF_CSNPREFIX_MAXLENGTH + CSN_STRSIZE;
dc8c34
+			}
dc8c34
+			if ( valueset_isempty(&a->a_deleted_values)) {
dc8c34
+				/* this means the entry is deleted and has no more attributes,
dc8c34
+				 * when writing the attr to disk we would loose the AD-csn.
dc8c34
+				 * Add an empty value to the set of deleted values. This will 
dc8c34
+				 * never be seen by any client. It will never be moved to the 
dc8c34
+				 * present values and is only used to preserve the AD-csn
dc8c34
+				 * We need to add the size for that.
dc8c34
+				 */
dc8c34
+				elen += 1 + LDIF_CSNPREFIX_MAXLENGTH + CSN_STRSIZE;
dc8c34
 			}
dc8c34
 		}
dc8c34
 	}
dc8c34
-- 
dc8c34
1.9.3
dc8c34