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

Ignore internal tables in MoveTables and Reshard Workflows #9578

Merged
merged 5 commits into from
Jan 31, 2022

Conversation

mattlord
Copy link
Contributor

@mattlord mattlord commented Jan 28, 2022

Description

We need to ignore internal operation tables (e.g. for OnlineDDL processing) in MoveTables and Reshard workflows. We need to do this both when processing the -tables command-line flags and when processing SchemaDefinition structures that we get from the database.

I also got rid of the logging messages for when these internal tables are seen and ignored/skipped as I don't think that they are helpful to the end user.

You can see a simple Reshard demonstration and test here

These are using the docker_local container.

Before (main):

$ make docker_local && ./docker/local/run.sh
./201_customer_tablets.sh ; ./202_move_tables.sh ; sleep 10; ./203_switch_reads.sh ; ./204_switch_writes.sh ; ./205_clean_commerce.sh ; ./301_customer_sharded.sh ; ./302_new_shards.sh; sleep 5; mysql customer -e "create table _vt_PURGE_1f9194b43b2011eb8a0104ed332e05c2_20201210194431(id int, val varbinary(128), primary key(id))"; ./303_reshard.sh ; sleep 5; mysql customer/-80 -e "show tables"
...
+-----------------------------------------------------------+
| Tables_in_vt_customer                                     |
+-----------------------------------------------------------+
| _vt_PURGE_1f9194b43b2011eb8a0104ed332e05c2_20201210194431 |
| corder                                                    |
| customer                                                  |
+-----------------------------------------------------------+

After (this branch):

$ make docker_local && ./docker/local/run.sh
./201_customer_tablets.sh ; ./202_move_tables.sh ; sleep 10; ./203_switch_reads.sh ; ./204_switch_writes.sh ; ./205_clean_commerce.sh ; ./301_customer_sharded.sh ; ./302_new_shards.sh; sleep 5; mysql customer -e "create table _vt_PURGE_1f9194b43b2011eb8a0104ed332e05c2_20201210194431(id int, val varbinary(128), primary key(id))"; ./303_reshard.sh ; sleep 5; mysql customer/-80 -e "show tables"
...
+-----------------------+
| Tables_in_vt_customer |
+-----------------------+
| corder                |
| customer              |
+-----------------------+

Related Issue(s)

Follow-up to: #8992
Fixes: #9577, #9576

Checklist

  • Should this PR be backported? No
  • Tests were added
  • Documentation is not required (users should not even be aware of these tables)

@mattlord mattlord force-pushed the vrepl_skip_internal branch from 734be42 to de4196d Compare January 28, 2022 22:58
@mattlord
Copy link
Contributor Author

@shlomi-noach could you please offer some insights/input here if you have time? You may be aware of potential problems in eliding the internal tables at the mysqlctl.GetSchema layer. If so, I'll have to find more locations to explicitly ignore these internal tables (Reshard still fails w/o that and will have to find an alternative fix).

And also in MoveTables when processing the -tables flag

Signed-off-by: Matt Lord <[email protected]>
@mattlord mattlord force-pushed the vrepl_skip_internal branch from de4196d to b3ec8e5 Compare January 28, 2022 23:56
@mattlord
Copy link
Contributor Author

mattlord commented Jan 29, 2022

@shlomi-noach could you please offer some insights/input here if you have time? You may be aware of potential problems in eliding the internal tables at the mysqlctl.GetSchema layer. If so, I'll have to find more locations to explicitly ignore these internal tables (Reshard still fails w/o that and will have to find an alternative fix).

The failed tests seem to be telling me it is a problem. 🙂 I'll abandon that approach, at least for now.

@mattlord mattlord changed the title Skip internal tables in VReplication Part 2 Skip internal tables in MoveTables and Reshard Workflows Jan 29, 2022
@mattlord mattlord changed the title Skip internal tables in MoveTables and Reshard Workflows Ignore internal tables in MoveTables and Reshard Workflows Jan 29, 2022
@mattlord mattlord force-pushed the vrepl_skip_internal branch 3 times, most recently from e7f6620 to d7117c1 Compare January 29, 2022 07:53
For MoveTables and Reshard related workflows, we ignore them.

Signed-off-by: Matt Lord <[email protected]>
@mattlord mattlord force-pushed the vrepl_skip_internal branch from d7117c1 to 9796dcc Compare January 29, 2022 08:00
@mattlord mattlord marked this pull request as ready for review January 29, 2022 10:18
Copy link
Contributor

@rohit-nayak-ps rohit-nayak-ps left a comment

Choose a reason for hiding this comment

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

lgtm

go/vt/mysqlctl/tmutils/schema.go Show resolved Hide resolved
go/vt/wrangler/materializer.go Outdated Show resolved Hide resolved
@mattlord mattlord requested a review from shlomi-noach January 30, 2022 18:25
@mattlord
Copy link
Contributor Author

mattlord commented Jan 30, 2022

Thank you, @shlomi-noach and @rohit-nayak-ps! I've addressed those comments here: a5638eb

@mattlord mattlord force-pushed the vrepl_skip_internal branch from 1101339 to a5638eb Compare January 30, 2022 18:48
@rohit-nayak-ps rohit-nayak-ps merged commit 2c0a29d into vitessio:main Jan 31, 2022
@rohit-nayak-ps rohit-nayak-ps deleted the vrepl_skip_internal branch January 31, 2022 09:33
@mattlord mattlord linked an issue Jan 31, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants