<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Op za 30 mrt 2024 om 08:42 schreef Tatsuo Ishii <<a href="mailto:ishii@sraoss.co.jp">ishii@sraoss.co.jp</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> Op vr 29 mrt 2024 om 15:26 schreef Tatsuo Ishii <<a href="mailto:ishii@sraoss.co.jp" target="_blank">ishii@sraoss.co.jp</a>>:<br>
> <br>
>> > Hi,<br>
>> ><br>
>> > After upgrading from 4.5.0 to 4.5.1 we see lots of regressions in our<br>
>> > test-suite when failovers are involved with the following exception in<br>
>> > WildFly:<br>
>> > Caused by: org.postgresql.util.PSQLException: ERROR: unable to read<br>
>> message<br>
>> > kind from backend<br>
>> >   Detail: 0 th backend is not valid<br>
>> ><br>
Ok. The commit you pointed out:<br>
> is the change that is causing the problems:<br>
> <a href="https://github.com/pgpool/pgpool2/commit/a2a86804cb838b416f317cc083d521a5c691f2ec" rel="noreferrer" target="_blank">https://github.com/pgpool/pgpool2/commit/a2a86804cb838b416f317cc083d521a5c691f2ec</a><br>
<br>
has a bug: when load_balance_mode is off, I found that it does not<br>
work unless the primary node id is 0. It should have set<br>
query_context->where_to_send map for the primary node id but when the<br>
primary node id is not 0, the map was not set at all. This makes<br>
Pgpool-II believe that 0 th backend needs to be accessed. This lead to<br>
the error you are seeing.  Another error case I found was<br>
(incorrectly) reading from node 0, which leads to hang up. This is<br>
easy to reproduce.<br>
<br>
(1) create a two-node cluster using pgpool_setup<br>
<br>
(2) shutdown node 0 and recover node 1 (pcp_recovery_node 0). This<br>
makes node 0 to be standby, node 1 to be primary.<br>
<br>
(3) add followings to pgpool.conf and restart whole cluster.<br>
<br>
load_balance_mode = off<br>
backend_weight1 = 0<br>
<br>
(4) type "begin" from psql. It gets stuck.<br>
<br>
Attached is the patch against 4.5.1.<br></blockquote><div><br></div><div>Thanks for the quick fix! I've applied the patch and rescheduled a build. However, this will take some time and Easter is a national holiday in the Netherlands, so I probably won't be able to report back until Tuesday.</div><div><br></div><div>Best regards,</div><div>Emond </div></div></div>