algorithm - Raft算法: When will term increase?

标签 algorithm raft

enter image description here

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.

从此paper ,我们知道任期从选举开始并且单调增加。

我的问题是任期什么时候会增加?

  1. 随着物理时间的推移,它会增加吗?例如每分钟或每小时。

  2. 与逻辑时间有关吗?

  3. 只有在新的选举发生时才会增加吗?

  4. 术语多久更改一次?

  5. 一个期限内将生成多少日志条目?

最佳答案

术语逻辑时间戳,或者在分布式系统中更普遍地称为纪元。术语更改的频率完全取决于节点和网络状况。仅当成员开始新的选举时,任期才会增加。因此,该术语将增加,例如领导者崩溃后,如果网络分区导致某些成员的选举计时器到期,网络中是否有足够的延迟使选举计时器到期,或者选举在没有获胜者的情况下结束。

关于algorithm - Raft算法: When will term increase?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52732010/

相关文章:

algorithm - 广义目标和问题

distributed-computing - Raft 共识算法是拜占庭容错(bft)算法吗?

algorithm - Raft 节点数

algorithm - 为什么或者为什么不在 Raft 实现中使用 RequestVote RPC 作为心跳?

python - 一种确定两个句子相似程度的算法

algorithm - 计算地理坐标的边界框

java - 将两个链表表示的数相加,进位值不传递给下一次计算

php - 人气,如何让新点击率高于旧点击率?

discovery - Raft 中的 Leader 地址/位置