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: Add ability to tag workflows #8388

Merged
merged 7 commits into from
Jul 7, 2021

Conversation

rohit-nayak-ps
Copy link
Contributor

@rohit-nayak-ps rohit-nayak-ps commented Jun 26, 2021

Description

Users have requested the ability to group workflows. Some use cases:

  • Sharded->sharded Reshards that are done incrementally, one per source shard, for reducing the risk when workflows have fatal failure and need to be restarted from scratch
  • Materialize streams that require custom filters (for PII implementations, say) for each table
  • When multiple tables are to be moved and these are split across workflows for performance reasons to work around the current limitation where tables are only copied one at a time per workflow

This PR adds the ability to tag workflows in a simple and extensible way. It adds a tags column to the _vt.vreplication table. Adding multiple tags is left as an implementation detail: the most obvious way would be to use a list of comma-separated tags in that column.

This implementation also allows users to tag each stream in a workflow separately by specifying separate list of tags for each stream in the workflow on each target.

To add tags at the workflow level use the Workflow command thus: vtctlclient Workflow customer.cust2cust tags 'a,b' to set the tags. Specify an empty string to reset the tags.

To set tags at the stream level use VReplicationExec thus: vtctlclient VReplicationExec zone1-100 "update _vt.vreplication set tags = 'a,b' where workflow = 'cust2cust' and keyspace = 'customer'"

The wrangler function wr.WorkflowTagAction(ctx, keyspace, workflow, tags) can be used for programmatically setting it in, say, vtadmin.

Note that tags do not affect the core functionality of vreplication workflows.

Signed-off-by: Rohit Nayak [email protected]

Checklist

  • Tests were added or are not required
  • Documentation was added or is not required

@rohit-nayak-ps rohit-nayak-ps added Type: Enhancement Logical improvement (somewhere between a bug and feature) Component: VReplication labels Jun 26, 2021
@rohit-nayak-ps rohit-nayak-ps requested a review from ajm188 June 26, 2021 19:25
Copy link
Contributor

@ajm188 ajm188 left a comment

Choose a reason for hiding this comment

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

this is looking good to me! a comment about cli, and then also about keeping the new apis in sync (which, yes, we should unify soon, but for now)

go/vt/vtctl/vtctl.go Show resolved Hide resolved
go/vt/vtctl/vtctl.go Show resolved Hide resolved
go/vt/wrangler/vexec.go Show resolved Hide resolved
Signed-off-by: Rohit Nayak <[email protected]>
Signed-off-by: Rohit Nayak <[email protected]>
… the CI logs

Speed up the teardown process, which was occassionally taking too long and causing tests to timeout

Signed-off-by: Rohit Nayak <[email protected]>
Signed-off-by: Rohit Nayak <[email protected]>
Signed-off-by: Rohit Nayak <[email protected]>
Copy link
Contributor

@ajm188 ajm188 left a comment

Choose a reason for hiding this comment

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

Just one small thing about the protobuf type change and then this lgtm whenever you want to move out of draft

proto/vtctldata.proto Outdated Show resolved Hide resolved
go/vt/vtctl/vtctl.go Show resolved Hide resolved
go/vt/vtctl/vtctl.go Show resolved Hide resolved
@rohit-nayak-ps rohit-nayak-ps marked this pull request as ready for review July 6, 2021 20:12
@rohit-nayak-ps
Copy link
Contributor Author

Just one small thing about the protobuf type change and then this lgtm whenever you want to move out of draft

Ready for review

Copy link
Contributor

@ajm188 ajm188 left a comment

Choose a reason for hiding this comment

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

lgtm

@rohit-nayak-ps rohit-nayak-ps merged commit 16216a5 into vitessio:main Jul 7, 2021
@rohit-nayak-ps rohit-nayak-ps deleted the rn-vrepl-tags branch July 7, 2021 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: VReplication Type: Enhancement Logical improvement (somewhere between a bug and feature)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants