Merged
Conversation
1. Only support cgroup v2 as v1 is essentially dead in 2025+ 2. Handle initialization only when the cgroup metrics are used a. Today that's only when someone uses --grpc-enable-orca-metrics 3. Properly handle cases where we failed to initialize properly Signed-off-by: Matt Lord <mattalord@gmail.com>
Contributor
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Signed-off-by: Matt Lord <mattalord@gmail.com>
Signed-off-by: Matt Lord <mattalord@gmail.com>
Signed-off-by: Matt Lord <mattalord@gmail.com>
Signed-off-by: Matt Lord <mattalord@gmail.com>
Signed-off-by: Matt Lord <mattalord@gmail.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #18791 +/- ##
==========================================
+ Coverage 69.68% 69.70% +0.01%
==========================================
Files 1605 1605
Lines 214485 214459 -26
==========================================
+ Hits 149463 149485 +22
+ Misses 65022 64974 -48 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Matt Lord <mattalord@gmail.com>
dbussink
reviewed
Oct 24, 2025
twthorn
approved these changes
Oct 24, 2025
Contributor
twthorn
left a comment
There was a problem hiding this comment.
LGTM, swapping eager init for lazy setup (only if necessary) is the right choice.
Cgroups2 were supported by linux as early as 2019 so agree with simplifying the code and supporting what most likely all users are on (especially if they are running a new enough vitess version for this new flag)
Thanks for catching this, @mattlord
Signed-off-by: Matt Lord <mattalord@gmail.com>
dbussink
approved these changes
Oct 24, 2025
vitess-bot
pushed a commit
that referenced
this pull request
Oct 24, 2025
Signed-off-by: Matt Lord <mattalord@gmail.com>
systay
pushed a commit
that referenced
this pull request
Oct 27, 2025
5 tasks
twthorn
pushed a commit
to slackhq/vitess
that referenced
this pull request
Nov 18, 2025
Signed-off-by: twthorn <thomaswilliamthornton@gmail.com>
5 tasks
twthorn
pushed a commit
to slackhq/vitess
that referenced
this pull request
Jan 28, 2026
Signed-off-by: Matt Lord <mattalord@gmail.com>
twthorn
added a commit
to slackhq/vitess
that referenced
this pull request
Jan 28, 2026
Signed-off-by: Matt Lord <mattalord@gmail.com> Signed-off-by: Thomas Thornton <thomaswilliamthornton@gmail.com>
5 tasks
twthorn
pushed a commit
to slackhq/vitess
that referenced
this pull request
Jan 29, 2026
Signed-off-by: Matt Lord <mattalord@gmail.com> Signed-off-by: Thomas Thornton <thomaswilliamthornton@gmail.com>
twthorn
added a commit
to slackhq/vitess
that referenced
this pull request
Jan 29, 2026
Signed-off-by: Thomas Thornton <thomaswilliamthornton@gmail.com>
twthorn
added a commit
to slackhq/vitess
that referenced
this pull request
Jan 29, 2026
Apply missing changes from PR vitessio#18791 to metrics_cgroup.go: - Replace cgroup1Manager and cgroup2Manager with single cgroupManager - Add errCgroupMetricsNotAvailable error variable - Add sync.Once for lazy initialization - Remove cgroup v1 support, only support cgroup v2 - Simplify implementation with unified cgroup manager This fixes compilation errors in metrics_cgroup_test.go.
tanjinx
pushed a commit
to slackhq/vitess
that referenced
this pull request
Jan 30, 2026
* Improve cgroup metric management (vitessio#18791) Signed-off-by: Matt Lord <mattalord@gmail.com> Signed-off-by: Thomas Thornton <thomaswilliamthornton@gmail.com> * VStream: Prevent buffering entire transactions (OOM risk), instead send chunks to client (vitessio#18849) Signed-off-by: twthorn <thomaswilliamthornton@gmail.com> Signed-off-by: Thomas Thornton <thomaswilliamthornton@gmail.com> * Run VStream copy only when VGTID requires it, use TablesToCopy in those cases (vitessio#18938) Signed-off-by: twthorn <thomaswilliamthornton@gmail.com> Signed-off-by: Thomas Thornton <thomaswilliamthornton@gmail.com> Signed-off-by: Thomas Thornton <thomaswilliamthornton@gmail.com> * Regenerate vtgate.pb.go proto file Signed-off-by: Thomas Thornton <thomaswilliamthornton@gmail.com> * Fix tests Signed-off-by: Thomas Thornton <thomaswilliamthornton@gmail.com> * Complete PR vitessio#18791 backport: Update metrics_cgroup.go Apply missing changes from PR vitessio#18791 to metrics_cgroup.go: - Replace cgroup1Manager and cgroup2Manager with single cgroupManager - Add errCgroupMetricsNotAvailable error variable - Add sync.Once for lazy initialization - Remove cgroup v1 support, only support cgroup v2 - Simplify implementation with unified cgroup manager This fixes compilation errors in metrics_cgroup_test.go. * Add missing github.com/containerd/cgroups dependency Required by metrics_cgroup.go for cgroup v1/v2 support. Signed-off-by: Thomas Thornton <thomaswilliamthornton@gmail.com> * Fix cgroups import to use v3 The v1 cgroups package is incompatible with Go 1.24.10. Use cgroups/v3 consistently throughout the file. Signed-off-by: Thomas Thornton <thomaswilliamthornton@gmail.com> * Fix goimports formatting Signed-off-by: Thomas Thornton <thomaswilliamthornton@gmail.com> --------- Signed-off-by: Thomas Thornton <thomaswilliamthornton@gmail.com>
sbaker617
pushed a commit
to slackhq/vitess
that referenced
this pull request
Feb 5, 2026
* Improve cgroup metric management (vitessio#18791) Signed-off-by: Matt Lord <mattalord@gmail.com> Signed-off-by: Thomas Thornton <thomaswilliamthornton@gmail.com> * VStream: Prevent buffering entire transactions (OOM risk), instead send chunks to client (vitessio#18849) Signed-off-by: twthorn <thomaswilliamthornton@gmail.com> Signed-off-by: Thomas Thornton <thomaswilliamthornton@gmail.com> * Run VStream copy only when VGTID requires it, use TablesToCopy in those cases (vitessio#18938) Signed-off-by: twthorn <thomaswilliamthornton@gmail.com> Signed-off-by: Thomas Thornton <thomaswilliamthornton@gmail.com> Signed-off-by: Thomas Thornton <thomaswilliamthornton@gmail.com> * Regenerate vtgate.pb.go proto file Signed-off-by: Thomas Thornton <thomaswilliamthornton@gmail.com> * Fix tests Signed-off-by: Thomas Thornton <thomaswilliamthornton@gmail.com> * Complete PR vitessio#18791 backport: Update metrics_cgroup.go Apply missing changes from PR vitessio#18791 to metrics_cgroup.go: - Replace cgroup1Manager and cgroup2Manager with single cgroupManager - Add errCgroupMetricsNotAvailable error variable - Add sync.Once for lazy initialization - Remove cgroup v1 support, only support cgroup v2 - Simplify implementation with unified cgroup manager This fixes compilation errors in metrics_cgroup_test.go. * Add missing github.com/containerd/cgroups dependency Required by metrics_cgroup.go for cgroup v1/v2 support. Signed-off-by: Thomas Thornton <thomaswilliamthornton@gmail.com> * Fix cgroups import to use v3 The v1 cgroups package is incompatible with Go 1.24.10. Use cgroups/v3 consistently throughout the file. Signed-off-by: Thomas Thornton <thomaswilliamthornton@gmail.com> * Fix goimports formatting Signed-off-by: Thomas Thornton <thomaswilliamthornton@gmail.com> --------- Signed-off-by: Thomas Thornton <thomaswilliamthornton@gmail.com>
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
This is a follow-up to #18282
We make the following changes here:
--grpc-enable-orca-metricsflagWe should backport this to v23 before GA as it can lead to crashes as shown in the issue.
Related Issue(s)
Checklist
Deployment Notes
AI Disclosure