educative.io

Merge protocol quorum-based commit protocol: Does it need to elect the leader from both of the partitions that are merged?

The merge protocol is simple. It includes a leader election amongst the leaders of the two partitions that are merged, and then the execution of the termination protocol we described.

Does it need to elect the leader from both of the partitions that are merged? I saw in the example merge protocol elected 2 leaders from 2 partitions.

Hi @Duy_Le !!
In the merge protocol, when two partitions are merged, a leader election takes place among the leaders of the two partitions. This means that both partitions will have their own leaders initially. Once the merge occurs, a new leader needs to be elected from among the leaders of the merged partitions. This ensures that there is a single leader responsible for coordinating the merged partition and executing the termination protocol. In the example, where two partitions are being merged, it is expected to have two leaders initially, but after the merge, a new leader will be elected to manage the merged partition.
I hope it helps. Happy Learning :blush: