ChenSammi commented on code in PR #8909:
URL: https://github.com/apache/ozone/pull/8909#discussion_r2278647744


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/KeyLifecycleService.java:
##########
@@ -348,16 +350,22 @@ private void evaluateFSOBucket(OmVolumeArgs volume, 
OmBucketInfo bucket, String
             
directoryPath.append(dir.getName()).append(OzoneConsts.OM_KEY_PREFIX);
           }
           if (directoryPath.toString().equals(rule.getEffectivePrefix() + 
OzoneConsts.OM_KEY_PREFIX)) {
-            expiredDirList.add(directoryPath.toString());
-            expiredDirUpdateIDList.add(dirList.get(dirList.size() - 
1).getUpdateID());
+            try {
+              expiredDirUpdateIDList.add(dirList.get(dirList.size() - 
1).getUpdateID());
+              expiredDirList.add(directoryPath.toString());
+            } catch (IOException e) {
+              // send delete request for pending deletion directories
+              sendDeleteKeysRequestAndClearList(volume.getVolume(), 
bucket.getBucketName(),

Review Comment:
   I get your point, how about change the return value of add() to a boolean, 
if it returns true, which means element is added into list, otherwise, it's 
full, so we don't need to add the ifFull check everywhere. 



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