hemantk-12 commented on code in PR #4525:
URL: https://github.com/apache/ozone/pull/4525#discussion_r1164483148
##########
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:
Initially, I only logged the exception that but then after discussing with
snapshot team, we decided to throw this because snapshot chain is corrupted and
should be reset. The other reason is that, ideally `
snapshotChainManager.deleteSnapshot(info);` should not throw exception because
it throws exception in case order of snapshot chair is messed up which should
not happen needs investigation.
--
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]