<div dir="auto">Hi Tatsuo,<div dir="auto"><br></div><div dir="auto">I'm working with your patch but I continue facing a problem because the database is not available during 1 second aprox (I have a script calling select query every 0.1 seconds to check the time is not available the database).</div><div dir="auto"><br></div><div dir="auto">I will explain two different cases:</div><div dir="auto"><br></div><div dir="auto">1. Slave node (backend1 in pgpool.conf) is turn off. With your patch the database is always available. Without your patch the database is not available during 1 second.</div><div dir="auto">2. Master node (backend0) is turn off. Failover is done to promote backend1. After that, I turn on again backend0, which is now slave node. If I turn off this slave node (backend0), the database is not available during 1 second (with or without your patch)</div><div dir="auto"><br></div><div dir="auto">Do you have any idea why is this behaviour?</div><div dir="auto"><br></div><div dir="auto">Thanks in advance.</div><div dir="auto"><br></div><div dir="auto">Best,</div><div dir="auto">Jesús </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El vie, 14 abr 2023 3:41, Tatsuo Ishii <<a href="mailto:ishii@sraoss.co.jp">ishii@sraoss.co.jp</a>> escribió:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Jesús,<br>
<br>
> Hi Tatsuo,<br>
> <br>
> At first, thank you so much for your time to investigate this issue.<br>
<br>
No problem.<br>
<br>
> I have compiled pgpool 4.3.2 with your patch and the problem with pgbench<br>
> is solved.<br>
> I still need to test it in my environment.<br>
> <br>
> Anyway, I had a look your code and I have seen that the session is closed<br>
> only if failover is not completed in 30 seconds.<br>
> I have the following doubt related to this change. Is this session<br>
> operative during the failover? I mean, if failover spends 20 seconds, is<br>
> this session blocked during this time or this session can accept any<br>
> transaction?<br>
<br>
It is likely the session is blocked. The reason for "likely" is the<br>
function which has the logic inside can be called frequently during<br>
session but it is not always. It is possible that a pgpool process<br>
already called the function by the time when failover starts, then<br>
proceeds and sends a query to backend.<br>
<br>
> Let me another question. Should we add this issue as a bug?<br>
<br>
No you don't need. Developers already recognize this a bug report.<br>
<br>
> Thanks in advance.<br>
> <br>
> Best,<br>
> Jesús<br>
> <br>
> <br>
> El mié, 12 abr 2023 3:33, Tatsuo Ishii <<a href="mailto:ishii@sraoss.co.jp" target="_blank" rel="noreferrer">ishii@sraoss.co.jp</a>> escribió:<br>
> <br>
>> > However a downside of this is, while failover clients cannot process<br>
>> > queries or at least slow down processing. Below is the log from<br>
>> > pgbench using "-P 1" option to show progress. As you can see from 170<br>
>> > s pgbench starts to slow down and recovers at 194 s. That is, the<br>
>> > slowdown continued for 24 seconds.<br>
>> ><br>
>><br>
>> After more research, I suspect the slow down is due to effect of<br>
>> checkpointing. If I add "-S" option to change the transaction time, I<br>
>> don't see the slow down anymore.<br>
>><br>
>> Best reagards,<br>
>> --<br>
>> Tatsuo Ishii<br>
>> SRA OSS LLC<br>
>> English: <a href="http://www.sraoss.co.jp/index_en/" rel="noreferrer noreferrer" target="_blank">http://www.sraoss.co.jp/index_en/</a><br>
>> Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer noreferrer" target="_blank">http://www.sraoss.co.jp</a><br>
>><br>
</blockquote></div>