return ENGINE_NOT_MY_VBUCKET;
}
- if (vb->isBackfillPhase()) {
+ if (vb->checkpointManager.getOpenCheckpointId() == 0) {
LOG(EXTENSION_LOG_WARNING, "%s (vb %d) Stream request failed because "
"this vbucket is in backfill state", logHeader(), vbucket);
return ENGINE_TMPFAIL;
vb->checkpointManager.setBackfillPhase(cur_snapshot_start.load(),
cur_snapshot_end.load());
} else {
- if (marker->getFlags() & MARKER_FLAG_CHK || vb->isBackfillPhase()) {
- // Instead of checking isBackfillPhase() an earlier patch
- // http://review.couchbase.org/#/c/39960/ changed the check
- // to (vb->checkpointManager.getOpenCheckpointId() == 0).
- // This change has been reverted in favor of using the
- // isBackfillPhase() check as it is believed to be safer and
- // makes the logic easier to understand. However if an
- // issues such as that seen in MB-11786 occurs then it maybe
- // worth investigating the impact of changing the check to
- // use (vb->checkpointManager.getOpenCheckpointId() == 0)
+ if (marker->getFlags() & MARKER_FLAG_CHK ||
+ vb->checkpointManager.getOpenCheckpointId() == 0) {
vb->checkpointManager.createSnapshot(cur_snapshot_start.load(),
cur_snapshot_end.load());
} else {
vb->checkpointManager.clear(vb, result.highSeqno);
vb->setPersistedSnapshot(result.snapStartSeqno, result.snapEndSeqno);
vb->incrRollbackItemCount(prevHighSeqno - result.highSeqno);
- vb->setBackfillPhase(false);
return ENGINE_SUCCESS;
}
}
* vbucket was in backfilling state. This caused the producer stream
* request to be stuck waiting for backfilling to complete.
*/
-TEST_P(RollbackTest, MB21784) {
+TEST_P(RollbackTest, DISABLED_MB21784) {
// Make the vbucket a replica
store->setVBucketState(vbid, vbucket_state_replica, false);
// Perform a rollback