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

MutateIn With Counter and Upsert Fails

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.7.6, 2.7.8
    • 2.7.9
    • library
    • None
    • 1

    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

          I'm curious, how does enabling enhanced durability impact this?

          ingenthr Matt Ingenthron added a comment - I'm curious, how does enabling enhanced durability impact this?

          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.

          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

            mike.goldsmith Michael Goldsmith
            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