SzyWilliam commented on code in PR #996:
URL: 
https://github.com/apache/incubator-celeborn/pull/996#discussion_r1030087597


##########
master/src/main/java/org/apache/celeborn/service/deploy/master/clustermeta/ha/StateMachine.java:
##########
@@ -344,6 +344,7 @@ public long takeSnapshot() {
         LOG.warn("Failed to rename snapshot from {} to {}.", tempFile, 
snapshotFile);
         return RaftLog.INVALID_LOG_INDEX;
       }
+      storage.loadLatestSnapshot();

Review Comment:
   `StateMachine`'s `getLatestSnapshot` is called every turn when `LogAppender` 
sends `AppendEntries`, see 
https://github.com/apache/ratis/blob/729d3dce220f352a720cbe38d0762399b6e55f06/ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java#L154.
   `loadSnapshot` is a heavy operation, since it will scan the file system and 
uses regular expressions. If we move this method to `getLatestSnapshot`, it 
maybe a performance problem. What do you think?



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

Reply via email to