Decouple ruler dependency controller from concurrency controller#13527
Merged
gotjosh merged 1 commit intoprometheus:mainfrom Feb 2, 2024
Merged
Conversation
Signed-off-by: Marco Pracucci <[email protected]>
gotjosh
approved these changes
Feb 2, 2024
Member
gotjosh
left a comment
There was a problem hiding this comment.
LGTM - I don't have a single comment great work and thank you very much for your contribution.
Member
|
I am going to merge as I don't think this is controversial - it's mostly a code refactor and doesn't really change the original functionality. |
gotjosh
added a commit
that referenced
this pull request
Jul 19, 2024
Even though the main purpose of this refactor is to modify the interface of the concurrency controller to accept a Context. I did two drive-by modifications that I think are sensible: 1. I have moved the check for dependencies on rules to the controller itself - this aligns with how the controller should behave as it is a deciding factor on wether we should run concurrently or not. 2. I cleaned up some unused methods from the days of the old interface before #13527 changed it. Signed-off-by: gotjosh <[email protected]>
gotjosh
added a commit
that referenced
this pull request
Jul 22, 2024
* Rules: Refactor concurrency controller interface Even though the main purpose of this refactor is to modify the interface of the concurrency controller to accept a Context. I did two drive-by modifications that I think are sensible: 1. I have moved the check for dependencies on rules to the controller itself - this aligns with how the controller should behave as it is a deciding factor on wether we should run concurrently or not. 2. I cleaned up some unused methods from the days of the old interface before #13527 changed it. Signed-off-by: gotjosh <[email protected]> --------- Signed-off-by: gotjosh <[email protected]>
kushalShukla-web
pushed a commit
to kushalShukla-web/prometheus
that referenced
this pull request
Jul 23, 2024
* Rules: Refactor concurrency controller interface Even though the main purpose of this refactor is to modify the interface of the concurrency controller to accept a Context. I did two drive-by modifications that I think are sensible: 1. I have moved the check for dependencies on rules to the controller itself - this aligns with how the controller should behave as it is a deciding factor on wether we should run concurrently or not. 2. I cleaned up some unused methods from the days of the old interface before prometheus#13527 changed it. Signed-off-by: gotjosh <[email protected]> --------- Signed-off-by: gotjosh <[email protected]> Signed-off-by: kushagra Shukla <[email protected]>
kushalShukla-web
pushed a commit
to kushalShukla-web/prometheus
that referenced
this pull request
Jul 25, 2024
* Rules: Refactor concurrency controller interface Even though the main purpose of this refactor is to modify the interface of the concurrency controller to accept a Context. I did two drive-by modifications that I think are sensible: 1. I have moved the check for dependencies on rules to the controller itself - this aligns with how the controller should behave as it is a deciding factor on wether we should run concurrently or not. 2. I cleaned up some unused methods from the days of the old interface before prometheus#13527 changed it. Signed-off-by: gotjosh <[email protected]> --------- Signed-off-by: gotjosh <[email protected]>
kushalShukla-web
pushed a commit
to kushalShukla-web/prometheus
that referenced
this pull request
Jul 25, 2024
* Rules: Refactor concurrency controller interface Even though the main purpose of this refactor is to modify the interface of the concurrency controller to accept a Context. I did two drive-by modifications that I think are sensible: 1. I have moved the check for dependencies on rules to the controller itself - this aligns with how the controller should behave as it is a deciding factor on wether we should run concurrently or not. 2. I cleaned up some unused methods from the days of the old interface before prometheus#13527 changed it. Signed-off-by: gotjosh <[email protected]> --------- Signed-off-by: gotjosh <[email protected]> Signed-off-by: Kushal Shukla <[email protected]>
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.
This PR is a follow up of #12946. In #12946 we had
RuleConcurrencyControllerRuleEligible()andInvalidate()whose design have potential side effects (see discussion).In this PR I'm proposing two changes:
Rulehas dependants and/or dependencies through theRuleDetail(this also covers an use case we have in Mimir, where we need to distinguish between the two)In addition, after this PR projects vendoring the ruler (like Loki, Mimir, Cortex, ...) can:
RuleDetailNotes about naming
Why did I call the fields / functions "no dependent/cy rules" (negative) instead of a positive "dependent/cy rules"? Reason is that I wanted the zero value to be the safest option (so zero value means "it's not guaranteed that there are no dependents/cies").