Skip to content

[Do Not Merge] v20.x#152

Closed
arthurschreiber wants to merge 26 commits intorelease-20.0from
release-20.0-github
Closed

[Do Not Merge] v20.x#152
arthurschreiber wants to merge 26 commits intorelease-20.0from
release-20.0-github

Conversation

@arthurschreiber
Copy link
Copy Markdown

@arthurschreiber arthurschreiber commented Apr 11, 2025

Description

This pull request is used to track which backports we've done against the upstream v20 release.

Related Issue(s)

Checklist

  • "Backport to:" labels have been added if this change should be back-ported
  • Tests were added or are not required
  • Documentation was added or is not required

Deployment Notes

…gate startup (vitessio#16655)

Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Arthur Schreiber <arthurschreiber@github.com>
Copilot AI review requested due to automatic review settings April 11, 2025 11:11
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines +802 to +805
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)
Copy link

Copilot AI Apr 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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)

Copilot uses AI. Check for mistakes.
) (#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>
@github-actions
Copy link
Copy Markdown

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:

  • Push additional commits to the associated branch.
  • Remove the stale label.
  • Add a comment indicating why it is not stale.

If no action is taken within 7 days, this PR will be closed.

@github-actions github-actions Bot added the Stale label May 15, 2025
@github-actions
Copy link
Copy Markdown

This PR was closed because it has been stale for 7 days with no activity.

@github-actions github-actions Bot closed this May 22, 2025
mhamza15 and others added 21 commits August 7, 2025 11:01
…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>
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>
)

Signed-off-by: Matt Lord <mattalord@gmail.com>
VReplication: Estimate lag when workflow fully throttled (vitessio#16577)
mhamza15 and others added 2 commits August 22, 2025 12:01
…ig (vitessio#17984) (#189)

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Co-authored-by: Florent Poinsard <35779988+frouioui@users.noreply.github.com>
)

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Co-authored-by: Harshit Gangal <harshit@planetscale.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 3, 2025

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:

  • Push additional commits to the associated branch.
  • Remove the stale label.
  • Add a comment indicating why it is not stale.

If no action is taken within 7 days, this PR will be closed.

@github-actions github-actions Bot added the Stale label Oct 3, 2025
@github-actions
Copy link
Copy Markdown

This PR was closed because it has been stale for 7 days with no activity.

@github-actions github-actions Bot closed this Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants