hemantk-12 commented on code in PR #5155:
URL: https://github.com/apache/ozone/pull/5155#discussion_r1287528356
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SstFilteringService.java:
##########
@@ -181,15 +193,17 @@ public BackgroundTaskResult call() throws Exception {
List<Pair<String, String>> prefixPairs =
constructPrefixPairs(snapshotInfo);
- try (ReferenceCounted<IOmMetadataReader, SnapshotCache>
- snapshotMetadataReader = snapshotCache.get()
- .get(snapshotInfo.getTableKey())) {
+ try (
+ ReferenceCounted<IOmMetadataReader, SnapshotCache>
+ snapshotMetadataReader = snapshotCache.get()
+ .get(snapshotInfo.getTableKey(), true)) {
Review Comment:
I'll suggested to use `if (snapshotInfo.isSstFiltered() ||
snapshotInfo.getSnapshotStatus() !=
SnapshotInfo.SnapshotStatus.SNAPSHOT_DELETED)` at line number 186 instead of
loading DELETED snapshot. There is no point in cleaning deleted snapshot.
And add a catch at line 209 to double check that it fails only if snapshot
has been deleted.
```
} catch (OMException omException) {
if (snapshotInfo.getSnapshotStatus() ==
SnapshotInfo.SnapshotStatus.SNAPSHOT_DELETED) {
LOG.info("Snapshot with name: '{}', id: '{}' has been
deleted.",
snapshotInfo.getName(), snapshotInfo.getSnapshotId());
}
}
```
--
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]