[HACKERS] [bug fix] PG10: libpq doesn't connect to alternative hosts whensome errors occur - Mailing list pgsql-hackers

From Tsunakawa, Takayuki
Subject [HACKERS] [bug fix] PG10: libpq doesn't connect to alternative hosts whensome errors occur
Date
Msg-id 0A3221C70F24FB45833433255569204D1F6F5659@G01JPEXMBYT05
Whole thread Raw
Responses Re: [HACKERS] [bug fix] PG10: libpq doesn't connect to alternativehosts when some errors occur
List pgsql-hackers
Hello,

I found a problem with libpq connection failover.  When libpq cannot connect to earlier hosts in the host list, it
doesn'ttry to connect to other hosts.  For example, when you specify a wrong port that some non-postgres program is
using,or some non-postgres program is using PG's port unexpectedly, you get an error like this:
 

$ psql -h localhost -p 23
psql: received invalid response to SSL negotiation: 
$ psql -h localhost -p 23 -d "sslmode=disable"
psql: expected authentication request from server, but received 

Likewise, when the first host has already reached max_connections, libpq doesn't attempt the connection aginst later
hosts.

The attached patch fixes this.  I'll add this item in the PostgreSQL 10 Open Items.


Regards
Takayuki Tsunakawa


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachment

pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: [HACKERS] Hash Functions
Next
From: Masahiko Sawada
Date:
Subject: [HACKERS] Improvement in log message of logical replication worker