Details
-
Bug
-
Resolution: Duplicate
-
Major
-
6.5.0
-
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:
- frontend queues a set-vbstate(active) item into the CheckpointManager
- 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
- 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
- now the flusher executes from line 594 and skips the block, as it reads (VBucket::state = replica)