duongkame commented on code in PR #4525:
URL: https://github.com/apache/ozone/pull/4525#discussion_r1164477179
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/snapshot/OMSnapshotCreateRequest.java:
##########
@@ -215,5 +230,21 @@ public OMClientResponse
validateAndUpdateCache(OzoneManager ozoneManager,
}
return omClientResponse;
}
-
+
+ /**
+ * Removes the snapshot from the SnapshotChainManager.
+ */
+ private void removeSnapshotInfoFromSnapshotChainManager(
+ SnapshotChainManager snapshotChainManager,
+ SnapshotInfo info
+ ) {
+ try {
+ snapshotChainManager.deleteSnapshot(info);
+ } catch (IOException exception) {
+ LOG.warn("Failed to remove snapshot: {} from SnapshotChainManager.",
+ info, exception);
+ throw new IllegalStateException("Snapshot chain manager is corrupted.",
Review Comment:
We should not throw here. This method cleans up garbage when an exception
creates a snapshot. If the error is thrown here, the original exception is
hidden.
--
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]