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

Race condition when logging DCP state (retries may be logged as -1)

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • Cheshire-Cat
    • 7.0.0
    • tools
    • None
    • Untriaged
    • 1
    • No
    • Tools: CC Final Sprint

    Description

      What's the issue?
      It looks like we might have a race condition when logging DCP state for very small transfers. Once a stream is started, it operates completely asynchronously, an extremely small stream may complete before the retries counter has been incremented; this may result in the number of retries being logged as -1 (which makes no sense)

      Attachments

        Issue Links

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

          Activity

            Build couchbase-server-7.0.0-4631 contains backup commit 02a8cad with commit message:
            MB-44773 Ensure we don't log a negative retry count

            build-team Couchbase Build Team added a comment - Build couchbase-server-7.0.0-4631 contains backup commit 02a8cad with commit message: MB-44773 Ensure we don't log a negative retry count

            Closing based on the fact that this has been unit tested.

            asad.zaidi Asad Zaidi (Inactive) added a comment - Closing based on the fact that this has been unit tested.
            james.lee James Lee added a comment -

            Reopening because the current solution to this issue is inadequate and doesn't actually eliminate the race condition (as we've seen from MB-45747).

            This resulted in a workaround in 'master' which uses an atomic operation to get the retry count, however, this just eliminates the data race (accessing the variable itself); the value may well still be stale.

            james.lee James Lee added a comment - Reopening because the current solution to this issue is inadequate and doesn't actually eliminate the race condition (as we've seen from MB-45747 ). This resulted in a workaround in ' master ' which uses an atomic operation to get the retry count, however, this just eliminates the data race (accessing the variable itself); the value may well still be stale.

            Build couchbase-server-7.0.0-5009 contains backup commit b720543 with commit message:
            MB-44773 Ensure we log an accurate retry count

            build-team Couchbase Build Team added a comment - Build couchbase-server-7.0.0-5009 contains backup commit b720543 with commit message: MB-44773 Ensure we log an accurate retry count

            Closing this as this is unit tested already

            arunkumar Arunkumar Senthilnathan added a comment - Closing this as this is unit tested already

            Build couchbase-server-7.0.0-5075 contains backup commit 62e9626 with commit message:
            MB-44773 Account for pre-stream request incrementing of retry count

            build-team Couchbase Build Team added a comment - Build couchbase-server-7.0.0-5075 contains backup commit 62e9626 with commit message: MB-44773 Account for pre-stream request incrementing of retry count

            People

              arunkumar Arunkumar Senthilnathan
              james.lee James Lee
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty