On Tuesday, October 2, 2018 at 10:44:22 AM UTC-7, Michał Pietrus wrote: > > Hi Jeremy! > > ### Complete Description of Issue > > When using the simplest possible read/write configuration, as stated > [here]( > https://sequel.jeremyevans.net/rdoc/files/doc/sharding_rdoc.html#label-Single+Primary-2C+Single+Replica), > > it seems it doesn't recognize different port number for reads. My configs > are as simple as: > >> write_production: >> <<: *main >> >> read_production: >> <<: *main >> port: 5001 >> > > and setup (this is ROM using Sequel under the hood) > > config = ::ROM::Configuration.new( >> :sql, >> container[:config].write_db_config, >> servers: { read_only: container[:config].read_db_config } >> ) > > > > From what I am seeing in the PostgreSQL connections, all of them are > hitting master -- probably because different port number is being ignored? > > If I had to guess, it could be that your yaml configuration uses "port" and not :port as the hash key. You could switch the line to:
:port: 5001 and see if it makes a difference. It could be that ROM converts the string to a symbol, I'm not sure. If that is not it, please post a self contained reproducible example using just Sequel (without ROM), and using the server_logging extension to make it easier to see which shard each query is being issued to. Thanks, Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sequel-talk. For more options, visit https://groups.google.com/d/optout.
