Skip to content

Make #16284 backward compatible#16334

Merged
kfaraz merged 6 commits intoapache:masterfrom
ac9817:make-16284-backward-compatible
Apr 29, 2024
Merged

Make #16284 backward compatible#16334
kfaraz merged 6 commits intoapache:masterfrom
ac9817:make-16284-backward-compatible

Conversation

@ac9817
Copy link
Copy Markdown
Contributor

@ac9817 ac9817 commented Apr 25, 2024

In #16284, we changed the way how kinesis autoscaler computes the lag for the purposes of autoscaling. Put that feature behind a flag so as to not annoy customers who have already configured the auto scaler thesholds based on the total lag.

This PR has:

  • been self-reviewed.
  • 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
  • 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 is met.
  • added integration tests.
  • been tested in a test Druid cluster.

long lag = lagBasedAutoScalerConfig.getLagStatsType() != null ?
lagStats.getMetric(lagBasedAutoScalerConfig.getLagStatsType()) :
lagStats.getPrefferedScalingMetric();
lagMetricsQueue.offer(lag > 0 ? lag : 0L);

Check notice

Code scanning / CodeQL

Ignored error status of call

Method run ignores exceptional return value of CircularFifoQueue<Long>.offer.
lagStats.getPrefferedScalingMetric();
lagMetricsQueue.offer(lag > 0 ? lag : 0L);
} else {
lagMetricsQueue.offer(0L);

Check notice

Code scanning / CodeQL

Ignored error status of call

Method run ignores exceptional return value of CircularFifoQueue<Long>.offer.
Copy link
Copy Markdown
Contributor

@kfaraz kfaraz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adithyachakilam , thanks for the changes! The implementation makes sense. I have just left some suggestions for field names and code structure.

Comment thread docs/ingestion/supervisor.md Outdated
@ac9817 ac9817 force-pushed the make-16284-backward-compatible branch from 0aa2f9c to 11aea27 Compare April 28, 2024 00:12
@ac9817 ac9817 force-pushed the make-16284-backward-compatible branch from 11aea27 to e80e413 Compare April 28, 2024 00:16
Copy link
Copy Markdown
Contributor

@kfaraz kfaraz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final comments, will approve once these are addressed.

Copy link
Copy Markdown
Contributor

@kfaraz kfaraz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the comments, @adithyachakilam .

@kfaraz
Copy link
Copy Markdown
Contributor

kfaraz commented Apr 29, 2024

Merging this PR as the pending tests are stuck due to the issue described in #16347 . The same tests have already passed on a different JDK.

@kfaraz kfaraz merged commit f8015eb into apache:master Apr 29, 2024
@suneet-s
Copy link
Copy Markdown
Contributor

@adithyachakilam Can you please backport this change to the 30.0 branch as it looks like #16284 is in that branch

ac9817 added a commit to ac9817/druid that referenced this pull request May 2, 2024
Changes:
- Add new config `lagAggregate` to `LagBasedAutoScalerConfig`
- Add field `aggregateForScaling` to `LagStats`
- Use the new field/config to determine which aggregate to use to compute lag
- Remove method `Supervisor.computeLagForAutoScaler()`
kfaraz pushed a commit that referenced this pull request May 3, 2024
Changes:
- Add new config `lagAggregate` to `LagBasedAutoScalerConfig`
- Add field `aggregateForScaling` to `LagStats`
- Use the new field/config to determine which aggregate to use to compute lag
- Remove method `Supervisor.computeLagForAutoScaler()`
@kfaraz kfaraz added this to the 31.0.0 milestone Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants