vmalert: vmrule changes could trigger unrelated group restarts during reload in large environments
Maintainers usually reply within 1 day
Assessment
This issue has not been assessed yet.
Description
Describe the bug
In https://github.com/VictoriaMetrics/operator/commit/4ce88cc4036b20141b4d1370aa62efbfb7c208ce, VMRule groups started being packed into gzip-compressed ConfigMap buckets. But bucket membership is recomputed from scratch on every reconcile, adding or deleting one VMRule can move other untouched groups into a different bucket file.
And since vmalert takes the file path into account when computing the group ID, the moved group is treated as a brand-new group: the old one is stopped and a new one is started, which breaks the existing periodic evaluation and causes the group’s rules to lose their state(also includes their metrics).
The default VM_CONFIG_DATA_BUDGET_BYTES is 524288, so groups of most setups should stay within a single ConfigMap and are unaffected. But for large environments with thousands of rules, multiple configmaps(buckets) can be created, every add or delete can reshuffle unrelated groups and restart them.
Previously, this case should be more rarer, as rule files were packed by sorted filename with sequential fill. Files sorted before the changed file could never move, only a few files after it could switch files if there was new free room for them.
To Reproduce
Set VM_CONFIG_DATA_BUDGET_BYTES to a small value and create, for example, 12 VMRule resources so they are split into 4 ConfigMaps (buckets). Each ConfigMap will contain 3 VMRule resources, and deleting any of them will change the distribution from [3 3 3 3] to [4 4 3], even deleting the last one, which would not have affected the distribution before.
Expected behavior
Rule groups are more resistant to random vmrule change.
Version
Since v0.72.0.
Additional context
Add any other context about the problem here.
- Dominant language
- Go
- Stars
- 603
- Forks
- 242
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 57
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from VictoriaMetrics/operator
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
VictoriaMetrics/operator#2854 ·
Maintainers usually reply within 1 day
-
VLAgent `spec.k8sCollector.includePodLabels: false` has no effectPossibly taken @Haleygo claimed this 25 days ago. Openbug waiting for release
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
VictoriaMetrics/operator#2772 · 1 assignee ·
Maintainers usually reply within 1 day
-
Bug: VMRule `spec.groups[].tenant` should accept an integer, not only a stringPossibly taken @megative claimed this 40 days ago. Openenhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
VictoriaMetrics/operator#2608 · 5 comments ·
Maintainers usually reply within 1 day
-
VMAlert datasource bearer token isn't documentedMay be free again @Haleygo claimed this 35 days ago, and no pull request is open. Opendocs
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
VictoriaMetrics/operator#2365 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
VictoriaMetrics/operator#2845 ·
Maintainers usually reply within 1 day
All issues in VictoriaMetrics/operator
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
uselagoon/lagoon-cli#501 · 1 reaction ·
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
slavakurilyak/awesome-ai-agents#1026 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Tarektouati/made#197 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100