smengcl commented on code in PR #4244:
URL: https://github.com/apache/ozone/pull/4244#discussion_r1106514066


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/snapshot/OMSnapshotCreateRequest.java:
##########
@@ -146,6 +149,26 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager,
               .getLatestSequenceNumber();
       snapshotInfo.setDbTxSequenceNumber(dbLatestSequenceNumber);
 
+      // Set previous path and global snapshot
+      String latestPathSnapshot =
+          snapshotChainManager.getLatestPathSnapshot(snapshotPath);
+      String latestGlobalSnapshot =
+          snapshotChainManager.getLatestGlobalSnapshot();
+
+      if (latestPathSnapshot == null || latestPathSnapshot.isEmpty()) {
+        snapshotInfo.setPathPreviousSnapshotID("");

Review Comment:
   Should we use `null` here instead? Just like in this UT:
   
   
https://github.com/apache/ozone/blob/f30c0621eafc1c7f62e7df0f2da3d11ece842e33/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestSnapshotChain.java#L114



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