You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2020/11/25 20:20:52 UTC

[GitHub] [incubator-pinot] sajjad-moradi opened a new pull request #6291: Add consumption rate limiter for LLConsumer

sajjad-moradi opened a new pull request #6291:
URL: https://github.com/apache/incubator-pinot/pull/6291


   ## Description
   Bursty pattern of incoming Kafka events introduces long time GC pauses on Pinot server. This behavior has been observed in use cases in LinkedIn. It's also reported in this issue: #6138.
   This PR introduces rate limit on Kafka consumption which can be configured in StreamConfig. The rate limit parameter is defined for the whole topic and the rate limit for each partition will be simply topic rate limit divided by the partition count of that topic.
   
   ## Testing Done
   Leveraged `quick-start-hybrid.sh`:
   - Set the limit rate parameter to 20 in `airlineStats_realtime_table_config` (there are 10 partitions in the corresponding Kafka topic)
   - Increased kafka publishing rate to produce more than 20 events per second
   - Logged throttling timestamps and verified that each partition only consumed 2 events per second
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] sajjad-moradi commented on a change in pull request #6291: Add consumption rate limiter for LLConsumer

Posted by GitBox <gi...@apache.org>.
sajjad-moradi commented on a change in pull request #6291:
URL: https://github.com/apache/incubator-pinot/pull/6291#discussion_r537127123



##########
File path: pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeConsumptionRateManager.java
##########
@@ -0,0 +1,131 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.pinot.core.data.manager.realtime;
+
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import com.google.common.util.concurrent.RateLimiter;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
+import org.apache.pinot.spi.stream.PartitionCountFetcher;
+import org.apache.pinot.spi.stream.StreamConfig;
+import org.apache.pinot.spi.utils.retry.RetryPolicies;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * This class is responsible for creating realtime consumption rate limiters. If rate limiter is used for
+ * multi-partition topics, the provided rate in StreamConfig is divided by partition count. This class leverages a
+ * cache for storing partition count for different topics as retrieving partition count from Kafka is a bit expensive
+ * and also the same count will be used of all partition consumers of the same topic.
+ */
+public class RealtimeConsumptionRateManager {
+  private static final Logger LOGGER = LoggerFactory.getLogger(RealtimeConsumptionRateManager.class);
+  private static final RealtimeConsumptionRateManager INSTANCE = new RealtimeConsumptionRateManager();
+  private static final int CACHE_ENTRY_EXPIRATION_TIME_IN_MINUTES = 10;
+
+  @VisibleForTesting
+  LoadingCache<StreamConfig, Integer> _streamConfigToTopicPartitionCountMap = buildCache();
+  private boolean _isThrottlingAllowed = false;
+
+  private RealtimeConsumptionRateManager() {
+  }
+
+  public static RealtimeConsumptionRateManager getInstance() {
+    return INSTANCE;
+  }
+
+  public void enableThrottling() {
+    _isThrottlingAllowed = true;
+  }
+
+  public ConsumptionRateLimiter createRateLimiterForSinglePartitionTopic(StreamConfig streamConfig) {
+    return createRateLimiter(streamConfig, false);
+  }
+
+  public ConsumptionRateLimiter createRateLimiterForMultiPartitionTopic(StreamConfig streamConfig) {
+    return createRateLimiter(streamConfig, true);
+  }
+
+  private ConsumptionRateLimiter createRateLimiter(StreamConfig streamConfig, boolean multiPartitionTopic) {

Review comment:
       This is a private method which is used in two public methods `createRateLimiterForMultiPartitionTopic` and `createRateLimiterForSinglePartitionTopic`. I think their long names are used specifically to address your concern.
   Although some experts believe that comments don't get refactored and easily get outdated and developers should use descriptive variable/method names instead as much as possible, If you still think it's unclear, I can add some comments on the private method.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] mcvsubbu commented on pull request #6291: Add consumption rate limiter for LLConsumer

Posted by GitBox <gi...@apache.org>.
mcvsubbu commented on pull request #6291:
URL: https://github.com/apache/incubator-pinot/pull/6291#issuecomment-733963720


   Can you note in your checkin comments that what we are throttling is not really the consumption, but the _processing_ of messages. We will still consume as much as we can from the stream.
   
   If we were to limit consumption, then the behavior will be somewhat like:
   
   ```
   while (true) {
     consumeMsgsAsPerSomeAllowedRate()
     processAllMsgsConsumed()
     sleepAsIndicatedByRateLimiter()
   }
   ```
   
   Whereas by rate limiting the processing, we are doing the following:
   
   ```
   while (true) {
     consumeAllMsgsThatWeCan()
     foreach(msg) {
       processMsg()
       sleepAsDictatedByRateLimiter()
     }
   }
   ```
   
   So, we may be taking up more heap in the second case ?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] sajjad-moradi commented on a change in pull request #6291: Add consumption rate limiter for LLConsumer

Posted by GitBox <gi...@apache.org>.
sajjad-moradi commented on a change in pull request #6291:
URL: https://github.com/apache/incubator-pinot/pull/6291#discussion_r537125742



##########
File path: pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeConsumptionRateManager.java
##########
@@ -0,0 +1,131 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.pinot.core.data.manager.realtime;
+
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import com.google.common.util.concurrent.RateLimiter;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
+import org.apache.pinot.spi.stream.PartitionCountFetcher;
+import org.apache.pinot.spi.stream.StreamConfig;
+import org.apache.pinot.spi.utils.retry.RetryPolicies;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * This class is responsible for creating realtime consumption rate limiters. If rate limiter is used for
+ * multi-partition topics, the provided rate in StreamConfig is divided by partition count. This class leverages a
+ * cache for storing partition count for different topics as retrieving partition count from Kafka is a bit expensive
+ * and also the same count will be used of all partition consumers of the same topic.
+ */
+public class RealtimeConsumptionRateManager {
+  private static final Logger LOGGER = LoggerFactory.getLogger(RealtimeConsumptionRateManager.class);
+  private static final RealtimeConsumptionRateManager INSTANCE = new RealtimeConsumptionRateManager();
+  private static final int CACHE_ENTRY_EXPIRATION_TIME_IN_MINUTES = 10;
+
+  @VisibleForTesting
+  LoadingCache<StreamConfig, Integer> _streamConfigToTopicPartitionCountMap = buildCache();
+  private boolean _isThrottlingAllowed = false;
+
+  private RealtimeConsumptionRateManager() {
+  }
+
+  public static RealtimeConsumptionRateManager getInstance() {
+    return INSTANCE;
+  }
+
+  public void enableThrottling() {
+    _isThrottlingAllowed = true;
+  }
+
+  public ConsumptionRateLimiter createRateLimiterForSinglePartitionTopic(StreamConfig streamConfig) {
+    return createRateLimiter(streamConfig, false);
+  }
+
+  public ConsumptionRateLimiter createRateLimiterForMultiPartitionTopic(StreamConfig streamConfig) {
+    return createRateLimiter(streamConfig, true);
+  }
+
+  private ConsumptionRateLimiter createRateLimiter(StreamConfig streamConfig, boolean multiPartitionTopic) {
+    if (!streamConfig.getTopicConsumptionRateLimit().isPresent()) {
+      return NOOP_RATE_LIMITER;
+    }
+    int partitionCount = 1;
+    if (multiPartitionTopic) {
+      try {
+        partitionCount = _streamConfigToTopicPartitionCountMap.get(streamConfig);

Review comment:
       In the load method of the cache, we're using the existing class PartitionCountFetcher which requires the whole StreamConfig object to be provided. That's why the whole object is considered as the key for the cache.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] codecov-io edited a comment on pull request #6291: Add consumption rate limiter for LLConsumer

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #6291:
URL: https://github.com/apache/incubator-pinot/pull/6291#issuecomment-733950739


   # [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6291?src=pr&el=h1) Report
   > Merging [#6291](https://codecov.io/gh/apache/incubator-pinot/pull/6291?src=pr&el=desc) (747f1df) into [master](https://codecov.io/gh/apache/incubator-pinot/commit/1beaab59b73f26c4e35f3b9bc856b03806cddf5a?el=desc) (1beaab5) will **decrease** coverage by `22.57%`.
   > The diff coverage is `51.95%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-pinot/pull/6291/graphs/tree.svg?width=650&height=150&src=pr&token=4ibza2ugkz)](https://codecov.io/gh/apache/incubator-pinot/pull/6291?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master    #6291       +/-   ##
   ===========================================
   - Coverage   66.44%   43.87%   -22.58%     
   ===========================================
     Files        1075     1333      +258     
     Lines       54773    65355    +10582     
     Branches     8168     9524     +1356     
   ===========================================
   - Hits        36396    28675     -7721     
   - Misses      15700    34282    +18582     
   + Partials     2677     2398      -279     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | integration | `43.87% <51.95%> (?)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-pinot/pull/6291?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...ot/broker/broker/AllowAllAccessControlFactory.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvYnJva2VyL0FsbG93QWxsQWNjZXNzQ29udHJvbEZhY3RvcnkuamF2YQ==) | `100.00% <ø> (ø)` | |
   | [.../helix/BrokerUserDefinedMessageHandlerFactory.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvYnJva2VyL2hlbGl4L0Jyb2tlclVzZXJEZWZpbmVkTWVzc2FnZUhhbmRsZXJGYWN0b3J5LmphdmE=) | `52.83% <0.00%> (-13.84%)` | :arrow_down: |
   | [...org/apache/pinot/broker/queryquota/HitCounter.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcXVlcnlxdW90YS9IaXRDb3VudGVyLmphdmE=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...che/pinot/broker/queryquota/MaxHitRateTracker.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcXVlcnlxdW90YS9NYXhIaXRSYXRlVHJhY2tlci5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...ache/pinot/broker/queryquota/QueryQuotaEntity.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcXVlcnlxdW90YS9RdWVyeVF1b3RhRW50aXR5LmphdmE=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [...ker/routing/instanceselector/InstanceSelector.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcm91dGluZy9pbnN0YW5jZXNlbGVjdG9yL0luc3RhbmNlU2VsZWN0b3IuamF2YQ==) | `100.00% <ø> (ø)` | |
   | [...ceselector/StrictReplicaGroupInstanceSelector.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcm91dGluZy9pbnN0YW5jZXNlbGVjdG9yL1N0cmljdFJlcGxpY2FHcm91cEluc3RhbmNlU2VsZWN0b3IuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [.../main/java/org/apache/pinot/client/Connection.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L0Nvbm5lY3Rpb24uamF2YQ==) | `22.22% <0.00%> (-26.62%)` | :arrow_down: |
   | [...not/common/assignment/InstancePartitionsUtils.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vYXNzaWdubWVudC9JbnN0YW5jZVBhcnRpdGlvbnNVdGlscy5qYXZh) | `64.28% <ø> (-8.89%)` | :arrow_down: |
   | [.../apache/pinot/common/exception/QueryException.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vZXhjZXB0aW9uL1F1ZXJ5RXhjZXB0aW9uLmphdmE=) | `90.27% <ø> (+5.55%)` | :arrow_up: |
   | ... and [1349 more](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6291?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6291?src=pr&el=footer). Last update [fe9d3c7...747f1df](https://codecov.io/gh/apache/incubator-pinot/pull/6291?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] sajjad-moradi commented on a change in pull request #6291: Add consumption rate limiter for LLConsumer

Posted by GitBox <gi...@apache.org>.
sajjad-moradi commented on a change in pull request #6291:
URL: https://github.com/apache/incubator-pinot/pull/6291#discussion_r537127182



##########
File path: pinot-core/src/test/java/org/apache/pinot/core/data/manager/realtime/RealtimeConsumptionRateManagerTest.java
##########
@@ -0,0 +1,94 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.pinot.core.data.manager.realtime;
+
+import com.google.common.cache.LoadingCache;
+import java.util.Optional;
+import java.util.function.Function;
+import org.apache.pinot.core.data.manager.realtime.RealtimeConsumptionRateManager.ConsumptionRateLimiter;
+import org.apache.pinot.spi.stream.StreamConfig;
+import org.testng.annotations.Test;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+import static org.testng.Assert.*;
+
+
+public class RealtimeConsumptionRateManagerTest {
+
+  private static final int EPSILON = 50; // msec
+
+  @Test
+  public void testCreateRateLimiter()
+      throws Exception {
+
+    RealtimeConsumptionRateManager rateManager = RealtimeConsumptionRateManager.getInstance();
+
+    // throttling is not enabled
+    StreamConfig streamConfig = mock(StreamConfig.class);
+    when(streamConfig.getTopicConsumptionRateLimit()).thenReturn(Optional.of(2.0));
+    ConsumptionRateLimiter rateLimiter = rateManager.createRateLimiterForSinglePartitionTopic(streamConfig);
+    assertTiming(() -> {
+      rateLimiter.throttle();
+      rateLimiter.throttle();
+      rateLimiter.throttle();
+    }, totalTimeMs -> totalTimeMs < 1000);
+
+    // consumption rate limit is set to 2 per second for a single partition topic
+    rateManager.enableThrottling();
+    when(streamConfig.getTopicConsumptionRateLimit()).thenReturn(Optional.of(2.0));
+    ConsumptionRateLimiter rateLimiter2 = rateManager.createRateLimiterForSinglePartitionTopic(streamConfig);
+    assertTiming(() -> {
+      rateLimiter2.throttle();
+      rateLimiter2.throttle();
+      rateLimiter2.throttle();
+    }, totalTimeMs -> totalTimeMs > 1000 - EPSILON);
+
+    // consumption rate limit is set to 20 per second for a topic with 10 partitions
+    when(streamConfig.getTopicConsumptionRateLimit()).thenReturn(Optional.of(20.0));
+    LoadingCache<StreamConfig, Integer> mockLoadingCache = mock(LoadingCache.class);
+    when(mockLoadingCache.get(any(StreamConfig.class))).thenReturn(10);
+    rateManager._streamConfigToTopicPartitionCountMap = mockLoadingCache;
+    ConsumptionRateLimiter rateLimiter3 = rateManager.createRateLimiterForMultiPartitionTopic(streamConfig);
+    assertTiming(() -> {
+      rateLimiter3.throttle();
+      rateLimiter3.throttle();
+      rateLimiter3.throttle();
+    }, totalTimeMs -> totalTimeMs > 1000 - EPSILON);
+
+    // no config for rate limiter means no throttling
+    when(streamConfig.getTopicConsumptionRateLimit()).thenReturn(Optional.empty());
+    ConsumptionRateLimiter rateLimiter4 = rateManager.createRateLimiterForSinglePartitionTopic(streamConfig);
+    assertTiming(() -> {
+      rateLimiter4.throttle();
+      rateLimiter4.throttle();
+      rateLimiter4.throttle();
+    }, totalTimeMs -> totalTimeMs < 1000);
+
+  }
+
+  private void assertTiming(Runnable runnable, Function<Long, Boolean> assertFunc) {
+    long start = System.currentTimeMillis();
+    runnable.run();
+    long totalTimeMs = System.currentTimeMillis() - start;
+    assertTrue(assertFunc.apply(totalTimeMs));
+  }
+}

Review comment:
       will do.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] jackjlli commented on a change in pull request #6291: Add consumption rate limiter for LLConsumer

Posted by GitBox <gi...@apache.org>.
jackjlli commented on a change in pull request #6291:
URL: https://github.com/apache/incubator-pinot/pull/6291#discussion_r535832670



##########
File path: pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeConsumptionRateManager.java
##########
@@ -0,0 +1,131 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.pinot.core.data.manager.realtime;
+
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import com.google.common.util.concurrent.RateLimiter;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
+import org.apache.pinot.spi.stream.PartitionCountFetcher;
+import org.apache.pinot.spi.stream.StreamConfig;
+import org.apache.pinot.spi.utils.retry.RetryPolicies;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * This class is responsible for creating realtime consumption rate limiters. If rate limiter is used for
+ * multi-partition topics, the provided rate in StreamConfig is divided by partition count. This class leverages a
+ * cache for storing partition count for different topics as retrieving partition count from Kafka is a bit expensive
+ * and also the same count will be used of all partition consumers of the same topic.
+ */
+public class RealtimeConsumptionRateManager {
+  private static final Logger LOGGER = LoggerFactory.getLogger(RealtimeConsumptionRateManager.class);
+  private static final RealtimeConsumptionRateManager INSTANCE = new RealtimeConsumptionRateManager();
+  private static final int CACHE_ENTRY_EXPIRATION_TIME_IN_MINUTES = 10;
+
+  @VisibleForTesting
+  LoadingCache<StreamConfig, Integer> _streamConfigToTopicPartitionCountMap = buildCache();
+  private boolean _isThrottlingAllowed = false;
+
+  private RealtimeConsumptionRateManager() {
+  }
+
+  public static RealtimeConsumptionRateManager getInstance() {
+    return INSTANCE;
+  }
+
+  public void enableThrottling() {
+    _isThrottlingAllowed = true;
+  }
+
+  public ConsumptionRateLimiter createRateLimiterForSinglePartitionTopic(StreamConfig streamConfig) {
+    return createRateLimiter(streamConfig, false);
+  }
+
+  public ConsumptionRateLimiter createRateLimiterForMultiPartitionTopic(StreamConfig streamConfig) {
+    return createRateLimiter(streamConfig, true);
+  }
+
+  private ConsumptionRateLimiter createRateLimiter(StreamConfig streamConfig, boolean multiPartitionTopic) {

Review comment:
       Can you add a description of `multiPartitionTopic` on how this get used?

##########
File path: pinot-core/src/test/java/org/apache/pinot/core/data/manager/realtime/RealtimeConsumptionRateManagerTest.java
##########
@@ -0,0 +1,94 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.pinot.core.data.manager.realtime;
+
+import com.google.common.cache.LoadingCache;
+import java.util.Optional;
+import java.util.function.Function;
+import org.apache.pinot.core.data.manager.realtime.RealtimeConsumptionRateManager.ConsumptionRateLimiter;
+import org.apache.pinot.spi.stream.StreamConfig;
+import org.testng.annotations.Test;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+import static org.testng.Assert.*;
+
+
+public class RealtimeConsumptionRateManagerTest {
+
+  private static final int EPSILON = 50; // msec
+
+  @Test
+  public void testCreateRateLimiter()
+      throws Exception {
+
+    RealtimeConsumptionRateManager rateManager = RealtimeConsumptionRateManager.getInstance();
+
+    // throttling is not enabled
+    StreamConfig streamConfig = mock(StreamConfig.class);
+    when(streamConfig.getTopicConsumptionRateLimit()).thenReturn(Optional.of(2.0));
+    ConsumptionRateLimiter rateLimiter = rateManager.createRateLimiterForSinglePartitionTopic(streamConfig);
+    assertTiming(() -> {
+      rateLimiter.throttle();
+      rateLimiter.throttle();
+      rateLimiter.throttle();
+    }, totalTimeMs -> totalTimeMs < 1000);
+
+    // consumption rate limit is set to 2 per second for a single partition topic
+    rateManager.enableThrottling();
+    when(streamConfig.getTopicConsumptionRateLimit()).thenReturn(Optional.of(2.0));
+    ConsumptionRateLimiter rateLimiter2 = rateManager.createRateLimiterForSinglePartitionTopic(streamConfig);
+    assertTiming(() -> {
+      rateLimiter2.throttle();
+      rateLimiter2.throttle();
+      rateLimiter2.throttle();
+    }, totalTimeMs -> totalTimeMs > 1000 - EPSILON);
+
+    // consumption rate limit is set to 20 per second for a topic with 10 partitions
+    when(streamConfig.getTopicConsumptionRateLimit()).thenReturn(Optional.of(20.0));
+    LoadingCache<StreamConfig, Integer> mockLoadingCache = mock(LoadingCache.class);
+    when(mockLoadingCache.get(any(StreamConfig.class))).thenReturn(10);
+    rateManager._streamConfigToTopicPartitionCountMap = mockLoadingCache;
+    ConsumptionRateLimiter rateLimiter3 = rateManager.createRateLimiterForMultiPartitionTopic(streamConfig);
+    assertTiming(() -> {
+      rateLimiter3.throttle();
+      rateLimiter3.throttle();
+      rateLimiter3.throttle();
+    }, totalTimeMs -> totalTimeMs > 1000 - EPSILON);
+
+    // no config for rate limiter means no throttling
+    when(streamConfig.getTopicConsumptionRateLimit()).thenReturn(Optional.empty());
+    ConsumptionRateLimiter rateLimiter4 = rateManager.createRateLimiterForSinglePartitionTopic(streamConfig);
+    assertTiming(() -> {
+      rateLimiter4.throttle();
+      rateLimiter4.throttle();
+      rateLimiter4.throttle();
+    }, totalTimeMs -> totalTimeMs < 1000);
+
+  }
+
+  private void assertTiming(Runnable runnable, Function<Long, Boolean> assertFunc) {
+    long start = System.currentTimeMillis();
+    runnable.run();
+    long totalTimeMs = System.currentTimeMillis() - start;
+    assertTrue(assertFunc.apply(totalTimeMs));
+  }
+}

Review comment:
       need one extra line

##########
File path: pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeConsumptionRateManager.java
##########
@@ -0,0 +1,131 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.pinot.core.data.manager.realtime;
+
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import com.google.common.util.concurrent.RateLimiter;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
+import org.apache.pinot.spi.stream.PartitionCountFetcher;
+import org.apache.pinot.spi.stream.StreamConfig;
+import org.apache.pinot.spi.utils.retry.RetryPolicies;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * This class is responsible for creating realtime consumption rate limiters. If rate limiter is used for
+ * multi-partition topics, the provided rate in StreamConfig is divided by partition count. This class leverages a
+ * cache for storing partition count for different topics as retrieving partition count from Kafka is a bit expensive
+ * and also the same count will be used of all partition consumers of the same topic.
+ */
+public class RealtimeConsumptionRateManager {
+  private static final Logger LOGGER = LoggerFactory.getLogger(RealtimeConsumptionRateManager.class);
+  private static final RealtimeConsumptionRateManager INSTANCE = new RealtimeConsumptionRateManager();
+  private static final int CACHE_ENTRY_EXPIRATION_TIME_IN_MINUTES = 10;
+
+  @VisibleForTesting
+  LoadingCache<StreamConfig, Integer> _streamConfigToTopicPartitionCountMap = buildCache();
+  private boolean _isThrottlingAllowed = false;
+
+  private RealtimeConsumptionRateManager() {
+  }
+
+  public static RealtimeConsumptionRateManager getInstance() {
+    return INSTANCE;
+  }
+
+  public void enableThrottling() {
+    _isThrottlingAllowed = true;
+  }
+
+  public ConsumptionRateLimiter createRateLimiterForSinglePartitionTopic(StreamConfig streamConfig) {
+    return createRateLimiter(streamConfig, false);
+  }
+
+  public ConsumptionRateLimiter createRateLimiterForMultiPartitionTopic(StreamConfig streamConfig) {
+    return createRateLimiter(streamConfig, true);
+  }
+
+  private ConsumptionRateLimiter createRateLimiter(StreamConfig streamConfig, boolean multiPartitionTopic) {
+    if (!streamConfig.getTopicConsumptionRateLimit().isPresent()) {
+      return NOOP_RATE_LIMITER;
+    }
+    int partitionCount = 1;
+    if (multiPartitionTopic) {
+      try {
+        partitionCount = _streamConfigToTopicPartitionCountMap.get(streamConfig);

Review comment:
       Do we need to store the complete streamConfig here? Can we just use table name as key?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] codecov-io commented on pull request #6291: Add consumption rate limiter for LLConsumer

Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #6291:
URL: https://github.com/apache/incubator-pinot/pull/6291#issuecomment-733950739


   # [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6291?src=pr&el=h1) Report
   > Merging [#6291](https://codecov.io/gh/apache/incubator-pinot/pull/6291?src=pr&el=desc) (6c8bb8b) into [master](https://codecov.io/gh/apache/incubator-pinot/commit/1beaab59b73f26c4e35f3b9bc856b03806cddf5a?el=desc) (1beaab5) will **decrease** coverage by `20.58%`.
   > The diff coverage is `52.01%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-pinot/pull/6291/graphs/tree.svg?width=650&height=150&src=pr&token=4ibza2ugkz)](https://codecov.io/gh/apache/incubator-pinot/pull/6291?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master    #6291       +/-   ##
   ===========================================
   - Coverage   66.44%   45.86%   -20.59%     
   ===========================================
     Files        1075     1253      +178     
     Lines       54773    61253     +6480     
     Branches     8168     8868      +700     
   ===========================================
   - Hits        36396    28093     -8303     
   - Misses      15700    30870    +15170     
   + Partials     2677     2290      -387     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | integration | `45.86% <52.01%> (?)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-pinot/pull/6291?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...ot/broker/broker/AllowAllAccessControlFactory.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvYnJva2VyL0FsbG93QWxsQWNjZXNzQ29udHJvbEZhY3RvcnkuamF2YQ==) | `100.00% <ø> (ø)` | |
   | [.../helix/BrokerUserDefinedMessageHandlerFactory.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvYnJva2VyL2hlbGl4L0Jyb2tlclVzZXJEZWZpbmVkTWVzc2FnZUhhbmRsZXJGYWN0b3J5LmphdmE=) | `52.83% <0.00%> (-13.84%)` | :arrow_down: |
   | [...org/apache/pinot/broker/queryquota/HitCounter.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcXVlcnlxdW90YS9IaXRDb3VudGVyLmphdmE=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...che/pinot/broker/queryquota/MaxHitRateTracker.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcXVlcnlxdW90YS9NYXhIaXRSYXRlVHJhY2tlci5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...ache/pinot/broker/queryquota/QueryQuotaEntity.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcXVlcnlxdW90YS9RdWVyeVF1b3RhRW50aXR5LmphdmE=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [...ker/routing/instanceselector/InstanceSelector.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcm91dGluZy9pbnN0YW5jZXNlbGVjdG9yL0luc3RhbmNlU2VsZWN0b3IuamF2YQ==) | `100.00% <ø> (ø)` | |
   | [...ceselector/StrictReplicaGroupInstanceSelector.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcm91dGluZy9pbnN0YW5jZXNlbGVjdG9yL1N0cmljdFJlcGxpY2FHcm91cEluc3RhbmNlU2VsZWN0b3IuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [.../main/java/org/apache/pinot/client/Connection.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L0Nvbm5lY3Rpb24uamF2YQ==) | `22.22% <0.00%> (-26.62%)` | :arrow_down: |
   | [...not/common/assignment/InstancePartitionsUtils.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vYXNzaWdubWVudC9JbnN0YW5jZVBhcnRpdGlvbnNVdGlscy5qYXZh) | `64.28% <ø> (-8.89%)` | :arrow_down: |
   | [.../apache/pinot/common/exception/QueryException.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vZXhjZXB0aW9uL1F1ZXJ5RXhjZXB0aW9uLmphdmE=) | `90.27% <ø> (+5.55%)` | :arrow_up: |
   | ... and [1247 more](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6291?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6291?src=pr&el=footer). Last update [fe9d3c7...6c8bb8b](https://codecov.io/gh/apache/incubator-pinot/pull/6291?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] sajjad-moradi commented on pull request #6291: Add consumption rate limiter for LLConsumer

Posted by GitBox <gi...@apache.org>.
sajjad-moradi commented on pull request #6291:
URL: https://github.com/apache/incubator-pinot/pull/6291#issuecomment-733995748


   > Can you note in your checkin comments that what we are throttling is not really the consumption, but the _processing_ of messages. We will still consume as much as we can from the stream.
   > 
   > If we were to limit consumption, then the behavior will be somewhat like:
   > 
   > ```
   > while (true) {
   >   consumeMsgsAsPerSomeAllowedRate()
   >   processAllMsgsConsumed()
   >   sleepAsIndicatedByRateLimiter()
   > }
   > ```
   > 
   > Whereas by rate limiting the processing, we are doing the following:
   > 
   > ```
   > while (true) {
   >   consumeAllMsgsThatWeCan()
   >   foreach(msg) {
   >     processMsg()
   >     sleepAsDictatedByRateLimiter()
   >   }
   > }
   > ```
   > 
   > So, we may be taking up more heap in the second case ?
   
   I actually looked into that and Kafka doesn't provide an API to retrieve limited number of messages. IMO having a rate limit on processing will have similar effect as if we put the rate limit on the consumption because we synchronously process the messages after the messages are polled from Kafka. For example, let's assume for a bursty period, the incoming rate of Kafka messages is 100 msgs/sec and we have set the rate limit to 20 msgs/sec. That means for a period of 10 seconds, we only process 200 messages and while we're processing messages, we don't consume new messages. This effectively puts the consumption rate to 20msgs/sec while if there was no rate limit we would've consumed 1000 messages at rate 100 msgs/sec.
   
   Side note:
   Kafka consumer has this configuration `max.partition.fetch.byte` that limits the count of consumed bytes. That is a bit hard to utilize as the intention here is to consume less number of messages than consumed bytes.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] codecov-io edited a comment on pull request #6291: Add consumption rate limiter for LLConsumer

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #6291:
URL: https://github.com/apache/incubator-pinot/pull/6291#issuecomment-733950739


   # [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6291?src=pr&el=h1) Report
   > Merging [#6291](https://codecov.io/gh/apache/incubator-pinot/pull/6291?src=pr&el=desc) (747f1df) into [master](https://codecov.io/gh/apache/incubator-pinot/commit/1beaab59b73f26c4e35f3b9bc856b03806cddf5a?el=desc) (1beaab5) will **decrease** coverage by `22.57%`.
   > The diff coverage is `51.95%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-pinot/pull/6291/graphs/tree.svg?width=650&height=150&src=pr&token=4ibza2ugkz)](https://codecov.io/gh/apache/incubator-pinot/pull/6291?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master    #6291       +/-   ##
   ===========================================
   - Coverage   66.44%   43.87%   -22.58%     
   ===========================================
     Files        1075     1333      +258     
     Lines       54773    65355    +10582     
     Branches     8168     9524     +1356     
   ===========================================
   - Hits        36396    28675     -7721     
   - Misses      15700    34282    +18582     
   + Partials     2677     2398      -279     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | integration | `43.87% <51.95%> (?)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-pinot/pull/6291?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...ot/broker/broker/AllowAllAccessControlFactory.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvYnJva2VyL0FsbG93QWxsQWNjZXNzQ29udHJvbEZhY3RvcnkuamF2YQ==) | `100.00% <ø> (ø)` | |
   | [.../helix/BrokerUserDefinedMessageHandlerFactory.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvYnJva2VyL2hlbGl4L0Jyb2tlclVzZXJEZWZpbmVkTWVzc2FnZUhhbmRsZXJGYWN0b3J5LmphdmE=) | `52.83% <0.00%> (-13.84%)` | :arrow_down: |
   | [...org/apache/pinot/broker/queryquota/HitCounter.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcXVlcnlxdW90YS9IaXRDb3VudGVyLmphdmE=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...che/pinot/broker/queryquota/MaxHitRateTracker.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcXVlcnlxdW90YS9NYXhIaXRSYXRlVHJhY2tlci5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...ache/pinot/broker/queryquota/QueryQuotaEntity.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcXVlcnlxdW90YS9RdWVyeVF1b3RhRW50aXR5LmphdmE=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [...ker/routing/instanceselector/InstanceSelector.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcm91dGluZy9pbnN0YW5jZXNlbGVjdG9yL0luc3RhbmNlU2VsZWN0b3IuamF2YQ==) | `100.00% <ø> (ø)` | |
   | [...ceselector/StrictReplicaGroupInstanceSelector.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcm91dGluZy9pbnN0YW5jZXNlbGVjdG9yL1N0cmljdFJlcGxpY2FHcm91cEluc3RhbmNlU2VsZWN0b3IuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [.../main/java/org/apache/pinot/client/Connection.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L0Nvbm5lY3Rpb24uamF2YQ==) | `22.22% <0.00%> (-26.62%)` | :arrow_down: |
   | [...not/common/assignment/InstancePartitionsUtils.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vYXNzaWdubWVudC9JbnN0YW5jZVBhcnRpdGlvbnNVdGlscy5qYXZh) | `64.28% <ø> (-8.89%)` | :arrow_down: |
   | [.../apache/pinot/common/exception/QueryException.java](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vZXhjZXB0aW9uL1F1ZXJ5RXhjZXB0aW9uLmphdmE=) | `90.27% <ø> (+5.55%)` | :arrow_up: |
   | ... and [1349 more](https://codecov.io/gh/apache/incubator-pinot/pull/6291/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6291?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6291?src=pr&el=footer). Last update [fe9d3c7...747f1df](https://codecov.io/gh/apache/incubator-pinot/pull/6291?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org