Description
Subdocument concurrency is broken - it seems we overwrite previous mutations without regard for actually checking the CAS. The example below will spit out a different number for each run, indicating that some of the mutations are indeed being swallowed.
#!/usr/bin/env python
|
from threading import Thread
|
|
from couchbase.bucket import Bucket
|
import couchbase.subdocument as SD
|
|
|
DOCID = 'subdoc_doc_id'
|
CONNSTR = 'couchbase://localhost:12000'
|
ITERATIONS = 200
|
THREADS = 20
|
|
main_bucket = Bucket(CONNSTR)
|
main_bucket.upsert(DOCID, {'recs':[]})
|
|
thrs = []
|
|
class Runner(Thread):
|
def run(self, *args, **kw):
|
cb = Bucket(CONNSTR)
|
for x in range(ITERATIONS):
|
cb.mutate_in(DOCID, SD.array_append('recs', 1))
|
|
thrs = [Runner() for x in range(THREADS)]
|
[t.start() for t in thrs]
|
[t.join() for t in thrs]
|
|
obj = main_bucket.get(DOCID)
|
print 'Object has {} items'.format(len(obj.value['recs']))
|
Attachments
Issue Links
- is duplicated by
-
MB-21915 4.5.1 / arrayAppend sometimes does not append value
-
- Closed
-
For Gerrit Dashboard: MB-21597 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
69663,3 | MB-21597: Use OPERATION_CAS rather than OPERATION_REPLACE | master | memcached | Status: ABANDONED | -1 | -1 |
69736,4 | MB-21597: Use OPERATION_CAS rather than OPERATION_REPLACE | watson | memcached | Status: MERGED | +2 | +1 |
69750,1 | Merge remote-tracking branch 'couchbase/watson' | master | memcached | Status: ABANDONED | 0 | -1 |
69775,3 | Merge remote-tracking branch 'couchbase/watson' | master | memcached | Status: MERGED | +2 | +1 |
69781,2 | MB-21597: Use OPERATION_CAS rather than OPERATION_REPLACE | 4.5.1 | memcached | Status: MERGED | +2 | +1 |
Activity
Field | Original Value | New Value |
---|---|---|
Priority | Major [ 3 ] | Critical [ 2 ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Fix Version/s | 4.6.0 [ 13416 ] |
Link | This issue blocks CBSE-3117 [ CBSE-3117 ] |
Link | This issue blocks CBSE-3122 [ CBSE-3122 ] |
Link | This issue blocks MB-21631 [ MB-21631 ] |
Resolution | Fixed [ 1 ] | |
Status | In Progress [ 3 ] | Resolved [ 5 ] |
Issue Type | Task [ 3 ] | Epic [ 5 ] |
Issue Type | Epic [ 5 ] | Bug [ 1 ] |
VERIFICATION STEPS | Verified with the included test on build 4.5.1-2848, correctly returned 4000 items. | |
Status | Resolved [ 5 ] | Closed [ 6 ] |
Link | This issue relates to CBQE-3709 [ CBQE-3709 ] |
Link | This issue blocks CBSE-3188 [ CBSE-3188 ] |
Link | This issue relates to CBSE-3189 [ CBSE-3189 ] |
Link | This issue relates to CBSP-756 [ CBSP-756 ] |
Link | This issue relates to CBQE-3721 [ CBQE-3721 ] |
Link | This issue blocks CBSE-3228 [ CBSE-3228 ] |
Link | This issue blocks CBSE-3350 [ CBSE-3350 ] |