-
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
VReplication TableStreamer: Only stream tables in tablestreamer (ignore views) #14646
VReplication TableStreamer: Only stream tables in tablestreamer (ignore views) #14646
Conversation
Signed-off-by: Rohit Nayak <[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: Rohit Nayak <[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.
Just some minor suggestions. Thanks!
tableName := row[0].ToString() | ||
tableType := row[1].ToString() |
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.
I think that we should either switch to using named rows or add a quick len(row) check just to be sure we don't crash with index out of bounds in some odd cases.
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.
Named rows is a no-go here, because the column name is dynamically constructed by the schema name (e.g. Tables_in_mydb
) which is a bit of a nightmare with UTF and escaping.
I'd say an output of SHOW FULL TABLES
can be trusted to have two columns, much like SHOW VARIABLES
can be trusted to have two columns.
At any case, if we choose to validate number of columns, we should return some outrageous error like Code_INTERNAL
or something likewise dramatic.
…re views) (#14646) Signed-off-by: Rohit Nayak <[email protected]>
…estreamer (ignore views) (#14646) (#14649) Signed-off-by: Rohit Nayak <[email protected]> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Rohit Nayak <[email protected]>
…re views) (vitessio#14646) Signed-off-by: Rohit Nayak <[email protected]>
Description
When we do an atomic copy the
tablestreamer
streams all tables. The correspondingMoveTables
gets its own list of tables, for which it adds filters for each table as part of the vreplication stream'sbinlogsource
. For non-atomic copy workflows, we stream each table in thebinlogsource
list of tables. On the target vreplication creates one table plan for each of these tables.However we get a full list of tables again after we have taken a snapshot (after locking all tables) for atomic copy and stream those tables.
There was a bug where we were not excluding views from this list. Hence the target was seeing a stream from the view resulting in the target stream erroring out since it doesn't have this view in its list of table plans.
This PR fixes that bug. It also adds a view to the e2e test: that test fails without the fix in the PR.
Related Issue(s)
Fixes #14648
Checklist