peterxcli commented on code in PR #11032:
URL: https://github.com/apache/ozone/pull/11032#discussion_r3870147098


##########
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:
   The current fix is sufficient: after this PR, a snapshot without MD5 can 
only be ignored because it was written before the upgrade, and older MD5 files 
cannot be used to compare with newer ones.
   
   see: 
https://github.com/apache/ratis/blob/4f4d3504f36151085d32224a200f23b3eae8d472/ratis-server/src/main/java/org/apache/ratis/statemachine/impl/SimpleStateMachineStorage.java#L203-L217



-- 
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]

Reply via email to