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

Remove Usage of VReplicationExec For _vt.vreplication Reads #14424

Merged
merged 46 commits into from
Mar 11, 2024

Conversation

mattlord
Copy link
Contributor

@mattlord mattlord commented Nov 2, 2023

Description

This replaces reads (i.e. SELECTs) against the _vt.vreplication sidecar table in the vtctldclient implementation (vtctl/vtctlclient are also deprecated) that were using the deprecated VReplicationExec RPC with the newer tabletmanager RPCs which do not expose the implementation (SQL against tables) and thus address upgrade/downgrade issues.

Note: the deprecated vtctlclient / wrangler implementation is left unchanged — so that it can be used as a fallback if there are any issues with the new vtctldclient implementation until it's eventually removed — by adding legacy functions in its code path as needed.

It also begins the process of unifying the creation of VReplication workflow streams in vtctldclient using the new tabletmanager RPCs. Materialize and Reshard were still using the deprecated VReplicationExec RPC and here we generalized the MoveTables usage of the new RPCs and moved Materialize over to that.

Related Issue(s)

Checklist

  • "Backport to:" labels have been added if this change should be back-ported
  • Tests were added or are not required
  • Did the new or modified tests pass consistently locally and on the CI
  • Documentation was added or is not required

Copy link
Contributor

vitess-bot bot commented Nov 2, 2023

Review Checklist

Hello reviewers! 👋 Please follow this checklist when reviewing this Pull Request.

General

  • Ensure that the Pull Request has a descriptive title.
  • Ensure there is a link to an issue (except for internal cleanup and flaky test fixes), new features should have an RFC that documents use cases and test cases.

Tests

  • Bug fixes should have at least one unit or end-to-end test, enhancement and new features should have a sufficient number of tests.

Documentation

  • Apply the release notes (needs details) label if users need to know about this change.
  • New features should be documented.
  • There should be some code comments as to why things are implemented the way they are.
  • There should be a comment at the top of each new or modified test to explain what the test does.

New flags

  • Is this flag really necessary?
  • Flag names must be clear and intuitive, use dashes (-), and have a clear help text.

If a workflow is added or modified:

  • Each item in Jobs should be named in order to mark it as required.
  • If the workflow needs to be marked as required, the maintainer team must be notified.

Backward compatibility

  • Protobuf changes should be wire-compatible.
  • Changes to _vt tables and RPCs need to be backward compatible.
  • RPC changes should be compatible with vitess-operator
  • If a flag is removed, then it should also be removed from vitess-operator and arewefastyet, if used there.
  • vtctl command output order should be stable and awk-able.

@vitess-bot vitess-bot bot added NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsIssue A linked issue is missing for this Pull Request NeedsWebsiteDocsUpdate What it says labels Nov 2, 2023
@github-actions github-actions bot added this to the v19.0.0 milestone Nov 2, 2023
@mattlord mattlord force-pushed the rm_vrepl_exec branch 2 times, most recently from 41dcece to 68c41ff Compare November 2, 2023 20:48
Signed-off-by: Matt Lord <[email protected]>
@mattlord mattlord added Type: Internal Cleanup Component: VReplication and removed NeedsIssue A linked issue is missing for this Pull Request labels Nov 3, 2023
Copy link
Contributor

github-actions bot commented Dec 4, 2023

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 Marks PRs as stale after a period of inactivity, which are then closed after a grace period. label Dec 4, 2023
@mattlord mattlord removed the Stale Marks PRs as stale after a period of inactivity, which are then closed after a grace period. label Dec 4, 2023
@mattlord mattlord changed the title Remove Usage of VReplicationExec Remove Usage of VReplicationExec For Reads Jan 3, 2024
@mattlord mattlord changed the title Remove Usage of VReplicationExec For Reads Remove Usage of VReplicationExec For _vt.vreplication Reads Jan 3, 2024
go/vt/vtctl/workflow/resharder.go Show resolved Hide resolved
go/vt/wrangler/switcher_interface.go Outdated Show resolved Hide resolved
mattlord added 3 commits March 5, 2024 16:04
1. Add a new check to the e2e test that confirms all streams are
   running after a Reshard.
2. Address a TODO on Reshard stream migrations
3. Fix a bug in readRefStreams (was using the workflow struct rather
   (than workflow name in the map key)
4. Moves more spots to using proto getters as they are nil safe

Signed-off-by: Matt Lord <[email protected]>
@mattlord
Copy link
Contributor Author

mattlord commented Mar 6, 2024

@rohit-nayak-ps I've addressed your review comments now and the tests are all green again. Please let me know what you think. Thanks!

go/test/endtoend/vreplication/helper_test.go Outdated Show resolved Hide resolved
proto/tabletmanagerdata.proto Outdated Show resolved Hide resolved
go/vt/vtctl/workflow/materializer_test.go Show resolved Hide resolved
sourceShards: []string{"-"},
targetShards: []string{"-80", "80-"},
wantReqs: map[uint32]*tabletmanagerdatapb.CreateVReplicationWorkflowRequest{
200: {
Copy link
Contributor

Choose a reason for hiding this comment

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

The expected requests are quite similar: only shards are different in this and the next, for example. A helper function to get the request based on the differing attributes might be useful. It will both reduce the size of the test and make it easier to see what is the difference in the expectation.

Copy link
Contributor Author

@mattlord mattlord Mar 10, 2024

Choose a reason for hiding this comment

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

Can you show me an example of what you mean? I don't see a clear and intuitive way to do this w/o the test case NOT containing the logic or explicitly stating what each test case wants.

Copy link
Contributor

Choose a reason for hiding this comment

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

I can do this later when I am refactoring the tests. Let's get this PR merged for now!

go/vt/vtctl/workflow/resharder.go Show resolved Hide resolved
go/vt/vtctl/workflow/server.go Show resolved Hide resolved
go/vt/vttablet/tabletmanager/rpc_vreplication.go Outdated Show resolved Hide resolved
Signed-off-by: Matt Lord <[email protected]>
@mattlord mattlord merged commit fbaed97 into vitessio:main Mar 11, 2024
105 checks passed
@mattlord mattlord deleted the rm_vrepl_exec branch March 11, 2024 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants