Repository navigation
Adds Idle feature to SeekableStreamSupervisor for inactive stream - #13144
Conversation
|
This pull request introduces 1 alert when merging d16f8d1 into 0bfa81b - view on LGTM.com new alerts:
|
|
This pull request introduces 1 alert when merging 440544e into 0bfa81b - view on LGTM.com new alerts:
|
|
@tejaswini-imply thank you for the changes and tests. |
AmatyaAvadhanula
left a comment
There was a problem hiding this comment.
@tejaswini-imply Thank you for the changes. LGTM
kfaraz
left a comment
There was a problem hiding this comment.
Thanks for the feature, @tejaswini-imply !
I have added a bunch of comments, mostly minor style suggestions.
Around the nomenclature of the new configs, naming a config behaviour or feature seems a little redundant.
I would prefer something like:
druid.supervisor.idleWhenInactive
or druid.server.setIdleWhenInactive
and
druid.supervisor.idleWaitTimeMillis.
| } | ||
|
|
||
| // if we're trying to switch to a healthy steady state (i.e. RUNNING or SUSPENDED) but haven't had a successful run | ||
| // if we're trying to switch to a healthy steady state (i.e. RUNNING or SUSPENDED) or IDLE state but haven't had a successful run |
There was a problem hiding this comment.
I don't think this change is applicable since IDLE doesn't count as a "healthy steady state". IIUC, the healthySteadyState can only be RUNNING or SUSPENDED, which is determined while creating this SupervisorStateManager instance.
There was a problem hiding this comment.
IDLE isn't a healthy steady state. Hence it's mentioned healthy steady state or IDLE state. Please let me know if the way it's mentioned is confusing.
| @@ -0,0 +1,60 @@ | |||
| { | |||
There was a problem hiding this comment.
This spec seems pretty generic. Do we really need to add a new one for the new test or can we reuse any existing one?
kfaraz
left a comment
There was a problem hiding this comment.
Added minor comments, otherwise looks good.
| "idleConfig": { | ||
| "enabled": true, | ||
| "inactiveAfterMillis": 600000 | ||
| } |
|
|
||
| import javax.annotation.Nullable; | ||
|
|
||
| public class IdleConfig |
|
Thank you @tejaswini-imply. This is going to be very useful feature. |
|
Thanks @AmatyaAvadhanula, @kfaraz and @abhishekagarwal87 for thorough review. |
Fixes inclusion of all stream partitions in all tasks. The PR (Adds Idle feature to `SeekableStreamSupervisor` for inactive stream) - #13144 updates the resulting lag calculation map in `KafkaSupervisor` to include all the latest partitions from the stream to set the idle state accordingly rather than the previous way of lag calculation only for the partitions actively being read from the stream. This led to an explosion of metrics in lag reports in cases where 1000s of tasks per supervisor are present. Changes: - Add a new method to generate lags for only those partitions a single task is actively reading from while updating the Supervisor reports.
…pache#13144) * Idle Seekable stream supervisor changes. * nit * nit * nit * Adds unit tests * Supervisor decides it's idle state instead of AutoScaler * docs update * nit * nit * docs update * Adds Kafka unit test * Adds Kafka Integration test. * Updates travis config. * Updates kafka-indexing-service dependencies. * updates previous offsets snapshot & doc * Doesn't act if supervisor is suspended. * Fixes highest current offsets fetch bug, adds new Kafka UT tests, doc changes. * Reverts Kinesis Supervisor idle behaviour changes. * nit * nit * Corrects SeekableStreamSupervisorSpec check on idle behaviour config, adds tests. * Fixes getHighestCurrentOffsets to fetch offsets of publishing tasks too * Adds Kafka Supervisor UT * Improves test coverage in druid-server * Corrects IT override config * Doc updates and Syntactic changes * nit * supervisorSpec.ioConfig.idleConfig changes
Fixes inclusion of all stream partitions in all tasks. The PR (Adds Idle feature to `SeekableStreamSupervisor` for inactive stream) - apache#13144 updates the resulting lag calculation map in `KafkaSupervisor` to include all the latest partitions from the stream to set the idle state accordingly rather than the previous way of lag calculation only for the partitions actively being read from the stream. This led to an explosion of metrics in lag reports in cases where 1000s of tasks per supervisor are present. Changes: - Add a new method to generate lags for only those partitions a single task is actively reading from while updating the Supervisor reports.
Description
When a Kafka stream becomes inactive, i.e., no new data arrives, and all existing data is read, there is no need for Supervisor to create new indexing tasks.
tuningConfig.offsetFetchPeriod(default - 30 sec) and compares them with latest offsets (fetched everyioConfig.period(default - 30 sec)) for lags. If the stream is inactive fordataSchema.ioConfig.idleConfig.inactiveAfterMillis, then supervisor state is turned to IDLE. (See conf section)Please note the initial delay before new data is ingested from when new data enters into the stream is the frequency of offsets fetch (30 sec) + initial warmup time to create new indexing tasks.
How current offsets fetching work:
Current offsets are fetched from running, publishing tasks for the partitions available and for the rest of the partitions from the metadata storage.
Configuration changes
dataSchema.ioConfig.idleConfigenabled- If true Supervisor goes into idle state when stream is inactive. The default value is false.inactiveAfterMillis- Minimum time interval to wait until stream is considered inactive/idle. The default value is 600,000 millis.IDLE- to Basic states of Supervisor.Key changed/added classes in this PR
SeekableStreamSupervisorKafkaSupervisorKafkaSupervisorIOConfigSupervisorStateManagerIdleConfigThis PR has: