Skip to content

Commit

Permalink
[router] Cleanup per storage node router quota code (#548)
Browse files Browse the repository at this point in the history
* [router] Cleanup per storage node router quota code
---------
Co-authored-by: Sourav Maji <[email protected]>
  • Loading branch information
majisourav99 authored Jul 27, 2023
1 parent 237d03d commit 8ab5e85
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 533 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -884,11 +884,6 @@ private ConfigKeys() {
*/
public static final String ROUTER_MAX_OUTGOING_CONNECTION = "router.max.outgoing.connection";

/**
* Enable per router per storage node throttler by distributing the store quota among the partitions and replicas.
*/
public static final String ROUTER_PER_STORAGE_NODE_THROTTLER_ENABLED = "router.per.storage.node.throttler.enabled";

/**
* This config is used to bound the pending request.
* Without this config, the accumulated requests in Http Async Client could grow unlimitedly,
Expand Down Expand Up @@ -918,11 +913,6 @@ private ConfigKeys() {
public static final String ROUTER_HELIX_ASSISTED_ROUTING_GROUP_SELECTION_STRATEGY =
"router.helix.assisted.routing.group.selection.strategy";

/**
* The buffer we will add to the per storage node read quota. E.g 0.5 means 50% extra quota.
*/
public static final String ROUTER_PER_STORAGE_NODE_READ_QUOTA_BUFFER = "router.per.storage.node.read.quota.buffer";

public static final String ROUTER_PER_STORE_ROUTER_QUOTA_BUFFER = "router.per.store.router.quota.buffer";

/**
Expand Down
2 changes: 1 addition & 1 deletion services/venice-router/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ jar {
}

ext {
jacocoCoverageThreshold = 0.41
jacocoCoverageThreshold = 0.40
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@
import static com.linkedin.venice.ConfigKeys.ROUTER_PENDING_CONNECTION_RESUME_THRESHOLD_PER_ROUTE;
import static com.linkedin.venice.ConfigKeys.ROUTER_PER_NODE_CLIENT_ENABLED;
import static com.linkedin.venice.ConfigKeys.ROUTER_PER_NODE_CLIENT_THREAD_COUNT;
import static com.linkedin.venice.ConfigKeys.ROUTER_PER_STORAGE_NODE_READ_QUOTA_BUFFER;
import static com.linkedin.venice.ConfigKeys.ROUTER_PER_STORAGE_NODE_THROTTLER_ENABLED;
import static com.linkedin.venice.ConfigKeys.ROUTER_PER_STORE_ROUTER_QUOTA_BUFFER;
import static com.linkedin.venice.ConfigKeys.ROUTER_QUOTA_CHECK_WINDOW;
import static com.linkedin.venice.ConfigKeys.ROUTER_READ_QUOTA_THROTTLING_LEASE_TIMEOUT_MS;
Expand Down Expand Up @@ -142,7 +140,6 @@ public class VeniceRouterConfig {
private int maxOutgoingConn;
private Map<String, String> clusterToD2Map;
private Map<String, String> clusterToServerD2Map;
private double perStorageNodeReadQuotaBuffer;
private int refreshAttemptsForZkReconnect;
private long refreshIntervalForZkReconnectInMs;
private int routerNettyGracefulShutdownPeriodSeconds;
Expand Down Expand Up @@ -210,7 +207,6 @@ public class VeniceRouterConfig {
private boolean metaStoreShadowReadEnabled;
private boolean unregisterMetricForDeletedStoreEnabled;
private int routerIOWorkerCount;
private boolean perRouterStorageNodeThrottlerEnabled;
private double perStoreRouterQuotaBuffer;
private boolean httpClientOpensslEnabled;

Expand Down Expand Up @@ -254,7 +250,6 @@ private void checkProperties(VeniceProperties props) {
maxOutgoingConn = props.getInt(ROUTER_MAX_OUTGOING_CONNECTION, 1200);
clusterToD2Map = props.getMap(CLUSTER_TO_D2);
clusterToServerD2Map = props.getMap(CLUSTER_TO_SERVER_D2, Collections.emptyMap());
perStorageNodeReadQuotaBuffer = props.getDouble(ROUTER_PER_STORAGE_NODE_READ_QUOTA_BUFFER, 1.0);
refreshAttemptsForZkReconnect = props.getInt(REFRESH_ATTEMPTS_FOR_ZK_RECONNECT, 3);
refreshIntervalForZkReconnectInMs =
props.getLong(REFRESH_INTERVAL_FOR_ZK_RECONNECT_MS, java.util.concurrent.TimeUnit.SECONDS.toMillis(10));
Expand Down Expand Up @@ -389,7 +384,6 @@ private void checkProperties(VeniceProperties props) {
* should consider to use some number, which is proportional to the available cores.
*/
routerIOWorkerCount = props.getInt(ROUTER_IO_WORKER_COUNT, 24);
perRouterStorageNodeThrottlerEnabled = props.getBoolean(ROUTER_PER_STORAGE_NODE_THROTTLER_ENABLED, true);
perStoreRouterQuotaBuffer = props.getDouble(ROUTER_PER_STORE_ROUTER_QUOTA_BUFFER, 1.5);
httpClientOpensslEnabled = props.getBoolean(ROUTER_HTTP_CLIENT_OPENSSL_ENABLED, true);
}
Expand Down Expand Up @@ -466,10 +460,6 @@ public int getMaxOutgoingConn() {
return maxOutgoingConn;
}

public double getPerStorageNodeReadQuotaBuffer() {
return perStorageNodeReadQuotaBuffer;
}

public long getRefreshIntervalForZkReconnectInMs() {
return refreshIntervalForZkReconnectInMs;
}
Expand Down Expand Up @@ -835,10 +825,6 @@ public int getRouterIOWorkerCount() {
return routerIOWorkerCount;
}

public boolean isPerRouterStorageNodeThrottlerEnabled() {
return perRouterStorageNodeThrottlerEnabled;
}

public boolean isHttpClientOpensslEnabled() {
return httpClientOpensslEnabled;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,7 @@ public <H, P extends ResourcePath<K>, K, R> Scatter<H, P, K> scatter(
*/
int keyCount = part.getPartitionKeys().size();
try {
readRequestThrottler.mayThrottleRead(
storeName,
keyCount * readRequestThrottler.getReadCapacity(),
veniceInstance.getNodeId());
readRequestThrottler.mayThrottleRead(storeName, keyCount * readRequestThrottler.getReadCapacity());
} catch (QuotaExceededException e) {
/**
* Exception thrown here won't go through {@link VeniceResponseAggregator}, and DDS lib will return an error response
Expand Down
Loading

0 comments on commit 8ab5e85

Please sign in to comment.