-
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
vtgate buffering logic: remove the deprecated healthcheck based implementation #13584
Merged
rohit-nayak-ps
merged 6 commits into
vitessio:main
from
planetscale:rohit/deprecate-health-check-in-keyspace-event-watcher
Jul 26, 2023
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f9489c5
Remove the healthcheck based implementation in the buffering logic in…
rohit-nayak-ps b4593db
Fix flag expectation. Hack to try to reduce flakiness of TestWatchConfig
rohit-nayak-ps 34a238f
Mark flag deprecated the right way
rohit-nayak-ps f731d66
UPdate release notes
rohit-nayak-ps 05ec346
Keep original flag definition for backward compat.
rohit-nayak-ps beb304d
Remove unused ProcessPrimaryHealth
rohit-nayak-ps 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,7 +84,8 @@ func TestTabletGatewayBeginExecute(t *testing.T) { | |
|
||
func TestTabletGatewayShuffleTablets(t *testing.T) { | ||
hc := discovery.NewFakeHealthCheck(nil) | ||
tg := NewTabletGateway(context.Background(), hc, nil, "local") | ||
ts := &fakeTopoServer{} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Earlier implementation used to pass nil as the topo server and through some side effect it worked. However after removing the health check code this no longer worked. Hence here, and in other places below, we are passing an instance of the test (fake) topo server. |
||
tg := NewTabletGateway(context.Background(), hc, ts, "local") | ||
|
||
ts1 := &discovery.TabletHealth{ | ||
Tablet: topo.NewTablet(1, "cell1", "host1"), | ||
|
@@ -154,7 +155,8 @@ func TestTabletGatewayReplicaTransactionError(t *testing.T) { | |
TabletType: tabletType, | ||
} | ||
hc := discovery.NewFakeHealthCheck(nil) | ||
tg := NewTabletGateway(context.Background(), hc, nil, "cell") | ||
ts := &fakeTopoServer{} | ||
tg := NewTabletGateway(context.Background(), hc, ts, "cell") | ||
|
||
_ = hc.AddTestTablet("cell", host, port, keyspace, shard, tabletType, true, 10, nil) | ||
_, err := tg.Execute(context.Background(), target, "query", nil, 1, 0, nil) | ||
|
@@ -174,7 +176,8 @@ func testTabletGatewayGeneric(t *testing.T, f func(tg *TabletGateway, target *qu | |
TabletType: tabletType, | ||
} | ||
hc := discovery.NewFakeHealthCheck(nil) | ||
tg := NewTabletGateway(context.Background(), hc, nil, "cell") | ||
ts := &fakeTopoServer{} | ||
tg := NewTabletGateway(context.Background(), hc, ts, "cell") | ||
|
||
// no tablet | ||
want := []string{"target: ks.0.replica", `no healthy tablet available for 'keyspace:"ks" shard:"0" tablet_type:REPLICA`} | ||
|
@@ -241,7 +244,8 @@ func testTabletGatewayTransact(t *testing.T, f func(tg *TabletGateway, target *q | |
TabletType: tabletType, | ||
} | ||
hc := discovery.NewFakeHealthCheck(nil) | ||
tg := NewTabletGateway(context.Background(), hc, nil, "cell") | ||
ts := &fakeTopoServer{} | ||
tg := NewTabletGateway(context.Background(), hc, ts, "cell") | ||
|
||
// retry error - no retry | ||
sc1 := hc.AddTestTablet("cell", host, port, keyspace, shard, tabletType, true, 10, nil) | ||
|
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.
The way to deprecate a flag is to add a line like
Then you can delete the var completely, and the flag disappears from the help text. See #13246 for example
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.
Well, I pointed you to the wrong example. It has to be something like this
So, you can't delete the original line, you just add the new one.
Incidentally, it was done incorrectly for throttler flags in #13246 and needs to be fixed.
This is why tests are failing. vtgate doesn't start because it is being provided the
--buffer_implementation
flag and the flag has been completely removed.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.
Thanks, hope I finally got it right ;-)
I haven't removed the flag from the buffering tests since they helped point out the incorrect implementation. We will remove it in v19 when we will remove the flag entirely.
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.
That makes perfect sense. That is in fact the only way to make sure we don't break flags on deprecation.