JDBC Postgres Failover with quorum based synchronous replication - Mailing list pgsql-admin

From Debraj Manna
Subject JDBC Postgres Failover with quorum based synchronous replication
Date
Msg-id CAF6DVKMn3J04P2PW1gi4mwpQ1+Z6V_dKU4fpRwdZS8NXonx08g@mail.gmail.com
Whole thread Raw
Responses Re: [External] JDBC Postgres Failover with quorum based synchronousreplication  (Vijaykumar Jain <vjain@opentable.com>)
List pgsql-admin
Hi

Let's say I am using quorum based synchronous replication either ANY or FIRST in synchronous_standby_names

I am trying to read from slave as discussed here

jdbc:postgresql://node1,node2,node3/accounting?targetServerType=preferSlave&loadBalanceHosts=true

Can someone let me know 
  1. How does a slave is selected? Is a slave randomly selected or a slave is preferred which has zero lag or the minimum lag? 
  2. Is there any setting in jdbc url which will only select the slave with zero replication and if no such slave exists then read will be sent to master ?
Thanks,



pgsql-admin by date:

Previous
From: Rui DeSousa
Date:
Subject: Re: How to get current timeline of host in postgres 10.4?
Next
From: Vijaykumar Jain
Date:
Subject: Re: [External] JDBC Postgres Failover with quorum based synchronousreplication