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

queueDirty: Process a StoredValue that is a CommittedViaPrepare but has no durability-context:

    XMLWordPrintable

Details

    • Triaged
    • 1
    • No
    • KV 2021-Oct-21, KV 2021-Nov

    Description

      We have an issue relating to expiring a CommittedViaPrepare when we also have xattrs.
      The case observed is a crash in queueDirty due to processing a CommittedViaPrepare that has no durability-context.

      TTL triggers when we fetch a doc.
      In VBucket::processExpiredItem we set onlyMarkDeleted to true in the following case:

      bool onlyMarkDeleted = value && mcbp::datatype::is_xattr(v.getDatatype()); 
      

      We then call HT::unlocked_softDelete() which has the following code:

          if (onlyMarkDeleted) {
              v.markDeleted(delSource);
          } else {
          v.del(delSource);
          // As part of deleting, set committedState to CommittedViaMutation -
          // this is necessary so when we later queue this SV into
          // CheckpoitnManager, if if was previously CommittedViaPrepare it
          // isn't mis-interpreted for a SyncDelete.
          v.setCommitted(CommittedState::CommittedViaMutation);
          }
      

      So we don't end up calling setCommitted
      This means when we call queueDirty() we crash here:

        Expects(ctx.durability.is_initialized());
      

      Or in newer code (using std::optional)

        Expects(ctx.durability.has_value());
      

      Attachments

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

        Activity

          People

            ashwin.govindarajulu Ashwin Govindarajulu
            owend Daniel Owen
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There is 1 open Gerrit change

                PagerDuty