-
Notifications
You must be signed in to change notification settings - Fork 2.3k
VReplication: Add --shards flag to MoveTables/Reshard start and stop commands #19023
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
base: main
Are you sure you want to change the base?
VReplication: Add --shards flag to MoveTables/Reshard start and stop commands #19023
Conversation
Signed-off-by: Varun Deep Saini <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
|
📝 Documentation updates detected! New suggestion: Add --shards flag to MoveTables and Reshard start/stop commands |
|
📝 Documentation updates detected! New suggestion: Add changelog entry for VReplication --shards flag |
Signed-off-by: Varun Deep Saini <[email protected]>
mattlord
left a comment
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, @varundeepsaini !
There's more work to be done on the client side -- as we're not passing the shards in the request:
vitess/go/cmd/vtctldclient/command/vreplication/common/update.go
Lines 139 to 148 in 802b55e
| // The only thing we're updating is the state. | |
| req := &vtctldatapb.WorkflowUpdateRequest{ | |
| Keyspace: workflowOptions.Keyspace, | |
| TabletRequest: &tabletmanagerdatapb.UpdateVReplicationWorkflowRequest{ | |
| Workflow: workflowUpdateOptions.Workflow, | |
| Cells: textutil.SimulatedNullStringSlice, | |
| TabletTypes: textutil.SimulatedNullTabletTypeSlice, | |
| State: &state, | |
| }, | |
| } |
It's a different call path for workflow stop/start:
vitess/go/cmd/vtctldclient/command/vreplication/workflow/state.go
Lines 78 to 88 in 802b55e
| // The only thing we're updating is the state. | |
| req := &vtctldatapb.WorkflowUpdateRequest{ | |
| Keyspace: baseOptions.Keyspace, | |
| TabletRequest: &tabletmanagerdatapb.UpdateVReplicationWorkflowRequest{ | |
| Workflow: baseOptions.Workflow, | |
| Cells: textutil.SimulatedNullStringSlice, | |
| TabletTypes: textutil.SimulatedNullTabletTypeSlice, | |
| State: &state, | |
| Shards: shards, | |
| }, | |
| } |
We should also add some test coverage for this.
Description
Adds support for the
--shardsflag to thestartandstopcommands for MoveTables and Reshard VReplication workflows. This allows users to start or stop workflows on a specific subset of shards rather than all shards at once.Related Issue(s)
Fixes: #18949
Checklist
Deployment Notes
No deployment notes. This is a CLI enhancement with no database migrations or breaking changes.
AI Disclosure
This PR was authored with assistance from Claude.