ldap/servers/slapd/back-ldbm/ldbm_delete.c | 5 +++++
1 file changed, 5 insertions(+)
New commits:
commit f069f4bc18607ceef5d01e57b4102a0317819f8b
Merge: b554264 20c4201
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Fri Jul 1 14:12:35 2011 -0700
Merge branch '718303'
commit 20c42018a6cacde318c4213568ff4d31404af6e0
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Fri Jul 1 12:25:44 2011 -0700
Bug 718303 - Intensive updates on masters could break the consumer's cache
https://bugzilla.redhat.com/show_bug.cgi?id=718303
Description: When adding a tombstone to the entry cache, the source
code assumed the original entry already existed in the cache and
cache_add failed. But under some high stress + narrow window to
receive the updates from multi-masters, the original entry could
have been already evicted and the tombstone could be successfully
added to the entry cache. When the rare case occurred, the entry
in the cache was freed instead of put into LRU and when the entry
was searched in the entry cache, the server died by segfault.
This patch checks the entry after attempting to put it into the
entry cache. If the entry's state is in-cache, sets the correct
flag (tombstone_in_cache = 1).
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_delete.c
b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
index dc759b4..f2edf1e 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_delete.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
@@ -495,6 +495,11 @@ ldbm_back_delete( Slapi_PBlock *pb )
}
if (cache_add_tentative( &inst->inst_cache, tombstone, NULL) == 0) {
tombstone_in_cache = 1;
+ } else if (!(tombstone->ep_state & ENTRY_STATE_NOTINCACHE)) {
+ LDAPDebug1Arg(LDAP_DEBUG_CACHE,
+ "id2entry_add tombstone (%s) is in cache\n",
+ slapi_entry_get_dn(tombstone->ep_entry));
+ tombstone_in_cache = 1;
}
}
else