amaliujia commented on code in PR #11032:
URL: https://github.com/apache/ozone/pull/11032#discussion_r3877576278
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/ContainerStateMachine.java:
##########
@@ -434,6 +437,9 @@ public long takeSnapshot() throws IOException {
snapshotFile);
throw ioe;
}
+ final MD5Hash md5 = MD5FileUtil.computeAndSaveMd5ForFile(snapshotFile);
+ final FileInfo fileInfo = new FileInfo(snapshotFile.toPath(), md5);
+ storage.updateLatestSnapshot(new SingleFileSnapshotInfo(fileInfo, ti));
Review Comment:
@peterxcli actually I think you give a great hint: we only need to consider
backward compatibility. If the Ratis snapshot changes are backward compatible,
we do not need a off/on config.
More specifically, I looked at the changes in
https://github.com/apache/ratis/pull/1320, and as far as I can tell:
1. changes for `getSingleFileSnapshotInfos` and `findLatestSnapshot` are
fine.
2. but changes in `cleanupOldSnapshots` is not.
I will send a change to Ratis side about `cleanupOldSnapshots`. Meanwhile,
we only need adding MD5 files now when taking the snapshot on Ozone side (which
is the current proposed fix in this PR).
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]