-
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
[VTAdmin API] Fix schema cache flag, add documentation #15704
[VTAdmin API] Fix schema cache flag, add documentation #15704
Conversation
Signed-off-by: notfelineit <notfelineit@gmail.com>
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
|
…ample Signed-off-by: notfelineit <notfelineit@gmail.com>
Signed-off-by: notfelineit <notfelineit@gmail.com>
Signed-off-by: notfelineit <notfelineit@gmail.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #15704 +/- ##
==========================================
- Coverage 68.40% 68.39% -0.02%
==========================================
Files 1556 1556
Lines 195121 195275 +154
==========================================
+ Hits 133479 133564 +85
- Misses 61642 61711 +69 ☔ View full report in Codecov by Sentry. |
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.
LGTM.
I think that saying “this is the default value” can be removed from the descriptions. I also think that we could better describe what a specific value means — sometimes 0 means none, other times disabled, and other times unlimited.
We should also create a quick issue that describes the bug we’re fixing. Largely a cut and paste from the PR description. Then we can add a line that says Fixing: XXXX in the related issues section of the description.
thanks!
# How many outstanding backfil requests to permit in schema cache. | ||
# If the queue is full, calls backfill schemas will return false, and those requests will be discarded. | ||
# Defaults to 0 if a negative value is passed. | ||
schema-cache-backfill-queue-size: 0 |
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.
What does 0 mean? Unlimited?
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.
I hope this answers the question:
#15704 (comment)
@@ -54,6 +54,9 @@ const ( | |||
// backfill requests to still process, if a config is passed with a | |||
// non-positive BackfillRequestTTL. | |||
DefaultBackfillRequestTTL = time.Millisecond * 100 | |||
// DefaultBackfillQueueSize is the default value used for the size of the | |||
// backfill queue, if a config is passed with a non-positive BackfillQueueSize. | |||
DefaultBackfillQueueSize = 0 |
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.
0 means that we don’t backfill?
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.
I think it means that the underlying channel will have a size of 0, and every send to the backfill queue will block until the queue is "empty" again. If that's non-ideal, we can change it to 1. I had it at 1 but that broke an existing test assumption.
Signed-off-by: notfelineit <notfelineit@gmail.com>
Signed-off-by: notfelineit <notfelineit@gmail.com>
Signed-off-by: notfelineit <notfelineit@gmail.com>
Signed-off-by: notfelineit <notfelineit@gmail.com>
Description
Currently, when a user passes any schema cache flags, but does not pass
backfill-queue-size
, vtadmin-api crashes becausebackfill-queue-size
is defaulted to-1
and crashes with:at https://github.com/vitessio/vitess/blob/main/go/vt/vtadmin/cache/cache.go#L131
This PR makes it so that
backfill-queue-size
is defaulted to 0 if the value is negative. It also adds theschema-cache-*
flags to the examplecluster.yml
, and adds some logs.A subsequent PR will make it so that the debug endpoint returns the cache values as they are actually set. (currently shows -1 if the user didn't pass configuration, even if defaults are different).
Backport reason
This is a bug that breaks vtadmin-api usage.
Related Issue(s)
#15717
Checklist
Deployment Notes
None