Skip to content

Gracefully handle a missing vreplication table during vreplication en…#4455

Merged
sougou merged 1 commit intovitessio:masterfrom
dweitzman:always_create_vreplication_table
Jan 4, 2019
Merged

Gracefully handle a missing vreplication table during vreplication en…#4455
sougou merged 1 commit intovitessio:masterfrom
dweitzman:always_create_vreplication_table

Conversation

@dweitzman
Copy link
Copy Markdown
Collaborator

…gine Exec commands

Signed-off-by: David Weitzman dweitzman@pinterest.com

@dweitzman dweitzman requested a review from sougou as a code owner December 13, 2018 21:14
@dweitzman
Copy link
Copy Markdown
Collaborator Author

Looks like some of the integration tests aren't happy when unexpected new SQL statements run in the middle of them

Another option would be to detect the sqlerror for a missing table or db and only run the CREATE if one of those errors occurs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I still can't figure out how vre.mustCreate flag got reset without the db & table being created. One possibility is that the initial attempt returned a different error than 1146.

Although this is an uncomfortable fail-safe, I think we have to do this because 'it has happened before'. The tests need fixing because they need to field these new queries.

@dweitzman dweitzman force-pushed the always_create_vreplication_table branch from 8f61162 to b1709dd Compare January 4, 2019 19:53
@dweitzman
Copy link
Copy Markdown
Collaborator Author

Reworked this PR to only try to create the table if there's a missing db or missing table error.

@dweitzman dweitzman force-pushed the always_create_vreplication_table branch 2 times, most recently from b69c692 to 588ff2f Compare January 4, 2019 22:24
It might disappear due to someone manually mucking with the db without
restarting the tablet. We hit this due to having a test environment where
the db can be restored to a pre-sharding snapshot withou the tablet restarting.
Prior to this change the tablet would have mustCreate false and would fail to
adapt to disappearence of the vreplication table.

Signed-off-by: David Weitzman <dweitzman@pinterest.com>
@dweitzman dweitzman force-pushed the always_create_vreplication_table branch from 588ff2f to 230bf56 Compare January 4, 2019 22:33
@sougou sougou merged commit ae79dd4 into vitessio:master Jan 4, 2019
@dweitzman dweitzman deleted the always_create_vreplication_table branch January 7, 2019 00:50
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.

2 participants