Skip to content

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

@inspire22

Description

@inspire22

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions