-
Notifications
You must be signed in to change notification settings - Fork 170
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
Send nextval queries to master and show queries to replicas for Postgres #173
Conversation
Looks like
|
Hey @bleonard, thanks for the response. Happy to move them to abstract adapter. When moving show, it looks like a few tests expect those queries to run on master. Any thoughts?
|
It looks like at some point, very early on, we decided that Does ActiveRecord do Or maybe more interestingly, was |
For Postgres, We haven't had any Rails specific issues, just a very small amount of application code that calls |
Moved |
Thanks @ankane |
Thank you. We tried 4 different libraries for sending reads to replicas, and Makara was the clear winner :) |
We're currently using this hack to effect one of the fixes in this PR:
Will there be a new release soon? :) |
Hey, big thanks for this gem! We're heavy users at Instacart. We've been running off a fork for a while, so wanted to try and get a few of the changes merged upstream. Here's the first of a few.
The
nextval
function in Postgres returns the next value in a sequence. Since it updates the sequence, it needs to be called on master. More info on sequencesshow
functions are okay to run on replicas.Added as separate commits for each so you can cherry-pick if desired.