You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@celeborn.apache.org by GitBox <gi...@apache.org> on 2022/11/23 07:02:12 UTC

[GitHub] [incubator-celeborn] SzyWilliam commented on a diff in pull request #996: [CELEBORN-44][BUG] StateMachine not update currentSnapshot after takeSnapshot cause getLatestSnapshot return null

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: dev-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org