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
    • Resolution: Fixed
    • Major
    • 2.7.9
    • 2.7.6, 2.7.8
    • 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

          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