swamirishi commented on code in PR #7179:
URL: https://github.com/apache/ozone/pull/7179#discussion_r1753034897
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyPurgeRequest.java:
##########
@@ -71,17 +75,27 @@ public OMClientResponse validateAndUpdateCache(OzoneManager
ozoneManager, TermIn
keysToBePurgedList.add(deletedKey);
}
}
+ final SnapshotInfo fromSnapshotInfo;
try {
- SnapshotInfo fromSnapshotInfo = null;
- if (fromSnapshot != null) {
- fromSnapshotInfo = SnapshotUtils.getSnapshotInfo(ozoneManager,
fromSnapshot);
- }
- omClientResponse = new OMKeyPurgeResponse(omResponse.build(),
- keysToBePurgedList, fromSnapshotInfo, keysToUpdateList);
+ fromSnapshotInfo = fromSnapshot == null ? null :
SnapshotUtils.getSnapshotInfo(ozoneManager, fromSnapshot);
} catch (IOException ex) {
- omClientResponse = new
OMKeyPurgeResponse(createErrorOMResponse(omResponse, ex));
+ return new OMKeyPurgeResponse(createErrorOMResponse(omResponse, ex));
+ }
Review Comment:
Lets leave it in this it should be fine. The followup PR would use this
change. I have been cherry-picking only the required code blocks related to the
fix.
--
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]