[Do Not Merge] v20.x#152
Conversation
…gate startup (vitessio#16655) Signed-off-by: Manan Gupta <manan@planetscale.com> Signed-off-by: Arthur Schreiber <arthurschreiber@github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR updates the Vitess tablet gateway and keyspace event watcher to gate startup based on keyspace consistency and buffering conditions during reparent operations. Key changes include:
- Replacing the legacy PrimaryIsNotServing API with the more descriptive ShouldStartBufferingForTarget in both production and test code.
- Introducing WaitForConsistentKeyspaces to ensure keyspaces are processed before allowing primary tablet queries.
- Updating srvtopo discovery functions to return both targets and keyspaces.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| go/vt/vtgate/tabletgateway_test.go | Added a new test (TestWithRetry) that validates the new retry and buffering behavior. |
| go/vt/vtgate/tabletgateway_flaky_test.go | Updated tests to use ShouldStartBufferingForTarget instead of PrimaryIsNotServing. |
| go/vt/vtgate/tabletgateway.go | Replaced API calls to use the new keyspace event buffering logic and await keyspace consistency. |
| go/vt/srvtopo/discover_test.go | Renamed tests to use FindAllTargetsAndKeyspaces and assert on the returned keyspaces list. |
| go/vt/srvtopo/discover.go | Updated function signature and documentation to return both targets and keyspaces. |
| go/vt/discovery/keyspace_events_test.go | Adjusted tests to validate the new ShouldStartBufferingForTarget API and its expectations. |
| go/vt/discovery/keyspace_events.go | Renamed PrimaryIsNotServing to ShouldStartBufferingForTarget and added WaitForConsistentKeyspaces. |
Comments suppressed due to low confidence (1)
go/vt/discovery/keyspace_events.go:749
- [nitpick] The compound boolean expression is complex; consider refactoring it into multiple well-named boolean variables or adding inline comments to improve readability and maintainability.
return state.currentPrimary, !state.serving && !ks.consistent && state.externallyReparented != 0 && state.currentPrimary != nil
| func (kew *KeyspaceEventWatcher) WaitForConsistentKeyspaces(ctx context.Context, ksList []string) error { | ||
| // We don't want to change the original keyspace list that we receive so we clone it | ||
| // before we empty it elements down below. | ||
| keyspaces := slices.Clone(ksList) |
There was a problem hiding this comment.
WaitForConsistentKeyspaces uses a fixed sleep interval in a loop which may lead to long waits if keyspaces never become consistent; consider introducing a configurable timeout or maximum iteration limit to avoid potential resource waste.
| func (kew *KeyspaceEventWatcher) WaitForConsistentKeyspaces(ctx context.Context, ksList []string) error { | |
| // We don't want to change the original keyspace list that we receive so we clone it | |
| // before we empty it elements down below. | |
| keyspaces := slices.Clone(ksList) | |
| func (kew *KeyspaceEventWatcher) WaitForConsistentKeyspaces(ctx context.Context, ksList []string, timeout time.Duration) error { | |
| // We don't want to change the original keyspace list that we receive so we clone it | |
| // before we empty it elements down below. | |
| keyspaces := slices.Clone(ksList) | |
| timeoutChan := time.After(timeout) |
) (#149) * VReplication: Estimate lag when workflow fully throttled (vitessio#16577) Signed-off-by: Matt Lord <mattalord@gmail.com> * remove check result summary * rerun actions Signed-off-by: Mohamed Hamza <mhamza15@github.com> * fix runs on in workflows * update actions --------- Signed-off-by: Matt Lord <mattalord@gmail.com> Signed-off-by: Mohamed Hamza <mhamza15@github.com> Co-authored-by: Matt Lord <mattalord@gmail.com>
|
This PR is being marked as stale because it has been open for 30 days with no activity. To rectify, you may do any of the following:
If no action is taken within 7 days, this PR will be closed. |
|
This PR was closed because it has been stale for 7 days with no activity. |
…0-github Signed-off-by: Mohamed Hamza <mhamza15@github.com>
Signed-off-by: David Piegza <davidpiegza@github.com>
Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
Signed-off-by: Mohamed Hamza <mhamza15@github.com>
Signed-off-by: Mohamed Hamza <mhamza15@github.com>
Signed-off-by: Mohamed Hamza <mhamza15@github.com>
Fix formatting for table entries in select_cases.json
…ableACLConfig is true (vitessio#17274) (#173) Signed-off-by: garfthoffman <109185460+garfthoffman@users.noreply.github.com> Signed-off-by: Mohamed Hamza <mhamza15@github.com> Co-authored-by: garfthoffman <109185460+garfthoffman@users.noreply.github.com>
…essio#16577) (#149)" This reverts commit 9815ca8.
Signed-off-by: Mohamed Hamza <mhamza15@github.com>
Signed-off-by: Mohamed Hamza <mhamza15@github.com>
Signed-off-by: Mohamed Hamza <mhamza15@github.com>
Signed-off-by: Mohamed Hamza <mhamza15@github.com>
sqlparser: Remove unneeded escaping (vitessio#16255)
VReplication: Estimate lag when workflow fully throttled (vitessio#16577)
…ig (vitessio#17984) (#189) Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr> Co-authored-by: Florent Poinsard <35779988+frouioui@users.noreply.github.com>
|
This PR is being marked as stale because it has been open for 30 days with no activity. To rectify, you may do any of the following:
If no action is taken within 7 days, this PR will be closed. |
|
This PR was closed because it has been stale for 7 days with no activity. |
Description
This pull request is used to track which backports we've done against the upstream v20 release.
Related Issue(s)
Checklist
Deployment Notes