Skip to content

Conversation

@arthurschreiber
Copy link

@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 <[email protected]>
Signed-off-by: Arthur Schreiber <[email protected]>
Copilot AI review requested due to automatic review settings April 11, 2025 11:11
Copy link

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 <[email protected]>

* remove check result summary

* rerun actions

Signed-off-by: Mohamed Hamza <[email protected]>

* fix runs on in workflows

* update actions

---------

Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Mohamed Hamza <[email protected]>
Co-authored-by: Matt Lord <[email protected]>
@github-actions
Copy link

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

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
Signed-off-by: Mohamed Hamza <[email protected]>
Signed-off-by: Mohamed Hamza <[email protected]>
Signed-off-by: Mohamed Hamza <[email protected]>
Fix formatting for table entries in select_cases.json
…ableACLConfig is true (vitessio#17274) (#173)

Signed-off-by: garfthoffman <[email protected]>
Signed-off-by: Mohamed Hamza <[email protected]>
Co-authored-by: garfthoffman <[email protected]>
VReplication: Estimate lag when workflow fully throttled (vitessio#16577)
mhamza15 and others added 2 commits August 22, 2025 12:01
@github-actions
Copy link

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

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