0XFF-96 / tinykv

A course to build distributed key-value service based on TiKV model
0 stars 0 forks source link

Project2-Code #9

Open 0XFF-96 opened 2 years ago

0XFF-96 commented 2 years ago

Project2aa

2AA Test 模块 【✅】【done】

回顾代码

通过回顾代码,我发现 2aa 的实现关键点在于以下函数

0XFF-96 commented 2 years ago

Project2ab

对应论文 Reference: section 5.3 的测试点

TestLeaderStartReplication2AB

// TestLeaderStartReplication tests that when receiving client proposals,
// the leader appends the proposal to its log as a new entry, then issues
// AppendEntries RPCs in parallel to each of the other servers to replicate
// the entry. Also, when sending an AppendEntries RPC, the leader includes
// the index and term of the entry in its log that immediately precedes
// the new entries.
// Also, it writes the new entry into stable storage.

TestLeaderCommitEntry2AB

// TestLeaderCommitEntry tests that when the entry has been safely replicated,
// the leader gives out the applied entries, which can be applied to its state
// machine.
// Also, the leader keeps track of the highest index it knows to be committed,
// and it includes that index in future AppendEntries RPCs so that the other
// servers eventually find out.

'MessageType_MsgAppendResponse' is response to log replication request('MessageType_MsgAppend')