szetszwo commented on code in PR #1320:
URL: https://github.com/apache/ratis/pull/1320#discussion_r2548199791
##########
ratis-server/src/main/java/org/apache/ratis/statemachine/impl/SimpleStateMachineStorage.java:
##########
@@ -89,7 +89,8 @@ static List<SingleFileSnapshotInfo>
getSingleFileSnapshotInfos(Path dir) throws
final Path filename = path.getFileName();
if (filename != null) {
final Matcher matcher = SNAPSHOT_REGEX.matcher(filename.toString());
- if (matcher.matches()) {
+ // If the file doesn't have an MD5 hash it would doesn't need to be
matched as it might be corrupted
+ if (MD5FileUtil.getDigestFileForFile(filename.toFile()).exists() &&
matcher.matches()) {
Review Comment:
Let's print a warning:
```java
if
(!MD5FileUtil.getDigestFileForFile(filename.toFile()).exists()) {
LOG.warn("MD5 file not found: Skipping the snapshot file {}",
filename);
continue;
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]