[MB-4195] append/prepend leaks item memory on CAS mismatch Created: 15/Aug/11  Updated: 10/Apr/12  Resolved: 16/Aug/11

Status: Closed
Project: Couchbase Server
Component/s: couchbase-bucket
Affects Version/s: 1.7.1
Fix Version/s: None
Security Level: Public

Type: Bug Priority: Critical
Reporter: Steve Yen Assignee: Chiyoung Seo
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Chiyoung found one case of memory leak with append/prepend in the 1.7.x ep-engine code. The scenario is...

If the client app is using CAS with their append/prepend operations, and they have concurrent clients trying to append to the same hot item, then several of the concurrent clients could be "rejected" in that their CAS values are out of date. The rejected CAS-mismatch clients would see a EEXISTS error code if they're binary protocol clients. These requests that have rejected CAS-mismatch will leak the item.

This should also be reproducible with a single client, where any append operations use a bogus CAS number.


 Comments   
Comment by Farshid Ghods (Inactive) [ 15/Aug/11 ]
Integrated in github-ep-engine-1-7-1 #142 (See [http://qa.hq.northscale.net/job/github-ep-engine-1-7-1/142/])
    MB-4195 Free an item if prepend/append failed due to CAS mismatches

Chiyoung Seo :
Files :
* ep_engine.cc
Comment by Chiyoung Seo [ 16/Aug/11 ]
http://review.couchbase.org/#change,8965
Generated at Tue Sep 30 20:51:09 CDT 2014 using JIRA 5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9.