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

API to get all the xattrs for a given document, along with its body

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • Morpheus
    • Morpheus
    • couchbase-bucket
    • None
    • 0

    Description

      Before MB-58989, XDCR just fetched the target document metadata for source-side conflict resolution. But with MB-58989, we need to "log" (store in a bucket), both the source document and the target document, involved in a conflict, along with their metadata.
      For milestone-1/phase-1 of the project, this is how we do it:
      1. Fetch the target document metadata using subdoc lookup on selected vxattrs and system xattrs. If the logging feature is turned on, get the XTOC vxattr in the same call.
      2. Perform conflict resolution using the details fetched in (1).
      3. If (2) doesn't detect a conflict, we are done.
      4. If (2) detects a conflict: Parse the XTOC result obtained in (1), compose another subdoc lookup with all the xattr keys in XTOC and one compulsory spec for document body. This is done with subdoc lookup with command.CAS set to response.CAS returned by (1).
      5. If we get KEY_EEXISTS or KEY_ENOENT, go to (1) and retry everything.
      6. Otherwise, log the results and we are done.

      As I understand there is a limit on number of lookup paths as 16. One path is always guaranteed to be document body. That leaves us with 15 xattr paths. With this context I have a couple of questions and hence creating this MB for tracking purposes:
      1. Is the above described steps the most optimal way to get all the xattrs + document body right now? If yes, does it affect target KV performance by a lot in addition to XDCR performance hit due to XTOC parsing, retries etc.
      2. Will there be a scope for new improvement wherein the document body and xattr section will be returned with a single API? Or a new vxattr for subdoc lookup, say $body whose response will be a combination of both document body and xattrs.

      Attachments

        Issue Links

          For Gerrit Dashboard: MB-63201
          # Subject Branch Project Status CR V

          Activity

            People

              trond Trond Norbye
              sumukh.bhat Sumukh Bhat
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There is 1 open Gerrit change

                  PagerDuty