You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2022/11/04 08:51:58 UTC
[GitHub] [druid] tejaswini-imply opened a new pull request, #13311: Adds cluster level idleConfig setting for supervisor
tejaswini-imply opened a new pull request, #13311:
URL: https://github.com/apache/druid/pull/13311
This PR enables cluster admin to define default idle config for all supervisors. The new cluster-level settings and their defaults are:
```
druid.supervisor.idleConfig.enabled = false
druid.supervisor.idleConfig.inactiveAfterMillis = 600_000
```
This configuration can be overridden on individual basis through `ingestionSpec.ioConfig.idleConfig`.
<hr>
##### Key changed/added classes in this PR
* `SupervisorStateManagerConfig`
* `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:
- [ ] 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
[GitHub] [druid] abhishekagarwal87 merged pull request #13311: Adds cluster level idleConfig setting for supervisor
Posted by GitBox <gi...@apache.org>.
abhishekagarwal87 merged PR #13311:
URL: https://github.com/apache/druid/pull/13311
--
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
[GitHub] [druid] abhishekagarwal87 commented on pull request #13311: Adds cluster level idleConfig setting for supervisor
Posted by GitBox <gi...@apache.org>.
abhishekagarwal87 commented on PR #13311:
URL: https://github.com/apache/druid/pull/13311#issuecomment-1306894365
Merged since IT failure is unrelated.
--
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
[GitHub] [druid] kfaraz commented on a diff in pull request #13311: Adds cluster level idleConfig setting for supervisor
Posted by GitBox <gi...@apache.org>.
kfaraz commented on code in PR #13311:
URL: https://github.com/apache/druid/pull/13311#discussion_r1016121948
##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:
##########
@@ -804,6 +805,23 @@ public SeekableStreamSupervisor(
: Math.min(10, this.ioConfig.getTaskCount() * this.ioConfig.getReplicas()));
}
+ IdleConfig specIdleConfig = spec.getIoConfig().getIdleConfig();
+ if (specIdleConfig != null) {
+ if (specIdleConfig.getInactiveAfterMillis() != null) {
Review Comment:
I feel we might still incorrectly handle the case where user has specified `inactiveAfterMillis` at the supervisor level but not `enabled`. In that case, we should just override the `inactiveAfterMillis` and take the cluster level value for `enabled`.
But I guess that's a corner case and we can do it in a later PR.
--
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
[GitHub] [druid] tejaswini-imply commented on pull request #13311: Adds cluster level idleConfig setting for supervisor
Posted by GitBox <gi...@apache.org>.
tejaswini-imply commented on PR #13311:
URL: https://github.com/apache/druid/pull/13311#issuecomment-1306750444
@kfaraz The transactional kafka index integration test seems to be flaky. It passed in the other run, and the changes have nothing to do with these tests.
--
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
[GitHub] [druid] kfaraz commented on a diff in pull request #13311: Adds cluster level idleConfig setting for supervisor
Posted by GitBox <gi...@apache.org>.
kfaraz commented on code in PR #13311:
URL: https://github.com/apache/druid/pull/13311#discussion_r1014574126
##########
extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/supervisor/KinesisSupervisorIOConfig.java:
##########
@@ -91,7 +92,7 @@ public KinesisSupervisorIOConfig(
earlyMessageRejectionPeriod,
autoScalerConfig,
lateMessageRejectionStartDateTime,
- null
+ new IdleConfig(false, null)
Review Comment:
We should either pass both as null or both as the default values (`false` and `600_000`). I prefer both null as they are handled inside the `IdleConfig` anyway.
##########
server/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorStateManagerConfig.java:
##########
@@ -46,6 +46,12 @@
@JsonProperty
private int maxStoredExceptionEvents = Math.max(unhealthinessThreshold, healthinessThreshold);
+ @JsonProperty("idleConfig.enabled")
+ private boolean idleConfigEnabled = false;
Review Comment:
Maybe instead of flattening the spec, keep an `idleConfig` itself here and handle it correctly inside the `SeekableStreamSupervisor`.
##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:
##########
@@ -3290,8 +3291,17 @@ private void checkCurrentTaskState() throws ExecutionException, InterruptedExcep
private void checkIfStreamInactiveAndTurnSupervisorIdle()
{
- IdleConfig idleConfig = spec.getIoConfig().getIdleConfig();
- if ((idleConfig == null || !idleConfig.isEnabled()) || spec.isSuspended()) {
+ if (idleConfig == null) {
Review Comment:
This initialization should be done in the constructor itself.
##########
docs/configuration/index.md:
##########
@@ -1152,7 +1152,10 @@ There are additional configs for autoscaling (if it is enabled):
|`druid.supervisor.taskUnhealthinessThreshold`|The number of consecutive task failures before the supervisor is considered unhealthy.|3|
|`druid.supervisor.storeStackTrace`|Whether full stack traces of supervisor exceptions should be stored and returned by the supervisor `/status` endpoint.|false|
|`druid.supervisor.maxStoredExceptionEvents`|The maximum number of exception events that can be returned through the supervisor `/status` endpoint.|`max(healthinessThreshold, unhealthinessThreshold)`|
+|`druid.supervisor.idleConfig.enabled`|If `true`, supervisor can become idle if there is no data on input stream/topic for some time.|false|
+|`druid.supervisor.idleConfig.inactiveAfterMillis`|Supervisor is marked as idle if all existing data has been read from input topic and no new data has been published for `inactiveAfterMillis` milliseconds.|`600_000`|
+idleConfig here becomes the default behaviour for the entire cluster. See [Idle Configuration in KafkaSupervisorIOConfig](../development/extensions-core/kafka-supervisor-reference.md/#KafkaSupervisorIOConfig) to override it on individual basis.
Review Comment:
```suggestion
The `idleConfig` specified in the runtime properties of the overlord defines the default behaviour for the entire cluster. See [Idle Configuration in KafkaSupervisorIOConfig](../development/extensions-core/kafka-supervisor-reference.md/#KafkaSupervisorIOConfig) to override it for an individual supervisor.
```
##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:
##########
@@ -3290,8 +3291,17 @@ private void checkCurrentTaskState() throws ExecutionException, InterruptedExcep
private void checkIfStreamInactiveAndTurnSupervisorIdle()
{
- IdleConfig idleConfig = spec.getIoConfig().getIdleConfig();
- if ((idleConfig == null || !idleConfig.isEnabled()) || spec.isSuspended()) {
+ if (idleConfig == null) {
+ idleConfig = java.util.Optional.ofNullable(spec.getIoConfig().getIdleConfig())
Review Comment:
Please simplify this to a plain if-else.
--
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
[GitHub] [druid] kfaraz commented on pull request #13311: Adds cluster level idleConfig setting for supervisor
Posted by GitBox <gi...@apache.org>.
kfaraz commented on PR #13311:
URL: https://github.com/apache/druid/pull/13311#issuecomment-1306686976
@tejaswini-imply , thanks for the fix. A couple of ITs seem to be failing consistently. Could you please check if the failures are genuine?
--
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
[GitHub] [druid] tejaswini-imply commented on a diff in pull request #13311: Adds cluster level idleConfig setting for supervisor
Posted by GitBox <gi...@apache.org>.
tejaswini-imply commented on code in PR #13311:
URL: https://github.com/apache/druid/pull/13311#discussion_r1016228195
##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:
##########
@@ -804,6 +805,23 @@ public SeekableStreamSupervisor(
: Math.min(10, this.ioConfig.getTaskCount() * this.ioConfig.getReplicas()));
}
+ IdleConfig specIdleConfig = spec.getIoConfig().getIdleConfig();
+ if (specIdleConfig != null) {
+ if (specIdleConfig.getInactiveAfterMillis() != null) {
Review Comment:
That is not done deliberately since KinesisSupervisor should not go idle when cluster-level config is enabled. It can be done with KinesisSupervisor PR.
--
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
[GitHub] [druid] tejaswini-imply commented on pull request #13311: Adds cluster level idleConfig setting for supervisor
Posted by GitBox <gi...@apache.org>.
tejaswini-imply commented on PR #13311:
URL: https://github.com/apache/druid/pull/13311#issuecomment-1306590814
I have addressed your comments in the latest commit @kfaraz. PTAL.
--
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
[GitHub] [druid] kfaraz commented on a diff in pull request #13311: Adds cluster level idleConfig setting for supervisor
Posted by GitBox <gi...@apache.org>.
kfaraz commented on code in PR #13311:
URL: https://github.com/apache/druid/pull/13311#discussion_r1014989653
##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:
##########
@@ -804,6 +805,15 @@ public SeekableStreamSupervisor(
: Math.min(10, this.ioConfig.getTaskCount() * this.ioConfig.getReplicas()));
}
+ if (spec.getIoConfig().getIdleConfig() != null) {
+ idleConfig = spec.getIoConfig().getIdleConfig();
Review Comment:
It's possible that users have only specified enabled/disabled at the supervisor level, but not the timeout value. Shouldn't we pick up the timeout value defined at the cluster level then?
##########
docs/configuration/index.md:
##########
@@ -1152,7 +1152,10 @@ There are additional configs for autoscaling (if it is enabled):
|`druid.supervisor.taskUnhealthinessThreshold`|The number of consecutive task failures before the supervisor is considered unhealthy.|3|
|`druid.supervisor.storeStackTrace`|Whether full stack traces of supervisor exceptions should be stored and returned by the supervisor `/status` endpoint.|false|
|`druid.supervisor.maxStoredExceptionEvents`|The maximum number of exception events that can be returned through the supervisor `/status` endpoint.|`max(healthinessThreshold, unhealthinessThreshold)`|
+|`druid.supervisor.idleConfig.enabled`|If `true`, supervisor can become idle if there is no data on input stream/topic for some time.|false|
+|`druid.supervisor.idleConfig.inactiveAfterMillis`|Supervisor is marked as idle if all existing data has been read from input topic and no new data has been published for `inactiveAfterMillis` milliseconds.|`600_000`|
+The `idleConfig` specified in the runtime properties of the overlord defines the default behavior for the entire cluster. See [Idle Configuration in `KafkaSupervisorIOConfig`](../development/extensions-core/kafka-supervisor-reference.md/#KafkaSupervisorIOConfig) to override it for an individual supervisor.
#### Overlord Dynamic Configuration
Review Comment:
Nit: please add a newline after this before the start of the next section.
##########
website/.spelling:
##########
@@ -2285,4 +2285,4 @@ Aotearoa
Czechia
Zeelund
- ../docs/tutorials/docker.md
- nano
+ nano
Review Comment:
Please revert this change if not needed.
--
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
[GitHub] [druid] tejaswini-imply commented on pull request #13311: Adds cluster level idleConfig setting for supervisor
Posted by GitBox <gi...@apache.org>.
tejaswini-imply commented on PR #13311:
URL: https://github.com/apache/druid/pull/13311#issuecomment-1305033303
Thanks for the review @kfaraz, I have addressed your comments in the latest commit. Please take a look.
--
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
[GitHub] [druid] tejaswini-imply commented on a diff in pull request #13311: Adds cluster level idleConfig setting for supervisor
Posted by GitBox <gi...@apache.org>.
tejaswini-imply commented on code in PR #13311:
URL: https://github.com/apache/druid/pull/13311#discussion_r1014973430
##########
server/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorStateManagerConfig.java:
##########
@@ -46,6 +46,12 @@
@JsonProperty
private int maxStoredExceptionEvents = Math.max(unhealthinessThreshold, healthinessThreshold);
+ @JsonProperty("idleConfig.enabled")
+ private boolean idleConfigEnabled = false;
Review Comment:
We're passing 2 spec mappings `druid.supervisor.idleConfig.enabled, druid.supervisor.idleConfig.inactiveAfterMillis` rather than an idleConfig json object, I am not sure if it can be deserialised to idleConfig mapping.
--
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