-
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
Tablet throttle: support "/throttle/check-self" available on all tablets #7319
Merged
shlomi-noach
merged 12 commits into
vitessio:master
from
planetscale:throttler-replica-throttle-lag
Jan 26, 2021
Merged
Changes from 9 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
88cf2da
tablet throttler is Open on non-primary
shlomi-noach cc6bffe
Adding /throttle/check-read: a specific check available on all vttabl…
shlomi-noach 18d62c9
removed debug messages
shlomi-noach 45a00ce
fix replication lag query: apparently 'lag' is now introduced asa new…
shlomi-noach 76f84bb
Merge remote-tracking branch 'upstream/master' into throttler-replica…
shlomi-noach b7ce76f
run self checks in throttler
shlomi-noach a7dc1d0
Merge remote-tracking branch 'upstream/master' into throttler-replica…
shlomi-noach 57de1c1
support 'TickNow()'
shlomi-noach 046e36b
speed up of throttler refresh tick upon opening and upon becoming leader
shlomi-noach e2f078d
typos
shlomi-noach 8e40d6b
formalize wait time in test
shlomi-noach e20e0f7
change of name
shlomi-noach File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
Are these durations used in the tests (2 seconds, 10 seconds, 5 seconds) based on values configured elsewhere? Just wondering if these can become flaky if a configuration is changed elsewhere.
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.
Excellent question. There are some hard coded intervals here:
vitess/go/vt/vttablet/tabletserver/throttle/throttler.go
Lines 37 to 41 in 627f092
Basically:
/throttler/check
can provide a reliable answer. Hence waiting for10sec
(can reduce that to e.g.7s
but I feel10sec
is much safer against flakyness.250ms
(e.g. see in the vreplication PRs), so a1sec
sleep can ensure the cache is cleared1s
, hence the2 * time.Second
sleep afterStopReplication()
, to make sure when we next check for lag, there is a throttle-grade lag. Having said that, you are right that this is overridable -- so I just addedto this test's
VtTabletExtraArgs
to ensure the threshold is1s
.5 * time.Second
afterStartReplication
is just heuristic to allow the replication to catch up, and does not depend on the throttler configuration. Again, catch up is likely to happen in less than1s
but I feel5s
is great against flakyness.10 * time.Second
afterChangeTabletType
is because it will take that amount of time for the throttler to identify the new roster. It's hard coded inmysqlRefreshInterval = 10 * time.Second
, and now I've actually uppsed the test to sleep for12 * time.Second
to avoid flakyness.I've moreover now made these numbers as constants in the test. Now the waits are named, and its clearer what each wait means.
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.
new code:
...