You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "tanvipenumudy (via GitHub)" <gi...@apache.org> on 2024/07/26 06:32:45 UTC
[PR] HDDS-11238. Converge getBucket client-side calls for FileSystem client delete [ozone]
tanvipenumudy opened a new pull request, #6991:
URL: https://github.com/apache/ozone/pull/6991
## What changes were proposed in this pull request?
A few internal calls as part of FileSystem client delete involve repeated computation of getBucket(). Instead, we may precompute the OzoneBucket object and then pass it onto other dependent calls as they again compute the same object internally.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-11238
## How was this patch tested?
Existing unit and integration tests should cover the changes
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11238. Converge getBucket client-side calls for FileSystem client delete [ozone]
Posted by "ArafatKhan2198 (via GitHub)" <gi...@apache.org>.
ArafatKhan2198 commented on code in PR #6991:
URL: https://github.com/apache/ozone/pull/6991#discussion_r1694750118
##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneFileSystem.java:
##########
@@ -768,13 +768,19 @@ private boolean deleteInSpan(Path f, boolean recursive) throws IOException {
private boolean deleteBucket(Path f, boolean recursive, OFSPath ofsPath)
throws IOException {
+ OzoneBucket bucket;
+ try {
+ bucket = adapterImpl.getBucket(ofsPath, false);
+ } catch (Exception ex) {
Review Comment:
Can you add a log statement here signifying there was an error.
```
LOG.error("Exception while getting bucket link information, " +
"considered it as false", ex);
```
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11238. Converge getBucket client-side calls for FileSystem client delete [ozone]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #6991:
URL: https://github.com/apache/ozone/pull/6991#discussion_r1694763939
##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneFileSystem.java:
##########
@@ -768,13 +768,19 @@ private boolean deleteInSpan(Path f, boolean recursive) throws IOException {
private boolean deleteBucket(Path f, boolean recursive, OFSPath ofsPath)
throws IOException {
+ OzoneBucket bucket;
+ try {
+ bucket = adapterImpl.getBucket(ofsPath, false);
+ } catch (Exception ex) {
Review Comment:
Trying to delete non-existent bucket is not an error, so we should ignore `OMException` with `BUCKET_NOT_FOUND` or `VOLUME_NOT_FOUND` results silently.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11238. Converge getBucket client-side calls for FileSystem client delete [ozone]
Posted by "ArafatKhan2198 (via GitHub)" <gi...@apache.org>.
ArafatKhan2198 commented on code in PR #6991:
URL: https://github.com/apache/ozone/pull/6991#discussion_r1694773648
##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneFileSystem.java:
##########
@@ -768,13 +768,19 @@ private boolean deleteInSpan(Path f, boolean recursive) throws IOException {
private boolean deleteBucket(Path f, boolean recursive, OFSPath ofsPath)
throws IOException {
+ OzoneBucket bucket;
+ try {
+ bucket = adapterImpl.getBucket(ofsPath, false);
+ } catch (Exception ex) {
Review Comment:
Right makes sense.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11238. Converge getBucket client-side calls for FileSystem client delete [ozone]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #6991:
URL: https://github.com/apache/ozone/pull/6991#discussion_r1693859283
##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneFileSystem.java:
##########
@@ -766,15 +765,15 @@ private boolean deleteInSpan(Path f, boolean recursive) throws IOException {
return result;
}
- private boolean deleteBucket(Path f, boolean recursive, OFSPath ofsPath)
+ private boolean deleteBucket(Path f, boolean recursive, OzoneBucket bucket)
throws IOException {
Review Comment:
```suggestion
private boolean deleteBucket(Path f, boolean recursive, OFSPath ofsPath)
throws IOException {
OzoneBucket bucket;
try {
bucket = adapterImpl.getBucket(ofsPath, false);
} catch (Exception ex) {
return false;
}
```
##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneFileSystem.java:
##########
@@ -727,7 +728,7 @@ private boolean deleteInSpan(Path f, boolean recursive) throws IOException {
// delete bucket
if (ofsPath.isBucket()) {
- return deleteBucket(f, recursive, ofsPath);
+ return deleteBucket(f, recursive, bucket);
Review Comment:
```suggestion
return deleteBucket(f, recursive, ofsPath);
```
##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneFileSystem.java:
##########
@@ -799,14 +798,13 @@ private boolean deleteBucket(Path f, boolean recursive, OFSPath ofsPath)
// if so, the contents of bucket were deleted and skip delete bucket
// otherwise, Handle delete bucket
if (!handleTrailingSlash) {
- deleteBucketFromVolume(f, ofsPath);
+ deleteBucketFromVolume(f, bucket);
}
return result;
}
- private boolean isLinkBucket(Path f, OFSPath ofsPath) {
+ private boolean isLinkBucket(Path f, OzoneBucket bucket) {
try {
Review Comment:
Exception handling is no longer needed. With that, this method can be inlined (`bucket.isLink()` used directly).
##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneFileSystem.java:
##########
@@ -704,6 +704,7 @@ private boolean deleteInSpan(Path f, boolean recursive) throws IOException {
String key = pathToKey(f);
OFSPath ofsPath = new OFSPath(key,
ozoneConfiguration);
+ OzoneBucket bucket = adapterImpl.getBucket(ofsPath, false);
Review Comment:
I think `getBucket` should be moved into `deleteBucket`.
```suggestion
```
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11238. Converge getBucket client-side calls for FileSystem client delete [ozone]
Posted by "tanvipenumudy (via GitHub)" <gi...@apache.org>.
tanvipenumudy commented on code in PR #6991:
URL: https://github.com/apache/ozone/pull/6991#discussion_r1694757318
##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneFileSystem.java:
##########
@@ -768,13 +768,19 @@ private boolean deleteInSpan(Path f, boolean recursive) throws IOException {
private boolean deleteBucket(Path f, boolean recursive, OFSPath ofsPath)
throws IOException {
+ OzoneBucket bucket;
+ try {
+ bucket = adapterImpl.getBucket(ofsPath, false);
+ } catch (Exception ex) {
Review Comment:
Thank you @ArafatKhan2198 for the review, added the logging statement as suggested!
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11238. Converge redundant getBucket calls for FileSystem client delete [ozone]
Posted by "tanvipenumudy (via GitHub)" <gi...@apache.org>.
tanvipenumudy commented on PR #6991:
URL: https://github.com/apache/ozone/pull/6991#issuecomment-2255500086
Thanks @adoroszlai and @ArafatKhan2198 for reviewing the patch.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11238. Converge redundant getBucket calls for FileSystem client delete [ozone]
Posted by "tanvipenumudy (via GitHub)" <gi...@apache.org>.
tanvipenumudy merged PR #6991:
URL: https://github.com/apache/ozone/pull/6991
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11238. Converge getBucket client-side calls for FileSystem client delete [ozone]
Posted by "tanvipenumudy (via GitHub)" <gi...@apache.org>.
tanvipenumudy commented on code in PR #6991:
URL: https://github.com/apache/ozone/pull/6991#discussion_r1694794163
##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneFileSystem.java:
##########
@@ -768,13 +768,19 @@ private boolean deleteInSpan(Path f, boolean recursive) throws IOException {
private boolean deleteBucket(Path f, boolean recursive, OFSPath ofsPath)
throws IOException {
+ OzoneBucket bucket;
+ try {
+ bucket = adapterImpl.getBucket(ofsPath, false);
+ } catch (Exception ex) {
Review Comment:
Thank you @adoroszlai for mentioning this, please review the updated changes, thanks!
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11238. Converge getBucket client-side calls for FileSystem client delete [ozone]
Posted by "tanvipenumudy (via GitHub)" <gi...@apache.org>.
tanvipenumudy commented on code in PR #6991:
URL: https://github.com/apache/ozone/pull/6991#discussion_r1694689966
##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneFileSystem.java:
##########
@@ -799,14 +798,13 @@ private boolean deleteBucket(Path f, boolean recursive, OFSPath ofsPath)
// if so, the contents of bucket were deleted and skip delete bucket
// otherwise, Handle delete bucket
if (!handleTrailingSlash) {
- deleteBucketFromVolume(f, ofsPath);
+ deleteBucketFromVolume(f, bucket);
}
return result;
}
- private boolean isLinkBucket(Path f, OFSPath ofsPath) {
+ private boolean isLinkBucket(Path f, OzoneBucket bucket) {
try {
Review Comment:
Thank you @adoroszlai for the review, made the suggested changes!
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org