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

HLC generated CAS value may be the same for multiple docs in a vBucket

    XMLWordPrintable

Details

    • Triaged
    • 1
    • Unknown
    • KV 2021-Nov

    Description

      Need to update affects versions.

      The nextHLC() function (https://github.com/couchbase/kv_engine/blob/15b36716b5cd32f337b0a58251071ad953b9911c/engines/ep/src/hlc.h#L81) may be called concurrently for two (or more) different docs in a vBucket if those docs belong to different HashBuckets. Generally this is updated under the checkpoint manager lock, but getLocked calls also update the cas in some situtations which is where we hit this. If two threads call it concurrently, get the same time, and we are not in logical clock mode, then the two items end up having the same cas (and we update the maxHLC once). Really we should be checking the result of the maxHLC update and only returning the cas if true.

      This is probably benign, we can already set cas freely via set with meta and this is for two different documents, but it's worth correcting before something falls afoul of it.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ben.huddleston Ben Huddleston
            ben.huddleston Ben Huddleston
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty