Skip to content

Conversation

@cxorm
Copy link
Member

@cxorm cxorm commented Nov 22, 2019

What changes were proposed in this pull request?

Fix the OmMetadataManagerImpl#listVolumes to 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.

Copy link
Contributor

@adoroszlai adoroszlai left a 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.

Comment on lines 61 to 62
Copy link
Contributor

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.

Comment on lines 66 to 67
Copy link
Contributor

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().

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Contributor

@bharatviswa504 bharatviswa504 Nov 22, 2019

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.

@cxorm cxorm requested a review from bharatviswa504 November 23, 2019 10:59
Copy link
Contributor

@bharatviswa504 bharatviswa504 left a 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.

@cxorm
Copy link
Member Author

cxorm commented Dec 12, 2019

Thanks @bharatviswa504 for the review.
Fix in progress, hope soon.

Copy link
Contributor

@adoroszlai adoroszlai left a 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?

@cxorm
Copy link
Member Author

cxorm commented Dec 19, 2019

Update listAllvolumes with parameter prefix and startKey for complete utility.

@cxorm cxorm requested a review from adoroszlai December 21, 2019 10:17
Copy link
Contributor

@adoroszlai adoroszlai left a 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.

@cxorm
Copy link
Member Author

cxorm commented Jan 19, 2020

Would you please take a look on the fix if you have time, @bharatviswa504

@arp7
Copy link
Contributor

arp7 commented Feb 12, 2020

Hi @cxorm , looks like Attila has already approved these changes. Can you please rebase the patch, we can help commit it once rebased.

@cxorm
Copy link
Member Author

cxorm commented Mar 9, 2020

The pr-check / unit (pull_request) seems not related to the patch.

@cxorm
Copy link
Member Author

cxorm commented Mar 9, 2020

Sorry for letting me trigger it again.

@cxorm
Copy link
Member Author

cxorm commented Mar 10, 2020

Thank you @arp7 for looking this PR.

The error check is not related to the patch.
Here is the same branch passed all checks.

@adoroszlai
Copy link
Contributor

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.

@adoroszlai adoroszlai merged commit 83e45eb into apache:master Mar 10, 2020
@cxorm
Copy link
Member Author

cxorm commented Mar 11, 2020

Thanks all for the help.

vtutrinov pushed a commit to vtutrinov/ozone that referenced this pull request Sep 18, 2025
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
vtutrinov pushed a commit to vtutrinov/ozone that referenced this pull request Oct 6, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants