fix(ensurance): clear node taint after cool-down when usage recovers - #934
Draft
ljluestc wants to merge 2 commits into
Draft
fix(ensurance): clear node taint after cool-down when usage recovers#934ljluestc wants to merge 2 commits into
ljluestc wants to merge 2 commits into
Conversation
The avoidance action's node taint was never removed once the metric dropped back below the watermark: 1. computeActionContext fired Restored exactly once (it reset the trigger counter immediately), so the cool-down was evaluated only at that single instant - which is almost always inside the cool-down window (restoreThreshold x probe interval < coolDownSeconds). 2. While waiting out the cool-down, mergeSchedulingActions kept calling ToggleScheduleSetting(true), which refreshed lastTriggeredTime on every round, so the cool-down could never elapse anyway. With this change the restore stays pending while usage remains below the watermark (counters are only cleared once the restore is executed or the rule triggers again), the cool-down is re-evaluated on every analysis round, and lastTriggeredTime is only refreshed by real triggers. After coolDownSeconds elapses, ScheduleExecutor restores the node and removes the EnsuranceAnalyzedPressure taint. Adds unit tests covering the reporter's scenario, cool-down semantics, and re-triggering after a completed restore. Fixes gocrane#894
Documents root cause (one-shot restore + cool-down never elapsing), the pending-restore fix, the recordRestoreDecision audit log, the rejected break-variant, and the unit/e2e verification evidence.
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.
The avoidance action's node taint was never removed once the metric dropped back below the watermark:
With this change the restore stays pending while usage remains below the watermark (counters are only cleared once the restore is executed or the rule triggers again), the cool-down is re-evaluated on every analysis round, and lastTriggeredTime is only refreshed by real triggers. After coolDownSeconds elapses, ScheduleExecutor restores the node and removes the EnsuranceAnalyzedPressure taint.
Adds unit tests covering the reporter's scenario, cool-down semantics, and re-triggering after a completed restore.
Fixes #894
What type of PR is this?
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer: