ref(subscriptions): Executor created within strategy #2762
Merged
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.
context
This is kind of a reverse and then some of: #2364 but for different reasons. Some background on this PR:
The task I'm currently working on is auto scaling our snuba consumers, starting with the executors. We have auto scaling on some of snuba services, such as the api1, but not everything. Additionally, certain consumers, like the executors2 have args passed in that depend on the no. of replicas (which will no longer will be constant if we have auto scaling implemented).
why replica dependent args not great?
When an autoscaler kicks in, it adds new pods. The new pods will be aware of new number of replicas, whereas the currently running "old" pods will not. This would lead to different parameters for different pods, and those parameters might not be appropriate any longer (which might also be the case if we scaled down)
Executors
The executors depend on
max-concurrent-queries
being passed in which is calculated from the replicas:We don't really want to restart every single pod each time the auto scaler kicks in just to update the
max_concurrent_queries
so we'd likemax_concurrent_queries
to be calculated within the executor itself. I have two options for how to do that, one with changes solely in snuba3 and one that would require arroyo changes4.Both options however, would require that the executor be created within the
ExecuteQuery
strategy.Footnotes
auto scaling example snuba api https://github.com/getsentry/ops/blob/5b33fe67830a8d9e36ea0a0b49a2371d4f9f93bd/k8s/services/snuba/_deployment.api.yaml#L17-L29 ↩
metrics executor config https://github.com/getsentry/ops/blob/5b33fe67830a8d9e36ea0a0b49a2371d4f9f93bd/k8s/services/snuba/_deployment.metrics-subscriptions-executor.yaml#L59-L60 ↩
https://github.com/getsentry/snuba/pull/2745 ↩
https://github.com/getsentry/snuba/pull/2761 ↩