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

about Switching Table operation in Gh-ost #436

Closed
bckim2 opened this issue Jul 3, 2017 · 2 comments
Closed

about Switching Table operation in Gh-ost #436

bckim2 opened this issue Jul 3, 2017 · 2 comments

Comments

@bckim2
Copy link

bckim2 commented Jul 3, 2017

Hello, this is Bckim2.

Could you please tell us about Switching Table operation in Gh-ost ?

It Just execute "alter rename table" like this?

ex)
alter table original-table rename to original-table-backup;
alter table original-table-gho rename to original-table;

if then, What are the measures against meta-locks?

if there is long transacntion in the altering table,
Gh-ost has to occur meta-lock until finish the long transaction.

thanks.

@bckim2 bckim2 changed the title about Switch Table operation in Gh-ost about Switching Table operation in Gh-ost Jul 3, 2017
@shlomi-noach
Copy link
Contributor

The table cut-over operation is described here and here. It is not a two-step rename but a single, atomic, blocking rename of both tables.

The measures against meta-locks are #90, namely set session lock_wait_timeout which works very well (starting MySQL 5.6). The default timeout is 3 seconds.

In the event of timeout gh-ost retries multiple times, up to --default-retries times.

gh-ost does not kill queries operating on the table. If you wish to do so (the Facebook tool does that), you can use your own custom hooks.

@bckim2
Copy link
Author

bckim2 commented Jul 3, 2017

thank you for your answer.

@bckim2 bckim2 closed this as completed Jul 3, 2017
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

No branches or pull requests

2 participants