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: clean-up copy_state correctly #5048

Merged
merged 2 commits into from
Aug 8, 2019

Conversation

sougou
Copy link
Contributor

@sougou sougou commented Aug 4, 2019

  • On delete of a row in _vt.vreplication, we should also cleanup
    the copy_state table, because it may have related rows.
  • Made workflow into a flag, but mandatory. Otherwise the number
    of unnamed arguments are too many and command becomes unreadable.
  • Added ability to read from _vt.copy_state using VReplicationExec.

Signed-off-by: Sugu Sougoumarane ssougou@gmail.com

* On delete of a row in _vt.vreplication, we should also cleanup
the copy_state table, because it may have related rows.
* Made workflow into a flag, but mandatory. Otherwise the number
of unnamed arguments are too many and command becomes unreadable.
* Added ability to read from _vt.copy_state using VReplicaionExec.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
@sougou sougou requested review from rafael and deepthi August 4, 2019 22:56
Legacy mode vreplication will not create copy_state.
So, we have to ignore the table not found error when
deleting from copy_state.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Copy link
Member

@deepthi deepthi left a comment

Choose a reason for hiding this comment

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

The copy_state part looks fine, but I have a question on workflow inline.

@@ -1845,21 +1845,27 @@ func commandMigrateReads(ctx context.Context, wr *wrangler.Wrangler, subFlags *f
if *reverse {
direction = wrangler.DirectionBackward
}
return wr.MigrateReads(ctx, keyspace, workflow, servedType, cells, direction)
if *workflow == "" {
Copy link
Member

Choose a reason for hiding this comment

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

How does this affect vtctl SplitClone? should that return an workflow name that can be used for subsequent invocations of MigrateReads and MigrateWrites?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

vtctl SplitClone and VerticalSplitClone will also be deprecated. They won't work with MigrateReads and MigrateWrites. The replacement commands are Migrate and Reshard, which you'll see in the POC branch.

Copy link
Member

Choose a reason for hiding this comment

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

+1

@sougou sougou merged commit 23c5ac3 into vitessio:master Aug 8, 2019
@sougou sougou deleted the ss-vrepl-clean-copy-state branch August 8, 2019 22:38
deepthi added a commit to planetscale/vitess that referenced this pull request Aug 13, 2019
…se needs to be updated to conform to that

Signed-off-by: deepthi <deepthi@planetscale.com>
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