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

A Sub-Document insertion only specifying XATTR paths no longer creates an empty JSON body

    XMLWordPrintable

    Details

    • Triage:
      Triaged
    • Story Points:
      1
    • Is this a Regression?:
      Yes
    • Sprint:
      KV Sprint 2020-June

      Description

      This is a regression that was introduced in MB-40126.

      This Java 3.x code replicates:

      String docId = docId();
       
      coll.mutateIn(docId, Collections.singletonList(
                  upsert("foo", "bar").xattr()
              ),
              mutateInOptions().storeSemantics(StoreSemantics.INSERT));
       
      LookupInResult result = coll.lookupIn(docId, Arrays.asList(
              LookupInSpec.get("foo").xattr(),
              LookupInSpec.get("")
      ));
       
      assertTrue(result.exists(1));
       

      This is a Sub-Document insertion (ADD flag) that's only touching XATTRs, it doesn't specify the body and leaves it at whatever the server defaults to.

      It passes on 6.5.0-4908 but fails on 6.6.0-7857, on the last line.

      So memcached used to create an empty JSON object as the body if none was specified, and now creates the document with a null body instead.

      (This change does seem like an improvement to me, but sadly will break existing released transactional code when running on 6.6.)

        Attachments

          Issue Links

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

            Activity

            graham.pople Graham Pople created issue -
            drigby Dave Rigby made changes -
            Field Original Value New Value
            Assignee Dave Rigby [ drigby ]
            drigby Dave Rigby made changes -
            Affects Version/s 6.6.0 [ 16787 ]
            drigby Dave Rigby made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            drigby Dave Rigby made changes -
            Component/s memcached [ 11621 ]
            drigby Dave Rigby made changes -
            Summary memcached used to create an empty JSON body if a document was created with Sub-Document only specifying xattrs - now creates a null body Sub-Document mutation only specifying XATTR paths no longer creates an empty JSON body
            drigby Dave Rigby made changes -
            Is this a Regression? Unknown [ 10452 ] Yes [ 10450 ]
            drigby Dave Rigby made changes -
            Triage Untriaged [ 10351 ] Triaged [ 10350 ]
            drigby Dave Rigby made changes -
            Fix Version/s 6.6.0 [ 16787 ]
            Hide
            drigby Dave Rigby added a comment -

            Setting fixVersion to 6.6.0 given this is a regression since all previous versions supporting subdoc XATTRs (5.0+), and will break any existing application using only XATTR paths and a document create (including SDK Transactions).

            Show
            drigby Dave Rigby added a comment - Setting fixVersion to 6.6.0 given this is a regression since all previous versions supporting subdoc XATTRs (5.0+), and will break any existing application using only XATTR paths and a document create (including SDK Transactions).
            graham.pople Graham Pople made changes -
            Summary Sub-Document mutation only specifying XATTR paths no longer creates an empty JSON body A Sub-Document insertion only specifying XATTR paths no longer creates an empty JSON body
            drigby Dave Rigby made changes -
            Link This issue is caused by MB-40126 [ MB-40126 ]
            drigby Dave Rigby made changes -
            Sprint KV Sprint 2020-June [ 1106 ]
            drigby Dave Rigby made changes -
            Rank Ranked higher
            drigby Dave Rigby made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            arunkumar Arunkumar Senthilnathan made changes -
            Labels txn_testing
            till Till Westmann made changes -
            Link This issue blocks MB-38724 [ MB-38724 ]
            till Till Westmann made changes -
            Labels txn_testing approved-for-6.6.0 txn_testing
            drigby Dave Rigby made changes -
            Assignee Dave Rigby [ drigby ] Graham Pople [ graham.pople ]
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Resolved [ 5 ]
            Hide
            build-team Couchbase Build Team added a comment -

            Build couchbase-server-6.6.0-7860 contains kv_engine commit 20504bb with commit message:
            MB-40262: Subdoc inserts of Alive empty docs should be '{}'

            Show
            build-team Couchbase Build Team added a comment - Build couchbase-server-6.6.0-7860 contains kv_engine commit 20504bb with commit message: MB-40262 : Subdoc inserts of Alive empty docs should be '{}'
            Hide
            build-team Couchbase Build Team added a comment -

            Build couchbase-server-7.0.0-2532 contains kv_engine commit 20504bb with commit message:
            MB-40262: Subdoc inserts of Alive empty docs should be '{}'

            Show
            build-team Couchbase Build Team added a comment - Build couchbase-server-7.0.0-2532 contains kv_engine commit 20504bb with commit message: MB-40262 : Subdoc inserts of Alive empty docs should be '{}'
            Hide
            graham.pople Graham Pople added a comment -

            I'm closing this as the majority of my transactions tests are now passing.  There are a few remaining failures to diagnose but I don't at this point think they are related to this issue (I may have to reopen if that turns out not to be the case).

            Show
            graham.pople Graham Pople added a comment - I'm closing this as the majority of my transactions tests are now passing.  There are a few remaining failures to diagnose but I don't at this point think they are related to this issue (I may have to reopen if that turns out not to be the case).
            graham.pople Graham Pople made changes -
            Status Resolved [ 5 ] Closed [ 6 ]

              People

              Assignee:
              graham.pople Graham Pople
              Reporter:
              graham.pople Graham Pople
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes

                    PagerDuty