You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "georgew5656 (via GitHub)" <gi...@apache.org> on 2024/08/22 18:42:03 UTC
[PR] Add supervisor log when task count is greater than partitions (druid)
georgew5656 opened a new pull request, #16948:
URL: https://github.com/apache/druid/pull/16948
Currently streaming supervisors will handle the case where the # of task groups is greater than the # of partitions available by truncating the # of task groups to the # of partitions (see KafkaSupervisor.getTaskGroupIdForPartition). This is okay behavior but its nice to know when this situation occurs (because it indicates the kafka topic should be scaled up).
### Description
Add a warn log when discovering partitions from streams if the # of discovered partitions is less than the number of task groups configured. This seemed like the best place to do this.
The other place i considered was in generateReport, but thats only called when the supervisor /status endpoint is called or if debug logging is enabled.
#### Release note
- add a informational log when task groups > partition count.
<hr>
##### Key changed/added classes in this PR
* `SeekableStreamSupervisor`
<hr>
<!-- Check the items by putting "x" in the brackets for the done things. Not all of these items apply to every PR. Remove the items which are not done or not relevant to the PR. None of the items from the checklist below are strictly necessary, but it would be very helpful if you at least self-review the PR. -->
This PR has:
- [X] been self-reviewed.
- [ ] using the [concurrency checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md) (Remove this item if the PR doesn't have any relation to concurrency.)
- [ ] added documentation for new or modified features or behaviors.
- [ ] a release note entry in the PR description.
- [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
- [ ] added or updated version, license, or notice information in [licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
- [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
- [ ] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met.
- [ ] added integration tests.
- [ ] been tested in a test Druid cluster.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Add supervisor log when task count is greater than partitions (druid)
Posted by "georgew5656 (via GitHub)" <gi...@apache.org>.
georgew5656 merged PR #16948:
URL: https://github.com/apache/druid/pull/16948
--
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.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Add supervisor log when task count is greater than partitions (druid)
Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on code in PR #16948:
URL: https://github.com/apache/druid/pull/16948#discussion_r1728276001
##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:
##########
@@ -2733,6 +2733,10 @@ private boolean updatePartitionDataFromStream()
log.debug("Found [%d] partitions for stream [%s]", partitionIdsFromSupplier.size(), ioConfig.getStream());
+ Integer taskCount = spec.getIoConfig().getTaskCount();
Review Comment:
It seems that `spec.getIoConfig().getTaskCount()` will always be non-null.
Maybe we could update the `SeekableStreamSupervisorIOConfig.getTaskCount()` to return a primitive `int` instead of a boxed `Integer` to avoid confusion.
```suggestion
final int configuredTaskCount = spec.getIoConfig().getTaskCount();
```
##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:
##########
@@ -2733,6 +2733,10 @@ private boolean updatePartitionDataFromStream()
log.debug("Found [%d] partitions for stream [%s]", partitionIdsFromSupplier.size(), ioConfig.getStream());
+ Integer taskCount = spec.getIoConfig().getTaskCount();
+ if (spec.getIoConfig().getTaskCount() > partitionIdsFromSupplier.size()) {
Review Comment:
```suggestion
if (configuredTaskCount > partitionIdsFromSupplier.size()) {
```
##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:
##########
@@ -2733,6 +2733,10 @@ private boolean updatePartitionDataFromStream()
log.debug("Found [%d] partitions for stream [%s]", partitionIdsFromSupplier.size(), ioConfig.getStream());
+ Integer taskCount = spec.getIoConfig().getTaskCount();
+ if (spec.getIoConfig().getTaskCount() > partitionIdsFromSupplier.size()) {
+ log.warn("Configured task count [%s] is greater than the [%d] of partitions for [%s].", taskCount, partitionIdsFromSupplier.size(), supervisorId);
Review Comment:
```suggestion
log.warn("Configured task count[%s] for supervisor[%s] is greater than the number of partitions[%d].", configuredTaskCount, supervisorId, partitionIdsFromSupplier.size());
```
--
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.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org