Open artkirienko opened 6 years ago
@artkirienko this is working fine for me. For example:
>> User.last # Uses replica
[replica] User Load (5.5ms) SELECT `users`.* FROM `users` ORDER BY `users`.`id` DESC LIMIT 1
>> User.connection.stick_to_master!
=> 10.0
>> User.last # Uses primary
[primary] User Load (2.9ms) SELECT `users`.* FROM `users` ORDER BY `users`.`id` DESC LIMIT 1
Have you tried setting sticky: true
in your configuration? I think that's the reason stickiness is being skipped for you after calling stick_to_master!
.
https://github.com/taskrabbit/makara#common-problems--solutions
database.yml
It uses slave database. It's okay.
It is still using slave database. Why so? I've even tried to set master_ttl to 600. Same problem.