Sadanand Shenoy created HDDS-11911:
--------------------------------------
Summary: Fix ResultCode when snapshot is not found in the DB or
Snapshot Chain.
Key: HDDS-11911
URL: https://issues.apache.org/jira/browse/HDDS-11911
Project: Apache Ozone
Issue Type: Bug
Reporter: Sadanand Shenoy
When the snapshot is deleted/purged , and it is removed either from DB or from
the snapshot chain the exceptions thrown are not consistent.
If a snapshot is not found in table/chain, it should throw OMException with
result code FILE_NOT_FOUND.
In OmSnapshotManager#getSnapshotInfo it returns INVALID_SNAPSHOT_ERROR which is
wrong. This causes background task SSTFIlteringService to fail as it does not
catch this exception.
{code:java}
2024-11-30 04:04:16,428 WARN
[SstFilteringService#0]-org.apache.hadoop.hdds.utils.BackgroundService:
Background task execution failed java.lang.IllegalStateException:
INVALID_SNAPSHOT_ERROR org.apache.hadoop.ozone.om.exceptions.OMException:
Snapshot '/src-vol-6/src-buck-1/cm-1546349950-1732925263423-10' is not found.
at
org.apache.hadoop.ozone.om.snapshot.SnapshotCache.lambda$1(SnapshotCache.java:151)
at
java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1853)
at
org.apache.hadoop.ozone.om.snapshot.SnapshotCache.get(SnapshotCache.java:143)
at
org.apache.hadoop.ozone.om.snapshot.SnapshotCache.get(SnapshotCache.java:129)
at org.apache.hadoop.ozone.om.SstFilteringService$SstFilteringTask.call(S
{code}
Similarly even if snapshotTableKey is not found in the snapshotChain, same
error code should be thrown
{code:java}
if (snapshotTableKey == null) {
throw new IOException("No snapshot exist with snapshotId: " + snapshotId);
}{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]