-
Changed: 954c67a9 InstallSnapshotRequest: merge last_included{term,index} into last_included; by drdr xp; 2021-07-08
-
Changed: 933e0b32 use snapshot-id to identify a snapshot stream; by drdr xp; 2021-07-09
A snapshot stream should be identified by some id, since the server end should not assume messages are arrived in the correct order. Without an id, two
install_snapshot
request belonging to different snapshot data may corrupt the snapshot data, explicitly or even worse, silently.-
Add SnapshotId to identify a snapshot stream.
-
Add SnapshotSegmentId to identify a segment in a snapshot stream.
-
Add field
snapshot_id
to snapshot related data structures. -
Add error
RaftError::SnapshotMismatch
. -
Storage::create_snapshot()
does not need to return and id. Since the receiving end only keeps one snapshot stream session at most. Instead,Storage::do_log_compaction()
should build a unique id everytime it is called. -
When the raft node receives an
install_snapshot
request, the id must match to continue. A request with a different id should be rejected. A new id with offset=0 indicates the sender has started a new stream. In this case, the old unfinished stream is dropped and cleaned. -
Add test for
install_snapshot
API.
-
-
Changed: 85859d07 CurrentSnapshotData: merge
term
andindex
intoincluded
.; by drdr xp; 2021-07-09 -
Changed: 5eb9d3af RaftCore: replace
snapshot_index
withsnapshot_last_included: LogId
. Keep tracks of both snapshot last log term and index.; by drdr xp; 2021-07-09Also
SnapshotUpdate::SnapshotComplete
now contains an LogId instead of an u64 index. -
Changed: 9c5f3d7e RaftCore: merge last_log_{term,index} into last_log: LogId; by drdr xp; 2021-07-09
-
Changed: 58d8e3a2 AppendEntriesRequest: merge prev_log_{term,index} into prev_log: LogId; by drdr xp; 2021-07-10
-
Changed: 9e4fb64f InitialState: last_log_{term,index} into last_log: LogId; by drdr xp; 2021-07-10
-
Changed: 24e38130 Entry: merge term and index to log_id: LogId; by drdr xp; 2021-07-11
-
Added: 8e0b0df9 report snapshot metrics to RaftMetrics::snapshot, which is a LogId: (term, index) that a snapshot includes; by drdr xp; 2021-07-09
- Add:
Wait.snapshot()
to watch snapshot changes. - Test: replace
sleep()
withwait_for_snapshot()
to speed up tests.
- Add: