Skip to content

Commit

Permalink
Attach addition context to every proposals (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
overvenus authored and BusyJay committed May 14, 2018
1 parent a362370 commit a874d93
Show file tree
Hide file tree
Showing 5 changed files with 271 additions and 214 deletions.
2 changes: 1 addition & 1 deletion examples/single_mem_node/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ fn main() {
match receiver.recv_timeout(timeout) {
Ok(Msg::Propose { id, cb }) => {
cbs.insert(id, cb);
r.propose(vec![id], false).unwrap();
r.propose(vec![], vec![id]).unwrap();
}
Ok(Msg::Raft(m)) => r.step(m).unwrap(),
Err(RecvTimeoutError::Timeout) => (),
Expand Down
4 changes: 4 additions & 0 deletions proto/eraftpb.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ message Entry {
uint64 term = 2;
uint64 index = 3;
bytes data = 4;
bytes context = 6;

// Deprecated! It is kept for backward compatibility.
// TODO: remove it in the next major release.
bool sync_log = 5;
}

Expand Down
Loading

0 comments on commit a874d93

Please sign in to comment.