Docs indicate atomic_switch is autodetected #20

Closed
jnewland opened this Issue Aug 20, 2012 · 5 comments

Comments

Projects
None yet
3 participants

Docs:

Lhm chooses the strategy automatically based on the used MySQL server version, but you can override the behavior with an option.

Reality:

Using mysql 5.1.63-rel13.4-log. You must explicitly set options[:atomic_switch](re SqlHelper#supports_atomic_switch?)

Member

grobie commented Aug 20, 2012

That's because mysql version 5.1 is affected by the Mysql bug #39675. Have a look at the steps in the bug description to reproduce the behavior to see if you're really affected. In case you don't use replication at all, it's safe to use the atomic switcher, otherwise it's not. We (at SoundCloud) ran into this behavior during a production migration and it caused serious problems (downtime of 2 hours if I remember correctly).

Are you sure your version is not affected? Otherwise I think the current way to choose the strategy seems to be correct.

The bug is that the docs indicate that this is autodetected, but it's not. It's required to be manually set.

Thanks for this project! I'll definitely hacking on it some when I get a few spare cycled.

Member

grobie commented Aug 20, 2012

I'll have a look at the implementation, but just to be sure: you're using mysql 5.1 and the automatically chosen strategy is locked_switcher? This would be correct. The atomic strategy can't be safely used with mysql 5.1

We're running 5.1. Reading the docs lead us to believe locked_switcher would be chosen automatically:

Lhm chooses the strategy automatically based on the used MySQL server version, but you can override the behavior with an option.

Rather, our migration failed and we were told to explicitly set the strategy.

Member

grobie commented Aug 20, 2012

Got it. Thanks for the report, will have a look.

lgierth closed this Feb 22, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment