octopus
octopus copied to clipboard
Fully replicated isn't sending all reads to slave
I have octopus setup for full replication. I can see that some read requests are going to the slave but not others. I know this by looking at the logs and seeing when there is a shard message or not. Also I can see by the traffic to the slave. Am I mistaken in thinking that ALL read requests should go to the slave? I also saw https://github.com/thiagopradi/octopus/issues/377 so rolled back to 0.8.5 but see the same issue.
Here is my shards.yml:
octopus:
replicated: true
environments:
- staging
staging:
slave1:
adapter: mysql2
host: <%= ENV['SLAVE1_DATABASE_HOST'] %>
password: <%= ENV['DB_PASSWORD'] %>
pool: <%= ENV['APP_POOL_SIZE'] %>
database: my_db_name
reconnect: true
same issue here.
When I do User.using(:slave1).count the query goes to slave, but when I do User.count the query goes to master. Also I'm using fully_replicated: true as well
HI @drewB and @luizkowalski - can you try to use Octopus from git, using branch fixing_replication_bug_new? Please note that this is an experimental fix, so don't deploy this branch to production in any case - the patch with the fix needs to be polished.
Thiago
I forgot to post here, I fixed the issue just changing my yaml file. it was wrong and someone point that to me
I just tried the new branch but it is not compatible with Rails 3.2 which is what I am running.
Just noticed that 0.6.1 is the last version that supports Rails 3.2. Strange the new version did work for me. I am going to try with 0.6.1 and see if that fixes the problem.
Oh wait. That is the last version that supports Rails 3.0. So later versions should be fine with Rails 3.2.
Just to try I went back to 0.6.1 and that seemed to fix the issue. With 0.7.0 the issue returned.