thiagopradi / octopus

Database Sharding for ActiveRecord
2.53k stars 505 forks source link

Associations reads from master instead of replicated shard #454

Open ddh opened 7 years ago

ddh commented 7 years ago

I'm having issues retrieving associations of records that come from my slave shard. Not sure what is going on here and hopefully I can get some help debugging the issue! Might be related to #377

Given:

Problem:

I also noticed if I call on the association (in either direction, user.address or address.user), the associated record is returned only if it was in the master db (ie my local db) to begin with. It doesn't use the slave to make the query. Anyone else having this issue?

fertobar commented 6 years ago

same issues from my side with octopus 0.9.1 and AR 4.2.8

etsenake commented 6 years ago

Any word on how to fix this? I'm still having this problem Octopus 0.9.1 and A R 4.2.6

DanielMuller commented 6 years ago

I have the same problem. Octopus 0.9.2 and AR 4.0.0

swordfish444 commented 6 years ago

@thiagopradi We're still seeing this as well.

Octopus 0.9.2 | Rails 5.1.5

zpatten commented 6 years ago

@thiagopradi We are hitting this as well; still have a fair amount of reads going to master due to this.

Octopus master (0.9.2) @ https://github.com/thiagopradi/octopus/commit/ba65ba647b7420b482043ead4fe1e729059a14de AR 4.2.8

pablosky commented 5 years ago

Any news about this? am getting the same error.