-
Notifications
You must be signed in to change notification settings - Fork 37
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
Save term info in snapshot filename #296
Save term info in snapshot filename #296
Conversation
LGTM, except some code styles |
Please remove RaftKeeper/src/Service/SnapshotCommon.h Line 47 in f6dc73d
|
src/Service/NuRaftLogSnapshot.cpp
Outdated
#include <fcntl.h> | ||
#include <filesystem> | ||
#include <stdio.h> | ||
#include <unistd.h> | ||
|
||
#include "common/find_symbols.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use <>
src/Service/NuRaftLogSnapshot.cpp
Outdated
continue; | ||
} | ||
|
||
auto key = static_cast<uint128_t>(s_obj.log_last_term) << 64 | s_obj.log_last_index; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use getSnapshotStoreMapKey
src/Service/NuRaftLogSnapshot.h
Outdated
/// create_time, last_log_term, last_log_index, object_id | ||
static constexpr char SNAPSHOT_FILE_NAME_V1[] = "snapshot_{}_{}_{}_{}"; | ||
|
||
String time_str; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create_time
c2fc175
to
bef2a74
Compare
Which issues of this PR fixes:
This PR try to fix #4
Change log:
update SNAPSHOT_FILE_NAME from snapshot_{create_time}{last_log_index}{object_id} to snapshot_{create_time}{last_log_term}{last_log_index}_{object_id}