chungen0126 commented on code in PR #11086:
URL: https://github.com/apache/ozone/pull/11086#discussion_r3836466956


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerStateMachine.java:
##########
@@ -634,7 +634,12 @@ public CompletableFuture<TermIndex> 
notifyInstallSnapshotFromLeader(
     return CompletableFuture.supplyAsync(
         () -> {
           try {
-            return ozoneManager.installSnapshotFromLeader(leaderNodeId);
+            TermIndex termIndex = 
ozoneManager.installSnapshotFromLeader(leaderNodeId);
+            if (termIndex == null) {
+              throw new CompletionException(
+                  new IOException("Failed to install snapshot from OM leader " 
+ leaderNodeId));
+            }
+            return termIndex;

Review Comment:
   I don't think this is the correct approach. A `null` return value for 
`termIndex` shouldn't always result in an exception.



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