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

            There are no commits yet on this issue.

              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