Bug 718351

Summary: Intensive updates on masters could break the consumer's cache
Product: Red Hat Enterprise Linux 6 Reporter: Noriko Hosoi <nhosoi>
Component: 389-ds-baseAssignee: Rich Megginson <rmeggins>
Status: CLOSED ERRATA QA Contact: Chandrasekar Kannan <ckannan>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 6.1CC: amsharma, benl, dpal, jgalipea, jwest, rmeggins
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 389-ds-base-1.2.8.5-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 718303 Environment:
Last Closed: 2011-12-06 17:51:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 718303    
Bug Blocks: 434915, 708096, 719068    

Description Noriko Hosoi 2011-07-01 21:37:15 UTC
+++ This bug was initially created as a clone of Bug #718303 +++

Description of problem:
Steps:
1. Set up 2-way MMR + consumer, which is fed by both masters.
2. Run ldclt (ADD, MOD, DELETE) on a master.
3. Run repeated create + delete VLV index (script being attached).
(Note: The VLV creation+deletion limits the backend's available time minimum.
 In the very short time, update requests from 2 masters come in and cause
 conflicts very easily.)
The combined test (2 and 3) crashes the server.

--- Additional comment from nhosoi on 2011-07-01 15:49:32 EDT ---

Created attachment 510927 [details]
git patch file (master)

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).

Sample log in the test:
[..] - id2entry_add tombstone (nsuniqueid=f6542bc3-a37f11e0-a7fbe1fb-26a727ee,nsuniqueid=f6542bc3-a37f11e0-a7fbe1fb-26a727ee+uid=emailperson_4901152,dc=example,dc=com) is in cache

--- Additional comment from nhosoi on 2011-07-01 17:35:29 EDT ---

Reviewed by Rich and Nathan (Thank you!!!)

Pushed to master.

$ git merge 718303
Merge made by recursive.
 ldap/servers/slapd/back-ldbm/ldbm_delete.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

$ git push
Counting objects: 24, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (13/13), done.
Writing objects: 100% (13/13), 1.66 KiB, done.
Total 13 (delta 9), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
   b554264..f069f4b  master -> master

RHEL-6:
(cherry picked from commit 20c42018a6cacde318c4213568ff4d31404af6e0)
$ git push redhat RHEL-6
Counting objects: 13, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (7/7), 1.19 KiB, done.
Total 7 (delta 5), reused 1 (delta 1)
To ssh://git.engineering.redhat.com/srv/git/users/rmeggins/ds.git
   fc7ed8f..695e2f1  RHEL-6 -> RHEL-6

Comment 6 Amita Sharma 2011-09-08 11:35:35 UTC
https://bugzilla.redhat.com/show_bug.cgi?id=718303 - Already VERIFIED the clone so marking this as VERIFIED.

Comment 7 errata-xmlrpc 2011-12-06 17:51:32 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2011-1711.html