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

Make sure lookup vindexes are queryable inside transaction #6499

Merged
merged 2 commits into from
Aug 2, 2020

Conversation

systay
Copy link
Collaborator

@systay systay commented Jul 30, 2020

When adding data to tables that have consistent lookup vindexes defined on them, Vitess uses different connections to be able to commit data in discrete chunks - we INSERT new data to indexes before we add data to the base table. If something goes wrong along the way, it's acceptable to have data exist in the vindex that is not present in the base table - this will lead to unnecessary queries, but not inconsistent results.

The issue this PR is solving is that we were not querying the lookup vindex on the correct connection while still inside the transaction, which leads to no data being found.

Note: for DELETEd rows, we will query the vindex on the wrong connection, which will lead to unnecessary queries, but
no wrong results, since the data has been deleted from the base table.

Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
@sougou sougou merged commit 4684798 into vitessio:master Aug 2, 2020
@harshit-gangal harshit-gangal deleted the lookup-in-correct-tx branch August 3, 2020 03:17
@askdba askdba added this to the v8.0 milestone Oct 5, 2020
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.

4 participants