-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
VDiff: Copy non in_keyrange workflow filters to target tablet query #16307
Conversation
Signed-off-by: Matt Lord <[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
|
Signed-off-by: Matt Lord <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16307 +/- ##
==========================================
+ Coverage 68.69% 68.70% +0.01%
==========================================
Files 1544 1547 +3
Lines 198011 198260 +249
==========================================
+ Hits 136021 136216 +195
- Misses 61990 62044 +54 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Matt Lord <[email protected]>
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.
If you mean to backport this to v20
, please make sure to do so today, as we have a tentative plan to make a point release tomorrow (your late night tonight).
…16307) Signed-off-by: Matt Lord <[email protected]>
… tablet query (#16307) (#16315) Signed-off-by: Matt Lord <[email protected]> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com>
This PR was reviewed and merged before I could, but here's some feedback.
|
I don't think this is correct. The The bug this PR fixes is that @mlord, let me know if my understanding is incorrect. |
Description
In #15403 we added experimental support for moving tables from a multi-tenant environment (database per tenant, each with the same schema).
You would do that by specifying a column on the table(s) representing the tenant identifier in the target VSchema and then specifying a tenant identifier value using
MoveTables create --tenant-id=<val>
. You can see an example here: #16305 (comment)There is an optional
--shards <shards>
flag forMoveTables create
that would limit the workflow streams created to only the appropriate target shard for the provided tenant identifier value. In order to know what that would be, you would need to query the vindex function to know where they should land. This can be cumbersome in some situations and introduces the potential for human error so should not be required for anything to work properly (and one could argue it's better left to Vitess to figure this out — a future optimization would be for vreplication itself to determine which streams need to be created for the provided tenant identifier). Anyhow, when this--shards
flag was also specified then running VDiff on the workflow worked as expected. When it was not specified, however, there would be extra rows reported on the target if you had previously migrated any other tenants.This PR addresses this issue by ensuring that we copy any WHERE predicates from the workflow filter to the query used on the target tablets for the diff.
I think that we should backport this fix to v20 where the multi-tenant support was added since it's a pretty small change and will eliminate potential issues for those using this new experimental feature (and we want all the usage and input we can get).
Related Issue(s)
Checklist