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

Don't store the xattrs appended to the MetaData when using Rift (expirations/deletions)

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Done
    • Trivial
    • 6.6.0
    • 6.6.0
    • tools

    Description

      When storing expirations/deletions in the Rift data store, we first call 'PackMetaData' to pack the documents meta data; this function accepts the documents value as an argument (for a deletion the documents value is "technically" empty, the value we are packing here is actually the xattrs).

      What's wrong with this?
      In short, nothing, this is the way we store the xattrs for deletions in ForestDB and SQLite; in these store formats, it made sense for the xattrs to be stored with the meta data because:
      1) In SQLite a deletion/expirations column is forcefully set to a null value.
      2) I'm sure there was a reason that we did this for ForestDB (it was the first storage format for cbbackupmgr and ultimately was the reason we chose to store the xattrs appended to the documents metadata).

      Because of the way the Rift binary data store works, the data that gets stored on disk is identical in both the situations below:
      1) xattrs appended to document meta and written to data store
      2) meta is written as per-usual - value (which is only the xattrs because document is a deletion) is also written as per-usual.

      Why bother change it if it's identical?
      Well... one should be faster and more memory efficient than the other; when appending the xattrs to the metadata, we are allocating enough memory to store the xattrs again, then we are doing a 1:1 copy of the xattrs. The cost of doing to per expiration/deletion could be "fairly" high (not to mention the extra work we are making the garbage collector do).

      Attachments

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

        Activity

          People

            james.lee James Lee
            james.lee James Lee
            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