You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ratis.apache.org by andy2git <gi...@git.apache.org> on 2018/05/23 06:29:46 UTC
[GitHub] incubator-ratis pull request #2: RATIS-244. Skip snapshot file if MD5 file d...
GitHub user andy2git opened a pull request:
https://github.com/apache/incubator-ratis/pull/2
RATIS-244. Skip snapshot file if MD5 file does not exist
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/andy2git/incubator-ratis master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-ratis/pull/2.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2
----
commit 36d9459e674b4de245450c2a49991741da02cfb3
Author: Andy Wu <an...@...>
Date: 2018-05-23T06:28:30Z
RATIS-244. Skip snapshot file if MD5 does not exist
----
---
[GitHub] incubator-ratis pull request #2: RATIS-244. Skip snapshot file if MD5 file d...
Posted by andy2git <gi...@git.apache.org>.
Github user andy2git closed the pull request at:
https://github.com/apache/incubator-ratis/pull/2
---
[GitHub] incubator-ratis pull request #2: RATIS-244. Skip snapshot file if MD5 file d...
Posted by andy2git <gi...@git.apache.org>.
Github user andy2git commented on a diff in the pull request:
https://github.com/apache/incubator-ratis/pull/2#discussion_r190361776
--- Diff: ratis-server/src/main/java/org/apache/ratis/statemachine/impl/SimpleStateMachineStorage.java ---
@@ -104,7 +104,7 @@ public SingleFileSnapshotInfo findLatestSnapshot() throws IOException {
Files.newDirectoryStream(smDir.toPath())) {
for (Path path : stream) {
Matcher matcher = SNAPSHOT_REGEX.matcher(path.getFileName().toString());
- if (matcher.matches()) {
+ if (matcher.matches() && MD5FileUtil.existDigestFile(path.toFile())) {
--- End diff --
One concern I have is: do we need to delete the maybe corrupted snapshot file? If we do not purge logs, we can always replay from the commit logs.
---