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

CAS value ignored when performing increment or decrement

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta
    • Fix Version/s: 2.1.0
    • Component/s: couchbase-bucket
    • Security Level: Public
    • Labels:
    • Environment:
      Windows 7, discovered using the .NET Client Library 1.2-Beta

      Description

      When testing the CouchbaseClient.Decrement(Key, Default, Delta, CAS), it was discovered that the server is not honoring the invalid CAS and is successfully Decrementing the value. Matt confirmed with Trond that this is a server issue.

      Workaround: perform a set/replace with CAS instead of a incr/decr, doing the incr/decr on the client side.

      var decrementResult = client.Decrement(key, 100, 10);
      var casResult = client.GetWithCas(key);
      var result = client.Decrement(key, 100, 10, casResult.Cas - 1); //result is true, but should be false

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

        Activity

        Hide
        ingenthr Matt Ingenthron added a comment -

        I concur. This was only found when seeking API completeness in a client library. Given the workaround, release note it and move forward for now. Other clients don't even support this functionality yet.

        Kudos to John for finding it.

        Show
        ingenthr Matt Ingenthron added a comment - I concur. This was only found when seeking API completeness in a client library. Given the workaround, release note it and move forward for now. Other clients don't even support this functionality yet. Kudos to John for finding it.
        Hide
        ingenthr Matt Ingenthron added a comment -

        I concur. This was only found when seeking API completeness in a client library. Given the workaround, release note it and move forward for now. Other clients don't even support this functionality yet.

        Kudos to John for finding it.

        Show
        ingenthr Matt Ingenthron added a comment - I concur. This was only found when seeking API completeness in a client library. Given the workaround, release note it and move forward for now. Other clients don't even support this functionality yet. Kudos to John for finding it.
        Hide
        steve Steve Yen added a comment -

        moved to 2.0.2 per bug-scrub.

        a better approach might be a "full sweep" cleanup with a major release for these kinds of API issues.

        Show
        steve Steve Yen added a comment - moved to 2.0.2 per bug-scrub. a better approach might be a "full sweep" cleanup with a major release for these kinds of API issues.
        Hide
        maria Maria McDuff (Inactive) added a comment -

        hi deep, pls verify by (per mike) writing a test that does an incr with a bad cas value and make sure it fails.

        Show
        maria Maria McDuff (Inactive) added a comment - hi deep, pls verify by (per mike) writing a test that does an incr with a bad cas value and make sure it fails.
        Hide
        deepkaran.salooja Deepkaran Salooja added a comment -

        Not able to get this to work for verification. Following up with Mike on this.

        Show
        deepkaran.salooja Deepkaran Salooja added a comment - Not able to get this to work for verification. Following up with Mike on this.

          People

          • Assignee:
            deepkaran.salooja Deepkaran Salooja
            Reporter:
            john John Zablocki (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes