[pgpool-general: 8850] Re: DB Connection ERROR during a failover
Bo Peng
pengbo at sraoss.co.jp
Fri Jun 23 09:04:20 JST 2023
Hi,
Sorry for the late reply.
> 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?
Unfortunately, there is currently no workaround.
> I am using pgpool 4.0.4, Is this scenario enhanced in any later versions?
Yes. We have plan to enhance this feature.
> 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/
> >
--
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