-
Notifications
You must be signed in to change notification settings - Fork 589
HDDS-2610. Fix the ObjectStore#listVolumes failure when argument is null #261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
adoroszlai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @cxorm for working on this.
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The result of this builder seems to be unused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Instead of creating a new builder in each iteration, a common builder could be created outside the loop, with common values (adminName) already initialized. Then in each iteration set the specific values and call build().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this implementation could be slow if there are many users. Can the "all volumes" case be handled separately by iterating volumes directly from getVolumeTable? That would avoid: (1) iterating all users, (2) lookup of volumes for each user, (3) lookup of volume by volume name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed. To list all Volumes this would be a better way to handle. And leave current code to handle listVolumes for a particular user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @bharatviswa504 for the review.
I handle the listAllVolumes separately, and updated.
UT ran well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this issue and fixing it.
With OM HA now we have Table Cache (And the same code is being used for OM non-HA). So, when the request is received we add it to the cache and then return the result. So, when we want to get all users in the system, we want to merge the data in User table cache and DB.
For a particular user list of Volumes is stored in UserVolumeInfo. So, there is no issue in that part.
For more info, you can refer to a recent fix that has been done in this part for listBuckets API (https://issues.apache.org/jira/browse/HDDS-1984). In a similar way, you need to change getAllUsers() to get all users from cache and DB. As now we want to support listAllVolumes in the system.
bharatviswa504
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel @adoroszlai suggested way will be the good way to handle listAll volumes. And it will be easier, just iterate in-memory map of volume table cache.
|
Thanks @bharatviswa504 for the review. |
adoroszlai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @cxorm for the update. Can you please further remove the unnecessary volumes list?
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java
Outdated
Show resolved
Hide resolved
|
Update |
adoroszlai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @cxorm for continuing to improve the patch.
|
Would you please take a look on the fix if you have time, @bharatviswa504 |
|
Hi @cxorm , looks like Attila has already approved these changes. Can you please rebase the patch, we can help commit it once rebased. |
This reverts commit 633523553db1d46bb6bca23879e66d71a046749c.
This reverts commit 6a4ab501c9d36ef30baab52b1c89771b96583142.
|
The pr-check / unit (pull_request) seems not related to the patch. |
|
Sorry for letting me trigger it again. |
|
Thank you @arp7 for looking this PR. The error check is not related to the patch. |
|
Filed HDDS-3151 for the integration test failure, which we've seen earlier without this change, too. Acceptance test failure that SCM does not come out of safe mode is also observed elsewhere. Given we have a clean run on the PR source branch, and it's only 2 commits behind master, I think it's safe to merge. Thanks @cxorm for the contribution, @bharatviswa504 and @arp7 for the review. |
|
Thanks all for the help. |
Merge in SDPOZONE/component-ozone from SDPOZN-1660 to sdp-ozone-1.4 Squashed commit of the following: commit cf78aa4194fdb618cebac5f9d525b0967fec39e5 Author: 22861553 <[email protected]> Date: Fri Aug 29 12:11:55 2025 +0300 Apply review changes commit 918d14a9832d23ecc3d6fe4a800147c3e82bddb9 Author: 22861553 <[email protected]> Date: Fri Aug 29 12:03:45 2025 +0300 Apply review changes ... and 8 more commits
Merge in SDPOZONE/component-ozone from SDPOZN-1660 to sdp-ozone-1.4 Squashed commit of the following: commit cf78aa4194fdb618cebac5f9d525b0967fec39e5 Author: 22861553 <[email protected]> Date: Fri Aug 29 12:11:55 2025 +0300 Apply review changes commit 918d14a9832d23ecc3d6fe4a800147c3e82bddb9 Author: 22861553 <[email protected]> Date: Fri Aug 29 12:03:45 2025 +0300 Apply review changes ... and 8 more commits
What changes were proposed in this pull request?
Fix the
OmMetadataManagerImpl#listVolumesto list all volumes when the userName is null.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-2610
How was this patch tested?
UT Updating, and build & run on cluster.