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

How to force both slaves and master to a new connection? #5

Open
inspire22 opened this issue Jul 26, 2013 · 0 comments
Open

How to force both slaves and master to a new connection? #5

inspire22 opened this issue Jul 26, 2013 · 0 comments

Comments

@inspire22
Copy link

When I'm doing database maintainance on my master-master setup I update my memcache to $cache['db'] = 'other_server' (whichever one I'm not working on)

I'm currently trying to do this by wrapping the call in a with_master, and then updating the connection inside that block (ActiveRecord::Base.connection == blah), though I'm actually using a ActiveRecord::Base.configurations cache to avoid reconnecting, but I think that doesn't cause issues.

It seems to work 99% of the time, but occasionally a query slips through. Any suggestions on how to handle this better?

Thanks for a great project!

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

1 participant