Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-2021

MutateIn With Counter and Upsert Fails

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.7.6, 2.7.8
    • Fix Version/s: 2.7.9
    • Component/s: library
    • Labels:
      None

      Description

      Since 2.7.6, combining a Counter sub-doc operation combined with an Upsert is failing by not completing at all. Only affects connections with Enhanced Durability enabled. Reproducible by adding the following tests to CouchbaseBucket_SubDocument_Tests:

              [Test]
              [TestCase(true)]
              [TestCase(false)]
              public void MutateIn_Counter_WithUpsert_ReturnsSuccess(bool useMutation)
              {
                  var bucket = GetBucket(useMutation);
                  var key = "MutateInAsync_Counter_WithValidPathAndCreateParentsFalse_ReturnsSuccess";
                  bucket.Upsert(key, new { foo = "bar", bar = "foo", count=0 });
       
                  var builder = bucket.MutateIn<dynamic>(key)
                      .Counter("baz", 1, false)
                      .Upsert("foo", "bar2", false);
       
                  var result = builder.Execute();
       
                  Assert.AreEqual(ResponseStatus.Success, result.Status);
              }
       
              [Test]
              [TestCase(true)]
              [TestCase(false)]
              public async Task MutateInAsync_Counter_WithUpsert_ReturnsSuccess(bool useMutation)
              {
                  var bucket = GetBucket(useMutation);
                  var key = "MutateInAsync_Counter_WithValidPathAndCreateParentsFalse_ReturnsSuccess";
                  bucket.Upsert(key, new { foo = "bar", bar = "foo", count=0 });
       
                  var builder = bucket.MutateIn<dynamic>(key)
                      .Counter("baz", 1, false)
                      .Upsert("foo", "bar2", false);
       
                  var result = await builder.ExecuteAsync();
       
                  Assert.AreEqual(ResponseStatus.Success, result.Status);
              }
      

        Attachments

        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'm curious, how does enabling enhanced durability impact this?

          Show
          ingenthr Matt Ingenthron added a comment - I'm curious, how does enabling enhanced durability impact this?
          Hide
          mike.goldsmith Michael Goldsmith added a comment -

          Confirmed using Brant's tests above. I'll take a quick look today and if I find a solution I'll move to 2.7.9.

          Show
          mike.goldsmith Michael Goldsmith added a comment - Confirmed using Brant's tests above. I'll take a quick look today and if I find a solution I'll move to 2.7.9.

            People

            • Assignee:
              mike.goldsmith Michael Goldsmith
              Reporter:
              btburnett3 Brant Burnett
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes

                  PagerDuty

                  Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.