From 3712dea6b941aef4ec5bb38eb7d752228d894e22 Mon Sep 17 00:00:00 2001 From: oocococo <39755142+oocococo@users.noreply.github.com> Date: Mon, 6 Dec 2021 14:17:03 +0800 Subject: [PATCH] fix a typo, to make p2c guideline more readable (#331) * fix typo --- doc/project2-RaftKV.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/project2-RaftKV.md b/doc/project2-RaftKV.md index 47b5ba00..7a802228 100644 --- a/doc/project2-RaftKV.md +++ b/doc/project2-RaftKV.md @@ -213,8 +213,8 @@ All you need to change is based on the code written in part A and part B. ### Implement in Raft -Although we need some different handling for Snapshot messages, in the perspective of raft algorithm there should be no difference. See the definition of `eraftpb.Snapshot` in the proto file, the `data` field on `eraftpb.Snapshot` does not represent the actual state machine data but some metadata is used for the upper application you can ignore it for now. When the leader needs to send a Snapshot message to a follower, it can call `Storage.Snapshot()` to get a `eraftpb.Snapshot`, then send the snapshot message like other raft messages. How the state machine data is actually built and sent are implemented by the raftstore, it will be introduced in the next step. You can assume that once `Storage.Snapshot()` returns successfully, it’s safe for Raft leader to the snapshot message to the follower, and follower should call `handleSnapshot` to handle it, which namely just restore the raft internal state like the term, commit index and membership information, etc, from the -`eraftpb.SnapshotMetadata` in the message, after that, the procedure of snapshot handling is finish. +Although we need some different handling for Snapshot messages, in the perspective of raft algorithm there should be no difference. See the definition of `eraftpb.Snapshot` in the proto file, the `data` field on `eraftpb.Snapshot` does not represent the actual state machine data, but some metadata is used by the upper application which you can ignore for now. When the leader needs to send a Snapshot message to a follower, it can call `Storage.Snapshot()` to get a `eraftpb.Snapshot`, then send the snapshot message like other raft messages. How the state machine data is actually built and sent are implemented by the raftstore, it will be introduced in the next step. You can assume that once `Storage.Snapshot()` returns successfully, it’s safe for Raft leader to send the snapshot message to the follower, and follower should call `handleSnapshot` to handle it, which namely just restore the raft internal state like the term, commit index and membership information, etc, from the +`eraftpb.SnapshotMetadata` in the message, after that, the procedure of snapshot handling is finished. ### Implement in raftstore