RATIS-1479.Make the min gap to take snapshot configurable#572
RATIS-1479.Make the min gap to take snapshot configurable#572szetszwo merged 3 commits intoapache:masterfrom
Conversation
|
The CI test error seems to have nothing to do with this code change. |
szetszwo
left a comment
There was a problem hiding this comment.
@codings-dan , thanks for working on this. Just have some comment on the conf.
/** The log index gap between to two snapshot creations. */
String CREATION_GAP_KEY = PREFIX + ".creation.gap";
long CREATION_GAP_DEFAULT = 1024;
static long creationGap(RaftProperties properties) {
return getLong(properties::getLong,
CREATION_GAP_KEY, CREATION_GAP_DEFAULT, getDefaultLog(), requireMin(1L));
}
static void setCreationGap(RaftProperties properties, long minGapTakeSnapshot) {
setLong(properties::setLong, CREATION_GAP_KEY, minGapTakeSnapshot);
}
BTW, we should replace the term "takeSanpshot" with "createSnapshot" since file systems (e.g. HDFS) use the term "create". Also, we may have "creation gap", "creation time", etc.
See if you want to do the rename in this pull request.
| } | ||
|
|
||
| /** min gap to take snapshot async */ | ||
| String MIN_GAP_TAKE_SNAPSHOT_KEY = PREFIX + ".min.gap.takeSnapshot"; |
There was a problem hiding this comment.
Let's call it "creation.gap".
|
|
||
| /** min gap to take snapshot async */ | ||
| String MIN_GAP_TAKE_SNAPSHOT_KEY = PREFIX + ".min.gap.takeSnapshot"; | ||
| long MIN_GAP_TAKE_SNAPSHOT_DEFAULT = 5; |
There was a problem hiding this comment.
The default should be larger. How about 1024?
| static long minGapTakeSnapshot(RaftProperties properties) { | ||
| return getLong( | ||
| properties::getLong, MIN_GAP_TAKE_SNAPSHOT_KEY, MIN_GAP_TAKE_SNAPSHOT_DEFAULT, | ||
| getDefaultLog(), requireMin(5L)); |
|
@szetszwo Thanks for reviewing the code, I don’t know much about the term on the file system. In Alluxio, it’s called takesnapshot/checkpoint. I have changed the code according to your comment. In addition, 1024 is really a good number, haha |
szetszwo
left a comment
There was a problem hiding this comment.
+1 the change looks good.
@codings-dan , Good to know. Thanks. |
What changes were proposed in this pull request?
subtask of Support snapshot command: Make the min gap to take snapshot configurable
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/RATIS-1479
How was this patch tested?
UT