- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
假设一个有5个节点的集群(ABCDE),节点A一开始被选为leader,而leader-A向follower(BCDE)发出AppendEntries RPCs来复制日志条目(log-X),只有节点B接收和返回成功,此时leader-A崩溃。
如果节点 C(或 D 或 E)赢得下一次领导者选举,那么一切都很好,因为只有节点 B 有 log-X,这意味着 log-X 没有提交。
我的问题是,节点 B(拥有最高任期和最长日志)能否赢得下一次领导人选举?如果是这样,节点 B 是否会将 log-X 传播到其他节点?
最佳答案
Yes B could win the election, if it does become leader then the first thing it does it to create a log entry with the new term in its log, and start replicating its log to all the followers.由于 B 的日志包含 log-X,如果一切顺利,最终 log-X 条目将被复制并被视为已提交。
If node C wins the election, then when it becomes leader, it won't have the log-X entry, and it'll end up overwriting that entry on Node B.
参见 raft paper 的第 5.4.2 节更多细节。
这也意味着您不能将失败视为意味着尝试的条目绝对不存在,只是调用者不知道结果。第 8 节有一些处理这个问题的建议。
关于raft - Raft 可以选举一个没有提交日志的领导者吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50856934/
我有这些数据: library(tidyverse) df % summary() 我收到此错误: Error in lm.fit(x, y, offset = offset, singular
我有一个运行着 3 个实例的工作 Zookeeper 集合,还有一个带有一些 solr 实例的 solrcloud 集群。我创建了一个设置为 2 个分片的集合。然后我: create 1 core o
etcd v3 的新主要版本引入了新的并发原语。其中之一是选举。 该 api 不支持开始事件并返回(其他)获胜者,这意味着我们需要查询领导者。这使得事情变得复杂,因为现在我们有两条并发路径,一条运行事
我试图理解 etcd election api 提供的各种功能以及它们在语义上的含义。 在他们的官方文档中非常简单地提到了每个功能的作用,并且没有提供示例。例如我们有方法: func (e *Elec
我正在尝试使用 JDBC 在 spring-integration 中使用领导者选举。只要连接了数据库,它就可以工作。一旦数据库连接断开,领导者选举就会停止,该节点上的领导者信息将保持不变。 据我对代
我是一名优秀的程序员,十分优秀!