Skip to content
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

Backport VReplication: Support reversing read-only traffic in vtctldclient (#16920) #144

Open
wants to merge 7 commits into
base: release-19.0-github
Choose a base branch
from

Conversation

mhamza15
Copy link

@mhamza15 mhamza15 commented Mar 3, 2025

Backports vitessio#16918

@mhamza15 mhamza15 self-assigned this Mar 3, 2025
@Copilot Copilot bot review requested due to automatic review settings March 3, 2025 18:39

Choose a reason for hiding this comment

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

PR Overview

This PR backports changes from a recent Vitess issue to add support for reversing read‐only traffic in the vtctldclient. Key changes include updates to workflow test logic for both read and write switching, enhanced logging and tracing in the vtctldclient and server components, and adjustments to routing rules and tablet type handling to support the reverse operation.

Reviewed Changes

File Description
go/test/endtoend/vreplication/resharding_workflows_v2_test.go Adjusted test functions and parameter names to improve clarity for reads.
go/test/endtoend/vreplication/vreplication_vtctldclient_cli_test.go Added additional nil checks and refinement of tablet type usage in tests.
go/vt/vtctl/workflow/server.go Integrated tracing and refined traffic switching logic with enhanced logging.
go/test/endtoend/vreplication/wrappers_test.go Updated vtctld workflow command execution with improved logging.
go/test/endtoend/vreplication/movetables_buffering_test.go Modified global tablet configuration for buffering tests with proper deferral.
go/vt/vtctl/workflow/traffic_switcher.go Enhanced logging in switchShardReads and switchTableReads for better diagnostics.
go/test/endtoend/vreplication/config_test.go Added new materialization spec definitions for extended test coverage.
go/test/endtoend/vreplication/helper_test.go Improved error reporting by including routing rules in tablet query assertions.

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (3)

go/test/endtoend/vreplication/resharding_workflows_v2_test.go:330

  • Renaming the parameter from 'tabletTypes' to 'tabletType' improves clarity by indicating that a single tablet type is expected. Please verify that all call sites pass the intended value.
func validateReadsRoute(t *testing.T, tabletType string, tablet *cluster.VttabletProcess) {

go/test/endtoend/vreplication/movetables_buffering_test.go:21

  • Modifying global variables 'defaultRdonly' and 'defaultReplicas' in this test may affect test isolation. Ensure that the deferred restoration consistently resets these values to avoid interference across tests.
defaultRdonly = 0
	defaultReplicas = 0

go/vt/vtctl/workflow/traffic_switcher.go:550

  • [nitpick] The enhanced logging here provides detailed workflow, direction, and tablet type information for debugging. Please verify that including these details in logs is acceptable in production environments and does not expose sensitive data.
ts.Logger().Infof("switchShardReads: workflow: %s, direction: %s, cells: %v, tablet types: %v", ts.workflow, direction.String(), cells, servedTypes)

Tip: Copilot code review supports C#, Go, Java, JavaScript, Markdown, Python, Ruby and TypeScript, with more languages coming soon. Learn more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants