Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Snapshot save & load #238

Merged

Conversation

dingxiaoshuai123
Copy link
Collaborator

@dingxiaoshuai123 dingxiaoshuai123 commented Mar 26, 2024

1 、增加了 snapshot save 和 snapshot load 。
1)在 save_snapshot 中, 持有 Storage 读锁的情况下, 创建 chenckpoint 并保存在 braft 指定的 snaoshot 目录下.
2)snapshot_load 中, 持有 Storage 写锁的情况下, 将 checkpoint 中的数据拷贝一份到 DB 目录中, 并重新打开 DB. (对于 sst 文件,创建 hard link ,其他文件,copy).
3)、实验: 提拱了 save_load.sh 运行之后检查 leader 和 follower 文件的数据是否符合预期。
2、提供了 DOSNAPSHOT 命令, 手动触发 barft 创建快照.

image

@github-actions github-actions bot added Invalid PR Title ✏️ Feature New feature or request labels Mar 26, 2024
@panlei-coder panlei-coder changed the title feature: Snapshot save & load feat: Snapshot save & load Mar 26, 2024
src/praft/praft.cc Outdated Show resolved Hide resolved
src/db.cpp Outdated Show resolved Hide resolved
src/store.cc Outdated Show resolved Hide resolved
@Mixficsol Mixficsol mentioned this pull request Apr 15, 2024
21 tasks
src/db.cc Outdated Show resolved Hide resolved
src/praft/praft.cc Outdated Show resolved Hide resolved
src/praft/praft.cc Outdated Show resolved Hide resolved
src/praft/praft.h Outdated Show resolved Hide resolved
@dingxiaoshuai123 dingxiaoshuai123 marked this pull request as ready for review April 21, 2024 07:18
src/store.cc Outdated Show resolved Hide resolved
src/pstd/pstd_string.h Outdated Show resolved Hide resolved
src/storage/include/storage/storage.h Outdated Show resolved Hide resolved
src/db.cc Outdated Show resolved Hide resolved
src/praft/praft.cc Outdated Show resolved Hide resolved
src/store.h Outdated Show resolved Hide resolved
src/store.h Outdated Show resolved Hide resolved
@dingxiaoshuai123 dingxiaoshuai123 merged commit 3411495 into OpenAtomFoundation:import-braft Apr 22, 2024
5 checks passed
@dingxiaoshuai123 dingxiaoshuai123 deleted the snapshot branch April 22, 2024 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✏️ Feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants