Questions about TinyKV 2AA

Two Questions.

  1. 这是我想通过的第一个测试

    Expect的过程是否是这样:tt.send(MsgHup)到1号Node后,1号Node开始Request Vote并更新Term,如果它能收到Majority Votes则成为Leader(nopStepper自己永不投票)?要求里说我们不需要在这个阶段考虑sending and receiving message(see you don’t need to care about the message sending and receiving logic now. ),所以整个过程应该是怎么样的呢?

  2. Can not find bcastAppend method described in doc.go

是的,nopStepper 是一个黑洞,不会返回任何响应。

不需要考虑消息具体是怎么发送和接收,要发送一个消息只需要把消息 appendraft.Raft.msgs,而接收到的消息则会作为参数传入 raft.Raft.Step(),可以在这个函数中调用处理该消息的具体函数(handleHeartbeat, handleAppendEntries, etc),更多细节可以看 https://github.com/pingcap-incubator/tinykv/blob/course/doc/project2-RaftKV.md#leader-election

Sorry about the doc.go is stale, and we will update it soon.