-
Notifications
You must be signed in to change notification settings - Fork 400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The confusing code in example #412
Comments
The example won't propose any empty proposals. In practice, you may want to use its index and term to check whether it's a proposal proposed by raft library or yourself.
It's just an example to show how to handle committed logs. What is needed to be done depends on application logic. What raft needs is the apply progress of conf change. |
The first point, when should I care about index and term? Can you give more tips? The second point, I means is there any condition to do |
Another question... The newest version code can not pass Here is the latest logs: Dec 29 19:39:01.895 INFO Propose 100 proposals success!
Dec 29 19:39:01.895 DEBG Sending from 2 to 1, msg: msg_type: MsgAppendResponse to: 1 index: 106 commit: 106, to: 1, from: 2, raft_id: 2, tag: peer_2
Dec 29 19:39:01.896 DEBG Sending from 4 to 1, msg: msg_type: MsgAppendResponse to: 1 index: 106 commit: 106, to: 1, from: 4, raft_id: 4, tag: peer_4
Dec 29 19:39:01.901 DEBG Sending from 5 to 1, msg: msg_type: MsgAppendResponse to: 1 index: 106 commit: 106, to: 1, from: 5, raft_id: 5, tag: peer_5
Dec 29 19:39:01.903 DEBG Sending from 3 to 1, msg: msg_type: MsgAppendResponse to: 1 index: 106 commit: 106, to: 1, from: 3, raft_id: 3, tag: peer_3
Dec 29 19:39:01.904 DEBG Sending from 5 to 1, msg: msg_type: MsgHeartbeatResponse to: 1 commit: 106, to: 1, from: 5, raft_id: 5, tag: peer_5
Dec 29 19:39:01.905 DEBG Sending from 2 to 1, msg: msg_type: MsgHeartbeatResponse to: 1 commit: 106, to: 1, from: 2, raft_id: 2, tag: peer_2
Dec 29 19:39:01.907 DEBG Sending from 4 to 1, msg: msg_type: MsgHeartbeatResponse to: 1 commit: 106, to: 1, from: 4, raft_id: 4, tag: peer_4
Dec 29 19:39:01.908 DEBG Sending from 3 to 1, msg: msg_type: MsgHeartbeatResponse to: 1 commit: 106, to: 1, from: 3, raft_id: 3, tag: peer_3
Dec 29 19:39:01.910 ERRO send raft message to 1 fail, let Raft retry it
Dec 29 19:39:01.910 ERRO send raft message to 1 fail, let Raft retry it
Dec 29 19:39:01.910 ERRO send raft message to 1 fail, let Raft retry it
Dec 29 19:39:01.911 ERRO send raft message to 1 fail, let Raft retry it
Dec 29 19:39:01.911 ERRO send raft message to 1 fail, let Raft retry it
Dec 29 19:39:01.912 ERRO send raft message to 1 fail, let Raft retry it
Dec 29 19:39:01.912 ERRO send raft message to 1 fail, let Raft retry it
Dec 29 19:39:01.912 ERRO send raft message to 1 fail, let Raft retry it And the version v0.4.3, it doesn't have example git clone https://github.com/tikv/raft-rs.git -b v0.4.3 |
I can run |
the code in examples/five_mem_node/main.rs:281
--1--
, skipping one loop. And in--2--
, just popproposal
from proposals. Could it make some proposals not to reply?send(true)
directly in--2--
?The text was updated successfully, but these errors were encountered: