arp7 commented on a change in pull request #948: HDDS-1649. On installSnapshot notification from OM leader, download checkpoint and reload OM state URL: https://github.com/apache/hadoop/pull/948#discussion_r293597766
########## File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerStateMachine.java ########## @@ -171,6 +168,22 @@ public long takeSnapshot() throws IOException { return 0; } + /** + * Leader OM has purged entries from its log. To catch up, OM must download + * the latest checkpoint from the leader OM and install it. + * @param firstTermIndexInLog TermIndex of the first append entry available + * in the Leader's log. + * @return the last term index included in the installed snapshot. + */ + public CompletableFuture<TermIndex> notifyInstallSnapshotFromLeader( + TermIndex firstTermIndexInLog) { + // TODO: Raft server should send the leaderId + String leaderId = null; + CompletableFuture<TermIndex> future = CompletableFuture + .supplyAsync(() -> ozoneManager.installSnapshot(leaderId)); Review comment: We should not execute this in the default ForkJoinPool. That can suffer from thread exhaustion/deadlock issues since there are very few threads in the default pool. Instead use the overload of `supplyAsync` that accepts an `Executor`. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org