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

Flusher initializes the vbstate range based on VBucket::state

    XMLWordPrintable

Details

    • Triaged
    • No

    Description

      The flusher should persist the new vbstate on disk based only on the information retrieved from the disk queue.
      Issue already faced and partially addressed inĀ MB-35331.

      Code at EPBucket::flushVBucket() (http://src.couchbase.org/source/xref/mad-hatter/kv_engine/engines/ep/src/ep_bucket.cc#594-599):

      594                  folly::SharedMutex::ReadHolder rlh(vb->getStateLock());
      595                  if (vb->getState() == vbucket_state_active) {
      596                      if (maxSeqno) {
      597                          range = snapshot_range_t(maxSeqno, maxSeqno);
      598                      }
      599                  }
      

      Example:

      1. frontend queues a set-vbstate(active) item into the CheckpointManager
      2. flusher pulls that item from the CM and initializes the new vbstate to persist -> note that the flusher should initialize the range as per new-vb-state=active
      3. before the flusher executes line 594, the frontend processes a new set-vbstate(replica) -> VBucket::state is set to replica immediately and a new set-vbstate(replica) items is queued into the CM
      4. now the flusher executes from line 594 and skips the block, as it reads (VBucket::state = replica)

      Attachments

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

        Activity

          People

            paolo.cocchi Paolo Cocchi
            paolo.cocchi Paolo Cocchi
            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