问题描述
术语在Raft中充当逻辑时钟[14],它们允许服务器检测过时的信息,例如作为过时的领导人。 每个服务器存储一个当前的术语号,该术语号随时间单调增加。
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?
-
超过体力时间会增加吗?例如每分钟或每小时。
Does it increase when over physical time? e.g. every minute, or every hour.
这与逻辑时间有关吗?
Is it relating to logical time?
只在新选举发生时才增加吗?
Does it only increase when new election happens?
任期多久更改一次?
一个术语内将生成多少个日志条目?
How many log entries will be generated within a term?
推荐答案
术语是逻辑时间戳,或者在分布式系统中通常称为 epoch 。术语更改的频率完全取决于节点和网络条件。仅当成员开始新的选举时,条款才增加。因此,该术语将增加,例如领导者崩溃后,如果网络分区导致某些成员的选举计时器期满,或者网络中是否有足够的延迟使选举计时器到期,或者选举在没有获胜者的情况下结束。
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.
这篇关于筏算法:术语何时增加?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!