[pgpool-general: 9059] Re: 0 th backend is not valid after upgrading to 4.5.1

Tatsuo Ishii ishii at sraoss.co.jp
Sun Mar 31 06:38:26 JST 2024


> Op za 30 mrt 2024 om 08:42 schreef Tatsuo Ishii <ishii at sraoss.co.jp>:
> 
>> > Op vr 29 mrt 2024 om 15:26 schreef Tatsuo Ishii <ishii at sraoss.co.jp>:
>> >
>> >> > Hi,
>> >> >
>> >> > After upgrading from 4.5.0 to 4.5.1 we see lots of regressions in our
>> >> > test-suite when failovers are involved with the following exception in
>> >> > WildFly:
>> >> > Caused by: org.postgresql.util.PSQLException: ERROR: unable to read
>> >> message
>> >> > kind from backend
>> >> >   Detail: 0 th backend is not valid
>> >> >
>> Ok. The commit you pointed out:
>> > is the change that is causing the problems:
>> >
>> https://github.com/pgpool/pgpool2/commit/a2a86804cb838b416f317cc083d521a5c691f2ec
>>
>> has a bug: when load_balance_mode is off, I found that it does not
>> work unless the primary node id is 0. It should have set
>> query_context->where_to_send map for the primary node id but when the
>> primary node id is not 0, the map was not set at all. This makes
>> Pgpool-II believe that 0 th backend needs to be accessed. This lead to
>> the error you are seeing.  Another error case I found was
>> (incorrectly) reading from node 0, which leads to hang up. This is
>> easy to reproduce.
>>
>> (1) create a two-node cluster using pgpool_setup
>>
>> (2) shutdown node 0 and recover node 1 (pcp_recovery_node 0). This
>> makes node 0 to be standby, node 1 to be primary.
>>
>> (3) add followings to pgpool.conf and restart whole cluster.
>>
>> load_balance_mode = off
>> backend_weight1 = 0
>>
>> (4) type "begin" from psql. It gets stuck.
>>
>> Attached is the patch against 4.5.1.
>>
> 
> 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.

Sure no problem. Have a nice day!
--
Tatsuo Ishii
SRA OSS LLC
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp



More information about the pgpool-general mailing list