Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-13645 Implement Sub-document API in memcached
  3. MB-17842

[Subdoc] Allow multi-mutations to include a result body in response

    XMLWordPrintable

Details

    • Technical task
    • Resolution: Fixed
    • Major
    • 4.5.0
    • feature-backlog
    • memcached
    • Security Level: Public

    Description

      After discussions with the SDK team, we have decided to change the encoding of multi-path mutation responses to include a result body.

      The rationale for this is to more correctly support the existing SUBDOC_COUNTER command when part of a multi-path mutation, and to allow future enhancements to subdoc (such as other value-returning mutations - maybe POP) without having to change the binary protocol.

      Currently, no value is returned for multi-path mutations - on success you get an empty body, on failure you get a body containing the

      {status, index}

      of the first failed path.

      Instead, we will adjust the return value from multi_mutation to consist of a variable number of multi_mutation_result_spec_s:

      • On failure, exactly one result_spec is returned (3 bytes):

        struct {
            uint8_t index;
            uint16_t status;
        } __attribute__((packed));
        

      (Note the index and status order is flipped, compared to the existing encoding).

      • On success, zero to N result_specs are returned, one for each multi-path mutation which returns a value. Each is at least 7 bytes, plus the resultlen:

        struct {
            uint8_t index;
            uint16_t status;
            uint32_t resultlen;
            uint8_t result[resultlen];
        } __attribute__((packed));
        

      See protocol spec (https://docs.google.com/document/d/1A7BVqLGaQurK0lb16-1LiRfViMfsvUcw0lgaMK7anIk/edit#) for full details.

      Attachments

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

        Activity

          People

            drigby Dave Rigby (Inactive)
            drigby Dave Rigby (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty