[pgpool-general: 8832] Re: DB Connection ERROR during a failover

Bo Peng pengbo at sraoss.co.jp
Wed Jun 14 13:04:47 JST 2023


Hi,

> In my application, I see an error:
> 
> Caused by: org.postgresql.util.PSQLException: FATAL: failed to create a
> backend connection
>   Detail: executing failover on backend
> at
> org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:514)
> at
> org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:141)
> at
> org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:192)
> 
> Is there a configuration I can use to make the connection wait for the
> failover to complete?

Unfortunately, pgpool doesn't have such feature.
You need to add such retry logic in your application code.

> Also, I can see that the failover was not indeed a failover, i.e the
> failover would eventually
> be skipped since it is not the primary node that failed:
> 
> 2023-06-12_18:27:55 [failover.sh]: failed_node_id=1 failed_host=10.198.49.42
> 2023-06-12_18:27:55 [failover.sh]: old_master_node_id=0
> old_primary_node_id=0
> 2023-06-12_18:27:55 [failover.sh]: new_primary_node_id=0
> new_master_host=10.198.49.41
> 2023-06-12_18:27:55 [failover.sh]: Node 1 dies, but it's not the primary
> node. Skipping failover.

Yes. Pgpool-II checks the role of the failed node in the failover script.
If the failed node is a standby node, pgpool just updates
the node status to DOWN and skips failover.

-- 
Bo Peng <pengbo at sraoss.co.jp>
SRA OSS LLC
TEL: 03-5979-2701 FAX: 03-5979-2702
URL: https://www.sraoss.co.jp/



More information about the pgpool-general mailing list