hemantk-12 commented on code in PR #6296:
URL: https://github.com/apache/ozone/pull/6296#discussion_r1543437757


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMDirectoriesPurgeRequestWithFSO.java:
##########
@@ -69,10 +75,23 @@ public OMClientResponse validateAndUpdateCache(OzoneManager 
ozoneManager, TermIn
 
     OMMetrics omMetrics = ozoneManager.getMetrics();
     try {
-      if (fromSnapshot != null) {
+      if (purgeDirsRequest.hasSnapshotTableKey()) {
+        throw new OMException("The field snapshotTableKey from 
PurgeDirectoriesRequest is deprecated." +

Review Comment:
   If I understood the code flow properly, it would fail OM which is not good 
in this scenario.
   Based on 
[OzoneManagerStateMachine#processResponse](https://github.com/apache/ozone/blob/9afaeacf715e432d1fce97962cd88402552b6af4/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerStateMachine.java#L364)
 and https://issues.apache.org/jira/browse/HDDS-10524
   
   May be better to fall back to `purgeDirsRequest.getSnapshotTableKey()` or 
throw `FILE_NOT_FOUND` or something which doesn't fail OM.
   
   We also need to fix this for the snapshot chain as well. Right now it 
crashes OM if the chain is corrupted. e.g. HDDS-10524



-- 
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]

Reply via email to