筏算法:术语何时增加? [英] Raft algorithm: When will term increase?

查看:92
本文介绍了筏算法:术语何时增加?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


筏将时间分为任意长度,如图所示5.术语用连续的整数编号。每个学期都以选举开始,在选举中,一个或多个候选人试图按照5.2节中的描述成为领导者。如果候选人在选举中获胜,则它将在剩余任期中担任领导职务。在某些情况下,选举将导致投票分裂。在这种情况下,任期将以无领导者结束;一个新的任期(将进行一次新的选举)将很快开始。 Raft确保在一个给定术语中最多有一位领导者。

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.

术语在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?


  1. 超过体力时间会增加吗?例如每分钟或每小时。

  1. 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.

这篇关于筏算法:术语何时增加?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆