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

Tracker/VStreamer: only reload schema for tables in current database and not for internal table artifacts #8257

Merged

Conversation

rohit-nayak-ps
Copy link
Contributor

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

Description

A user had a problem migrating from Vitess 7.0 to Vitess 10.0. Their vreplication workflows were not making any forward progress in the replication mode after the migration. The cause was a custom heartbeat that was running at 2 qps which was implementing a pseudo-gtid similar to http://code.openark.org/blog/mysql/pseudo-gtid-ascending. The query would look like DROP VIEW IF EXISTS pseudo_gtid._pseudo_gtid_hint__asc:55B364E3:0000000000056EE2:6DD57B85

As part of DDL processing the VStreamer reloaded the schema for each heartbeat. In addition the tracker would also have tried to update the schema version table. Reloading schemas is expensive and doing it twice a second broke vstreamer processing.

This PR changes the logic to only reload schemas if a ddl is for a table in the current database. This automatically results in the pseudo-gtid ddls to be noops for the reloading logic. In addition we also ignore temporary tables generated by online ddl because vstreamer never sends events for those.

Checklist

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

…nline ddl artifacts

Signed-off-by: Rohit Nayak <rohit@planetscale.com>
@rohit-nayak-ps rohit-nayak-ps added Component: VReplication Type: Enhancement Logical improvement (somewhere between a bug and feature) labels Jun 3, 2021
@rohit-nayak-ps rohit-nayak-ps force-pushed the rn-vr-on-ddl-ignore-pseudo-gtid branch from b5fb1c7 to 1b9c8e9 Compare June 3, 2021 14:09
@rohit-nayak-ps rohit-nayak-ps marked this pull request as ready for review June 3, 2021 17:46
Copy link
Member

@rafael rafael left a comment

Choose a reason for hiding this comment

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

LGTM

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.

Nice work figuring this out!

@rohit-nayak-ps rohit-nayak-ps merged commit 236ddc4 into vitessio:main Jun 3, 2021
@rohit-nayak-ps rohit-nayak-ps deleted the rn-vr-on-ddl-ignore-pseudo-gtid branch June 3, 2021 18:31
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.

None yet

3 participants