(feat) Snapshot file to interrupt concurrent transmission(#503) #632
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation:
快照在网络传输过程中可能由于各种原因导致传输中断的问题,此改动增加了大文件并行传输和断点续传的功能
Modification:
设计思路:
1.首先leader在InstallSnapshot流程中的loadMetaTable的时候计算快照文件的分片数目,将快照文件的分片数据放入LocalFileMeta
传输给follower。
2.follower获取到LocalFileMeta,取其中的文件名,然后查看本机是否有已接收的快照分片段,将各个快照分片段的文件大小并行
传输给leader。
3.leader接收到follower的GetFileRequest,从指定的文件断点位置传输数据。
4.所有的快照分片传输完毕,将分片合并,合并完成后删除掉分片文件。
Result:
Fixes #503