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

non-atomic table swap #530

Closed
tivenwang opened this issue Dec 20, 2017 · 5 comments
Closed

non-atomic table swap #530

tivenwang opened this issue Dec 20, 2017 · 5 comments

Comments

@tivenwang
Copy link

hi ~ I want to understand the principle of table swap from http://code.openark.org/blog/mysql/solving-the-non-atomic-table-swap-take-iii-making-it-atomic .
"A blocked RENAME is always prioritized over a blocked INSERT/UPDATE/DELETE, no matter who came first
"。

Questions :
is the rename is always have priority over DML? why? is there has a documentation page?

@ggunson
Copy link
Contributor

ggunson commented Dec 20, 2017

I never found any official documentation that explained this, and I remember that the discussions that lead to the table swap algorithm didn't involve any doc or textbook referencing. It would be good to have this defined somewhere.

@shlomi-noach
Copy link
Contributor

Some more in-depth explanation is found on #82. Here is the pointer to the MySQL code which supports the DDL-vs-DML priority assertion.

@ggunson
Copy link
Contributor

ggunson commented Dec 21, 2017

Some more in-depth explanation is found on #82.

That issue is nearly identical to your blog post that @tivenwang linked to in the description. (Edited to add: I see there's some discussion in the comments, which satisfies the poster of this issue if not me).

The MySQL code comments aren't very helpful here, talking about piglets and hogs (🐷). It might be worth asking someone at MySQL to explain it (maybe write up a docs bug?).

@tivenwang
Copy link
Author

Some more in-depth explanation is found on #82

It·s useful for me.
thanks a lot. @ggunson @shlomi-noach

@shlomi-noach
Copy link
Contributor

At the time, our friend @MarkLeith of Oracle explained this to me. The explanation was lost in Slack's history rentention. Perhaps if he has the time he can explain again how DDL locks get higher priority over DML locks. 🙇

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

3 participants