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

XDCR - MapShaRefCounter "needToSync" subjected to race condition

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 7.0.0, 7.1.0, 7.0.2, 7.0.1
    • 7.1.0
    • XDCR
    • Untriaged
    • 1
    • No

    Description

      The backend mechanism for keeping track of upserting brokenmapping is subjected to race condition. The flow is as follows:

      1. A new instance of mapping is inserted. c.needToSync is set to true
      2. {{ MapShaRefCounter}}'s upsertMapping is called
      3. It checks the needToSync variable, and unlocks prior to doing RPC to simple store
      4. Once RPC returns, it re-acquires mutex to c.needToSync
      5. Without ensuring that c.shaToMapping did not change underneath, it clears c.needToSync. It may introduce a situation where a new entry was added to c.shaToMapping but the flag was cleared without actually upserting it.

      Attachments

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

        Activity

          Build couchbase-server-7.1.0-1862 contains goxdcr commit 3e942ef with commit message:
          MB-49716: only clear needToSync if no one has modified it from underneath

          build-team Couchbase Build Team added a comment - Build couchbase-server-7.1.0-1862 contains goxdcr commit 3e942ef with commit message: MB-49716 : only clear needToSync if no one has modified it from underneath

          People

            neil.huang Neil Huang
            neil.huang Neil Huang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty