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

VReplication: Miscellaneous improvements #7275

Merged
merged 8 commits into from
Jan 20, 2021

Conversation

rohit-nayak-ps
Copy link
Contributor

@rohit-nayak-ps rohit-nayak-ps commented Jan 9, 2021

Description

Change MoveTables/Reshard Start to Create

In V2 the Start sub-command both creates the workflow and starts the streams. This is confusing since it is the same term used to set the state of a workflow to Running in the Workflow command.

Add both Master and Replica as default tablet picker choices

We had just Replica as a default for tablet types that the tablet picker would use to choose a source tablet for vreplication streams. However for initial migration into Vitess users just have a single vttablet proxying their existing MySQL server and thus have just a Master tablet type. This would result in the vreplication streams getting stuck. With this PR this default is both replica and master.

Don't require switching rdonly tablets if none exist

Many setups do not have rdonly tablets. (Also rdonly is going to be deprecated soon). Currently we only consider a workflow as fully switched forward if all tablet types are switched. Thus users are forced to run a noop command to switch rdonly tablets. This PR automatically marks rdonly tablets as switched if user switches replicas and, at the time of the forward or reverse switch, there are no rdonly tablets in the associated (source for forward, target for reverse) keyspace.

Don't allow forward switching if workflow is in copy state

This PR adds a sanity check that a workflow is replicating and is no longer in the Copying state. The user is supposed to use VDiff and Workflow Show tools to validate that the workflow has completed copying as an operational best practice, but since it can be overlooked this sanity check has been added. Note that we are not yet checking for an acceptable lag: in practice once copy is completed lags should be small anyway and an acceptable lag is anyway subjective. We might add this later if we find it is useful and can be well specified.

This should be backported to 9.0 RC since we have changed the Start subcommand to Create and this release introduces v2.

Checklist

  • Should this PR be backported?
  • Tests were added or are not required
  • Documentation was added or is not required

Impacted Areas in Vitess

Components that this PR will affect:

  • Query Serving
  • VReplication
  • Cluster Management
  • Build
  • VTAdmin

@rohit-nayak-ps rohit-nayak-ps force-pushed the rn-vrepl-misc branch 2 times, most recently from 6db2abd to e891283 Compare January 14, 2021 22:29
@rohit-nayak-ps rohit-nayak-ps marked this pull request as ready for review January 15, 2021 13:39
@rohit-nayak-ps rohit-nayak-ps changed the title VReplication Miscellaneous improvements VReplication: Miscellaneous improvements Jan 15, 2021
@sougou
Copy link
Contributor

sougou commented Jan 19, 2021

Feel free to merge after conflicts are resolved.

@rohit-nayak-ps rohit-nayak-ps merged commit 0945234 into vitessio:master Jan 20, 2021
@rohit-nayak-ps rohit-nayak-ps deleted the rn-vrepl-misc branch January 20, 2021 18:39
@askdba askdba added this to the v9.0 milestone Jan 25, 2021
aquarapid added a commit to planetscale/vitess that referenced this pull request Aug 5, 2021
this year in PR vitessio#7275 to change the vreplication_tablet_type defaults.

Signed-off-by: Jacques Grove <[email protected]>
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.

3 participants