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

Gopikrishnan nksgopikrishnan at gmail.com
Wed Jun 14 14:28:43 JST 2023


Hi Bo,

Thanks for your response. To avoid hitting this error,
Is there a way to skip executing this failover since it is not the primary
node that failed?
I am using pgpool 4.0.4, Is this scenario enhanced in any later versions?

*Thanks*
*Gopi*


On Wed, Jun 14, 2023 at 9:34 AM Bo Peng <pengbo at sraoss.co.jp> wrote:

> 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/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pgpool.net/pipermail/pgpool-general/attachments/20230614/6034a455/attachment.htm>


More information about the pgpool-general mailing list