ashishkumar50 commented on code in PR #4981:
URL: https://github.com/apache/ozone/pull/4981#discussion_r1260748517
##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneFileSystem.java:
##########
@@ -766,14 +766,22 @@ private void deleteBucketFromVolume(Path f, OFSPath
ofsPath)
throws IOException {
OzoneVolume volume =
adapterImpl.getObjectStore().getVolume(ofsPath.getVolumeName());
- try {
- volume.deleteBucket(ofsPath.getBucketName());
- } catch (OMException ex) {
- // bucket is not empty
- if (ex.getResult() == BUCKET_NOT_EMPTY) {
- throw new PathIsNotEmptyDirectoryException(f.toString());
- } else {
- throw ex;
+ int retryCount = 3;
+ int count = 0;
+ while (count < retryCount) {
Review Comment:
Yes "bucket not empty" is intermittent because of key is deleted but still
not flushed to DB yet. So in between if we check bucket empty which doesn't
give proper result in
[isKeyPresentInTable](https://github.com/apache/ozone/blob/92b49ebde98774f9f63ad091bce662d20c95096f/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java#L1030).
Even though in this method we are checking both cache and table, but that
doesn't ensure it will give exact information about bucket empty when key was
deleted just before this operation check.
One way is to retry or other way is to flush cache into table and then check
isBucketEmpty.
--
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]