key = "dummy_key";
bySeqno = lastBySeqno;
break;
+ case queue_op::set_vbucket_state:
+ key = "set_vbucket_state";
+ bySeqno = lastBySeqno + 1;
+ break;
+
default:
throw std::invalid_argument("CheckpointManager::createCheckpointItem:"
"checkpoint_op (which is " +
case queue_op::empty: return "empty";
case queue_op::checkpoint_start: return "checkpoint_start";
case queue_op::checkpoint_end: return "checkpoint_end";
+ case queue_op::set_vbucket_state: return "set_vbucket_state";
}
return "<" +
std::to_string(static_cast<std::underlying_type<queue_op>::type>(op)) +
/// (meta item) Marker for the end of a checkpoint. Only exists in closed
/// checkpoints, where it is always the last item in the checkpoint.
checkpoint_end,
+
+ /// (meta item) Marker to persist the VBucket's state (vbucket_state) to
+ /// disk. No data (value) associated with it, simply acts as a marker
+ /// to ensure a non-empty persistence queue.
+ set_vbucket_state,
};
/// Return a string representation of queue_op.
* Should this item be persisted?
*/
bool shouldPersist() const {
- return !isCheckPointMetaItem();
+ switch (op) {
+ case queue_op::set:
+ case queue_op::del:
+ return true;
+ case queue_op::flush:
+ case queue_op::empty:
+ case queue_op::checkpoint_start:
+ case queue_op::checkpoint_end:
+ return false;
+ case queue_op::set_vbucket_state:
+ return true;
+ }
+ // Silence GCC warning
+ return false;
}
/*
case queue_op::empty:
case queue_op::checkpoint_start:
case queue_op::checkpoint_end:
+ case queue_op::set_vbucket_state:
return true;
}
// Silence GCC warning