Raft algorithm: When will term increase?

前提是你 提交于 2019-12-11 04:27:07

问题


Raft divides time into terms of arbitrary length, as shown in Figure 5. Terms are numbered with consecutive integers. Each term begins with an election, in which one or more candidates attempt to become leader as described in Section 5.2. If a candidate wins the election, then it serves as leader for the rest of the term. In some situations an election will result in a split vote. In this case the term will end with no leader; a new term (with a new election) will begin shortly. Raft ensures that there is at most one leader in a given term.

Terms act as a logical clock [14] in Raft, and they allow servers to detect obsolete information such as stale leaders. Each server stores a current term number, which increases monotonically over time.

From this paper, we got know term begins with an election and increase monotonically.

My question is when will term increase?

  1. Does it increase when over physical time? e.g. every minute, or every hour.

  2. Is it relating to logical time?

  3. Does it only increase when new election happens?

  4. How frequently will term change?

  5. How many log entries will be generated within a term?


回答1:


The term is a logical timestamp, or what’s more generally referred to in distributed systems as an epoch. The frequency with which terms change is entirely dependent on node and network conditions. Terms are incremented only when a member starts a new election. So, the term will be incremented e.g. after a leader crashes, if a network partition leads to some members’ election timers expiring, if there’s enough latency in the network to expire election timers, or if an election ends without a winner.



来源:https://stackoverflow.com/questions/52732010/raft-algorithm-when-will-term-increase

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!