xraft
xraft copied to clipboard
xnnyygn's raft implementation
Running `bin/xraft-kvstore -gc A,localhost,2333 B,localhost,2334 C,localhost,2335 -m group-member -i A -p2 3333` inside xraft/xraft-kvstore/src subdirectory results in following error: ls: ./lib: No such file or directory Error: -cp requires class...
Here the candidate should store the message sender, i.e., current leader, in votedFor. https://github.com/xnnyygn/xraft/blob/3442abcf0c54d631e10d44df577771d27138de74/xraft-core/src/main/java/in/xnnyygn/xraft/core/node/NodeImpl.java#L611 This issue can result in two leader with the same term in the following complex scenario....
https://github.com/xnnyygn/xraft/blob/3442abcf0c54d631e10d44df577771d27138de74/xraft-core/src/main/java/in/xnnyygn/xraft/core/log/sequence/FileEntrySequence.java#L208 如果数据文件已经被截断了,但索引文件尚未被更新,就会发生不一致。 所以我认为应该先保存 offset,然后清理索引,再清理数据。
I notice that the message RequestVoteResult does not contains a field for distinguishing which node the result is from. Besides, when processing RequestVoteResult, the node only checks the count of...
See [issue 27](https://github.com/xnnyygn/xraft/issues/27). I add a field replyNode in RequestVoteResult, and maintain a set votesGranted in NodeImpl for recording which nodes already votes. Besides, I add a test case.
假设有节点 1,2,3,4,5 1 是leader 客户端写入一条消息 leader成功同步给2,3 两个节点(此时未提交日志保存在内存中) leader 增加commitIndex 并提交日志(还未同步给2,3) 假设这个时候 节点1下线,节点2重启(内存中未提交的日志不存在了) 接下来的选举节点2成为leader(是可以的,因为4,5节点会支持) 这个时候会导致之前上一个term节点1已提交的日志被推翻.
这里描述的不是term一致的情况吗,为什么多个节点以不同term启动,candidate角色发送消息到比自己term大的follower角色中,此时还会比较日志来决定是否投票?
跑xraft-kvstore时报错是为什么
While trying to build the source code, execute this command: `cd xraft-kvstore && mvn package assembly:single` I got this error: ``` [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total...