<div dir="ltr">Hi all,<div><br></div><div>Is there a way to avoid this spurious failover execution?</div><div>Appreciate any help.</div><div><br></div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><b>Thanks</b><br></div><i>Gopi</i><br></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 14, 2023 at 10:58 AM Gopikrishnan <<a href="mailto:nksgopikrishnan@gmail.com">nksgopikrishnan@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Bo,<div><br></div><div>Thanks for your response. To avoid hitting this error,</div><div>Is there a way to skip executing this failover since it is not the primary node that failed?</div><div>I am using pgpool 4.0.4, Is this scenario enhanced in any later versions?</div><div><br clear="all"><div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><b>Thanks</b><br></div><i>Gopi</i><br></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 14, 2023 at 9:34 AM Bo Peng <<a href="mailto:pengbo@sraoss.co.jp" target="_blank">pengbo@sraoss.co.jp</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
> In my application, I see an error:<br>
> <br>
> Caused by: org.postgresql.util.PSQLException: FATAL: failed to create a<br>
> backend connection<br>
>   Detail: executing failover on backend<br>
> at<br>
> org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:514)<br>
> at<br>
> org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:141)<br>
> at<br>
> org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:192)<br>
> <br>
> Is there a configuration I can use to make the connection wait for the<br>
> failover to complete?<br>
<br>
Unfortunately, pgpool doesn't have such feature.<br>
You need to add such retry logic in your application code.<br>
<br>
> Also, I can see that the failover was not indeed a failover, i.e the<br>
> failover would eventually<br>
> be skipped since it is not the primary node that failed:<br>
> <br>
> 2023-06-12_18:27:55 [failover.sh]: failed_node_id=1 failed_host=10.198.49.42<br>
> 2023-06-12_18:27:55 [failover.sh]: old_master_node_id=0<br>
> old_primary_node_id=0<br>
> 2023-06-12_18:27:55 [failover.sh]: new_primary_node_id=0<br>
> new_master_host=10.198.49.41<br>
> 2023-06-12_18:27:55 [failover.sh]: Node 1 dies, but it's not the primary<br>
> node. Skipping failover.<br>
<br>
Yes. Pgpool-II checks the role of the failed node in the failover script.<br>
If the failed node is a standby node, pgpool just updates<br>
the node status to DOWN and skips failover.<br>
<br>
-- <br>
Bo Peng <<a href="mailto:pengbo@sraoss.co.jp" target="_blank">pengbo@sraoss.co.jp</a>><br>
SRA OSS LLC<br>
TEL: 03-5979-2701 FAX: 03-5979-2702<br>
URL: <a href="https://www.sraoss.co.jp/" rel="noreferrer" target="_blank">https://www.sraoss.co.jp/</a><br>
</blockquote></div>
</blockquote></div>