How does DCP ensure high availability?

Is there any mechanism to ensure the high availability of DCP?
Such as raft or other distributed algorithms?

If all data changes are appended to DCP stream, does changes made to vBucket depends on subscribing DCP? If not, the appending to DCP action happens before vBucket commit or after vBucket commit?

Sorry, I can’t find any documentation on my questions.

Still, imagine that there is a 5 nodes cluster on which there is a bucket with 1 replica, if 2 nodes failed, will some vBuckets unavailable?

Hi Jayden,

My impression is that DCP is primarily responsible for getting data from one place to another. Tasks like coordinating durable writes and deciding which replicas to promote after a failover are handled by a different protocol. (I’m not an expert in that area, so maybe someone will jump in and correct me.)

You can browse the DCP reference documentation to get a sense of its capabilities. Just be aware that Couchbase does not generally support DCP as a way for users to interact with the cluster.

A write is pushed to DCP consumers as soon as the write’s durability requirements are satisfied. For non-durable writes, this means the event is pushed to DCP as soon as it is present in memory on the vbucket’s active node. For durable writes, a separate protocol ensures the write is propagated to the required locations, then the event is pushed to DCP.

If you’re curious about what happens when a node fails, the documentation on Clusters and Availability is a good starting point.