-
Notifications
You must be signed in to change notification settings - Fork 108
[controller] Account for max read capacity in quota change #2235
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
base: main
Are you sure you want to change the base?
Changes from 4 commits
2fa8503
c01300a
df9ee0a
54d6f81
af2a50a
4d4c28e
a73e5e1
6e24e2f
7f508fe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5709,12 +5709,16 @@ private void internalUpdateStore(String clusterName, String storeName, UpdateSto | |
|
|
||
| if (readQuotaInCU.isPresent()) { | ||
| HelixVeniceClusterResources resources = getHelixVeniceClusterResources(clusterName); | ||
|
|
||
| ZkRoutersClusterManager routersClusterManager = resources.getRoutersClusterManager(); | ||
| int routerCount = routersClusterManager.getLiveRoutersCount(); | ||
|
|
||
| VeniceControllerClusterConfig clusterConfig = getHelixVeniceClusterResources(clusterName).getConfig(); | ||
| int defaultReadQuotaPerRouter = clusterConfig.getDefaultReadQuotaPerRouter(); | ||
|
|
||
| if (Math.max(defaultReadQuotaPerRouter, routerCount * defaultReadQuotaPerRouter) < readQuotaInCU.get()) { | ||
| long maxReadCapacityCu = clusterConfig.getMaxReadCapacityCu(); | ||
| long maxPerRouterCapacity = Math.max(defaultReadQuotaPerRouter, maxReadCapacityCu); | ||
| long totalClusterCapacity = maxPerRouterCapacity * routerCount; | ||
| if (Math.max(totalClusterCapacity, maxPerRouterCapacity) < readQuotaInCU.get()) { | ||
|
||
| throw new VeniceException( | ||
| "Cannot update read quota for store " + storeName + " in cluster " + clusterName + ". Read quota " | ||
| + readQuotaInCU.get() + " requested is more than the cluster quota."); | ||
|
|
||
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.
Can you add a comment on what these 2 variables mean and also revisit the name to make it more clear from the name? Lets also add router in the name if it's only for router quota
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.
Good point - added a comment to describe the usage of the two variables and renamed the new config to include router