-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add stats for shards watched by VTOrc, purge stale shards #17815
base: main
Are you sure you want to change the base?
Add stats for shards watched by VTOrc, purge stale shards #17815
Conversation
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
|
// RefreshAllKeyspacesAndShards reloads the keyspace and shard information for the keyspaces that vtorc is concerned with. | ||
func RefreshAllKeyspacesAndShards(ctx context.Context) error { | ||
refreshAllKeyspacesAndShardsMu.Lock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refreshAllShards
does a save + read + delete, per keyspace. Lets make sure that doesn't happen concurrently
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17815 +/- ##
==========================================
- Coverage 67.94% 67.43% -0.52%
==========================================
Files 1586 1592 +6
Lines 255224 258136 +2912
==========================================
+ Hits 173420 174068 +648
- Misses 81804 84068 +2264 ☔ View full report in Codecov by Sentry. |
6942354
to
c65971e
Compare
Signed-off-by: Tim Vaillancourt <[email protected]>
08f4c4b
to
eae50cb
Compare
Signed-off-by: Tim Vaillancourt <[email protected]>
Signed-off-by: Tim Vaillancourt <[email protected]>
This is working nicely on our fork: vitess@REDACTED:/vt$ curl -s localhost:15000/metrics | grep vtorc_shards_watched | head -10
# HELP vtorc_shards_watched Keyspace/shards currently watched
# TYPE vtorc_shards_watched gauge
vtorc_shards_watched{keyspace="REDACTED",shard="-0040"} 1
vtorc_shards_watched{keyspace="REDACTED",shard="0040-0080"} 1
vtorc_shards_watched{keyspace="REDACTED",shard="0080-00c0"} 1
vtorc_shards_watched{keyspace="REDACTED",shard="00c0-0100"} 1
vtorc_shards_watched{keyspace="REDACTED",shard="0100-0140"} 1
vtorc_shards_watched{keyspace="REDACTED",shard="0140-0180"} 1
vtorc_shards_watched{keyspace="REDACTED",shard="0180-01c0"} 1
vtorc_shards_watched{keyspace="REDACTED",shard="01c0-0200"} 1 |
Signed-off-by: Tim Vaillancourt <[email protected]>
Description
This PR adds stats for what keyspace/shards are being watched by VTOrc, populated using the backend database
While adding this support I noticed records are never deleted from the backend
vitess_shard
table, so I added support for stale records to be deleted in a similar way to tablets: by recording what was successfully "saved" in the latest polling and removing anything that was not in that listRelated Issue(s)
Closes #17816
Checklist
Deployment Notes