Leader election for paxos-based replicated key value store

后端 未结 2 460
天涯浪人
天涯浪人 2021-02-09 14:58

I am going to implement a key value store with multi Paxos. I would have several nodes, one of which is the primary node. This primary node receive update requests and replicate

2条回答
  •  借酒劲吻你
    2021-02-09 15:28

    You can solve this with a parallel multi-paxos instance to manage the configuration of your cluster. Consider a replicated JSON object that's updated via multi-paxos contains the following information:

    • Serial number
    • Current leader ID
    • Timestamp of current leader's lease expiration
    • List of peer ids

    You can use a stock paxos implementation and put all of the necessary logic in your networking layer:

    • Drop all Prepare and Accept messages received from any node other than the leader until the lease expires.
    • Proactively bump the serial number and your leader's lease time shortly before lease expiry.

提交回复
热议问题