supervisor/autoscaler: Fix clearing of collected lags on skipped scale actions#17356
Merged
suneet-s merged 6 commits intoapache:masterfrom Oct 17, 2024
Merged
supervisor/autoscaler: Fix clearing of collected lags on skipped scale actions#17356suneet-s merged 6 commits intoapache:masterfrom
suneet-s merged 6 commits intoapache:masterfrom
Conversation
suneet-s
reviewed
Oct 15, 2024
Contributor
suneet-s
left a comment
There was a problem hiding this comment.
I think the change looks good, but have some naming suggestions to make things a little clearer to the reader.
| public void testSeekableStreamSupervisorSpecWithScaleInThresholdGreaterThanPartitions() throws InterruptedException | ||
| { | ||
| EasyMock.expect(spec.getSupervisorStateManagerConfig()).andReturn(supervisorConfig).anyTimes(); | ||
| EasyMock.expect(spec.getDataSchema()).andReturn(getDataSchema()).anyTimes(); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation
ac9817
commented
Oct 16, 2024
| Thread.sleep(1 * 1000); | ||
| int taskCountAfterScale = supervisor.getIoConfig().getTaskCount(); | ||
| Assert.assertEquals(2, taskCountAfterScale); | ||
| autoscaler.stop(); |
Contributor
Author
There was a problem hiding this comment.
This was causing issues randomly because the autoscaler was kept running and was emitting events which was same listener for the whole suite of tests in this class.
Contributor
|
Overruling CI - The code changes have no impact on the SuperSorterTest AFAICT. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
There are two things that are done after a scaling action is successfully initiated,
minTriggerScaleActionFrequencyMillisCurrently, these two actions are decoupled and there could be cases when supervisor could be publishing or when
minTriggerScaleActionFrequencyMillishas not yet been elapsed in which case the scaling action could be skipped. While skipping that action, we are clearing the collected lag metrics but not actually updating the task count. So the next decision for scaling would be based on looking at shorter windows than configured which could cause more scaling actions than required.This PR updates to clear the collected lag only when supervisor is truly scaled.
Key changed/added classes in this PR
SeekableStreamSupervisorLagBasedAutoScalerThis PR has: