[英]How raft algorithm maintains strong read consistency in case of a node become leader and it have an uncommitted log entry
Consider five nodes(S1,S2,S3,S4,S5) getting key/value data.考虑五个节点(S1、S2、S3、S4、S5)获取键/值数据。 And the following steps happened
并发生了以下步骤
After above steps, client query an entry(key equal 2, just wrote succeed).经过上述步骤,客户端查询一个条目(key等于2,刚刚写成功)。 But now S1 is leader and key equal 2 entry is uncommitted.
但是现在 S1 是领导者,并且 key equal 2 条目未提交。 So, client will can't find entry that itself wrote a moment ago.
因此,客户将找不到自己刚才写的条目。 So, where I made a mistake?
那么,我在哪里做错了? please help me
请帮我
(picture 1)
(图片1)
(picture 2)
(图二)
(picture 3)
(图三)
I have found the solution at Diego Ongaro paper more detailed version In Search of an Understandable Consensus Algorithm(Extended Version) .我在 Diego Ongaro 论文中找到了解决方案更详细的版本In Search of an Understanding Consensus Algorithm(Extended Version) 。 In section 8(Client interaction), I found the answer, Raft handles this by having each leader commit a blank no-op entry into the log at the start of its term.
在第 8 节(客户端交互)中,我找到了答案, Raft 通过让每个领导者在其任期开始时向日志中提交一个空白的 no-op 条目来处理这个问题。 After this, In question S1 will commit log index equal 1 entry by commit a blank no-op entry.
在此之后,问题 S1 将通过提交一个空白的无操作条目来提交日志索引等于 1 条目。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.