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

MoveTables: Vitess infers the read and write routes incorrectly if the same table is involved in multiple workflows #16733

Closed
rohit-nayak-ps opened this issue Sep 8, 2024 · 0 comments · Fixed by #16731

Comments

@rohit-nayak-ps
Copy link
Contributor

Overview of the Issue

We use the table routing rules to decide where reads and writes are routed for tables which are part of MoveTables workflows.

For each table we have rules like

t1 => source.t1 
source.t1 => source.t1
t1@replica => source.t1@replica
source.t1@replica => source.t1@replica
target.t1 => source.t1

when no traffic is switched, or when all traffic is switched:

t1 => target.t1 
source.t1 => target.t1
t1@replica => target.t1@replica
source.t1@replica => target.t1@replica
target.t1 => target.t1

To determine whether writes are switched, we check the route for t1. If it is pointing to target it is considered that writes have been switched.

The problem comes the same table exists in different source keyspaces. For example if there are two workflows one from source1=>target1 and another from source2=>target2, both with a table t1.

Now if one workflow's writes are switched we end up with the route for t1 pointing to target1.t1. When the next workflow's writes are switched we now overwrite that rule so that it points to target2.t1. The logic now assumes writes for the first workflow have not been switched.

Reproduction Steps

.

Binary Version

c768b626575aa06025b347ea265d5cd4f3805fab

Operating System and Environment details

.

Log Fragments

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant