Repository navigation
Backport (#14293): server: report a domain's bucket, object storage and backup limits correctly - #14956
Open
stag7824 wants to merge 1 commit into
Open
Backport (#14293): server: report a domain's bucket, object storage and backup limits correctly#14956stag7824 wants to merge 1 commit into
stag7824 wants to merge 1 commit into
Conversation
…rrectly (apache#14293) * server: report a domain's bucket, object storage and backup limits correctly listDomains reported the bucket and object storage limits of every non-root domain as Unlimited, whatever was configured. DomainJoinDaoImpl resolved those two through ApiDBUtils.findCorrectResourceLimit, which is the account variant: it looks the id up in the account table. Given a domain id it finds either the root admin account or no account, and answers unlimited either way. The other fifteen resource types already go through findCorrectResourceLimitForDomain. The backup and backup storage rows had their unlimited checks copied from the row above: the backup limit was hidden whenever the snapshot limit was unlimited, and the backup storage limit whenever the backup limit was. listResourceLimits was never affected, which is why the values set through updateResourceLimit read back correctly there and only the usage view in the UI, which reads listDomains, showed them as Unlimited. Fixes apache#13944 * server: show the enforced limit for a domain that has no limit of its own When a domain has no limit set, the domain response fell back to findDefaultResourceLimitForDomain, which only reads the max.domain.* default for storage types and answers unlimited for the rest. Creating a resource still stops at the default (or at a parent domain's limit), so for example the bucket limit showed unlimited while bucket creation stopped at 20. Use the same lookup that is enforced. * server: drop a comment that repeats the code (cherry picked from commit b694fcd)
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR backports #14293 to 4.22, as suggested by @RosiKyu when the original was moved to
main.listDomainsreported the bucket and object storage limits of every non-root domain as Unlimited, and the backup and backup storage rows used the wrong "unlimited" checks. For a domain without its own limit, the response also showed Unlimited instead of the limit that is actually enforced (parent domain ormax.domain.*default).It is a clean cherry-pick (
-x) of b694fcd, with no conflicts. Same four files as the original.Fixes: #13944
Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
How Has This Been Tested?
On this branch (JDK 11):
ApiDBUtilsTestandDomainJoinDaoImplTestpass (6 tests), and checkstyle is clean forserver.The original was tested on a KVM lab by @RosiKyu and reproduced on a 4.23 build by @rootnomad, see #14293.