swamirishi commented on code in PR #5223:
URL: https://github.com/apache/ozone/pull/5223#discussion_r1308340024


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SnapshotChainManager.java:
##########
@@ -71,7 +71,27 @@ public SnapshotChainManager(OMMetadataManager 
metadataManager) {
   private void addSnapshotGlobal(UUID snapshotID,
                                  UUID prevGlobalID) throws IOException {
     // On add snapshot, set previous snapshot entry nextSnapshotID = snapshotID

Review Comment:
   done



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SnapshotChainManager.java:
##########
@@ -71,7 +71,27 @@ public SnapshotChainManager(OMMetadataManager 
metadataManager) {
   private void addSnapshotGlobal(UUID snapshotID,
                                  UUID prevGlobalID) throws IOException {
     // On add snapshot, set previous snapshot entry nextSnapshotID = snapshotID
+    if (globalSnapshotChain.containsKey(snapshotID)) {
+      throw new IllegalStateException(String.format(
+          "Snapshot chain corruption. Snapshot with snapshotId: %s is " +
+              "already present in the the chain.", snapshotID));

Review Comment:
   done



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