Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-21597

Subdoc atomic/concurrency broken

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • master, 4.5.1
    • 4.6.0
    • memcached
    • None

    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

          For Gerrit Dashboard: MB-21597
          # Subject Branch Project Status CR V

          Activity

            mnunberg Mark Nunberg (Inactive) created issue -
            mnunberg Mark Nunberg (Inactive) made changes -
            Field Original Value New Value
            Priority Major [ 3 ] Critical [ 2 ]
            mnunberg Mark Nunberg (Inactive) made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            drigby Dave Rigby made changes -
            Fix Version/s 4.6.0 [ 13416 ]
            pvarley Patrick Varley made changes -
            Link This issue blocks CBSE-3117 [ CBSE-3117 ]
            pvarley Patrick Varley made changes -
            Link This issue blocks CBSE-3122 [ CBSE-3122 ]
            wayne Wayne Siu made changes -
            Link This issue blocks MB-21631 [ MB-21631 ]
            drigby Dave Rigby made changes -
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Resolved [ 5 ]
            drigby Dave Rigby made changes -
            Issue Type Task [ 3 ] Epic [ 5 ]
            drigby Dave Rigby made changes -
            Issue Type Epic [ 5 ] Bug [ 1 ]
            ericcooper Eric Cooper (Inactive) made changes -
            VERIFICATION STEPS Verified with the included test on build 4.5.1-2848, correctly returned 4000 items.
            Status Resolved [ 5 ] Closed [ 6 ]
            wayne Wayne Siu made changes -
            Link This issue relates to CBQE-3709 [ CBQE-3709 ]
            ianmccloy Ian McCloy made changes -
            Link This issue blocks CBSE-3188 [ CBSE-3188 ]
            pvarley Patrick Varley made changes -
            Link This issue relates to CBSE-3189 [ CBSE-3189 ]
            pvarley Patrick Varley made changes -
            Link This issue relates to CBSP-756 [ CBSP-756 ]
            pvarley Patrick Varley made changes -
            Link This issue relates to CBQE-3721 [ CBQE-3721 ]
            dhaikney David Haikney made changes -
            Link This issue is duplicated by MB-21915 [ MB-21915 ]
            pvarley Patrick Varley made changes -
            Link This issue blocks CBSE-3228 [ CBSE-3228 ]
            pvarley Patrick Varley made changes -
            Link This issue blocks CBSE-3350 [ CBSE-3350 ]

            People

              mnunberg Mark Nunberg (Inactive)
              mnunberg Mark Nunberg (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty