[pgpool-general: 5681] Re: find_primary_node problem

Tatsuo Ishii ishii at sraoss.co.jp
Thu Aug 3 07:55:28 JST 2017


> 2017. 08. 02. 16:42 keltezéssel, Tatsuo Ishii írta:
>>>>>> Is it possible for you to enable debug log of Pgpool-II?
>>>>> Yes, I enable debug log, and I got:
>>>>> LOG:  find_primary_node: checking backend no 0
>>>>> LOG:  find_primary_node: checking backend no 1
>>>>> DEBUG:  pool_read: read 13 bytes from backend 0
>>>>> DEBUG:  authenticate kind = 5
>>>>> DEBUG:  pool_write: to backend: 0 kind:p
>>>>> DEBUG:  pool_read: read 318 bytes from backend 0
>>>>> DEBUG:  authenticate kind = 0
>>>>> DEBUG:  authenticate backend: key data received
>>>>> DEBUG:  authenticate backend: transaction state: I
>>>>> DEBUG:  do_query: extended:0 query:"SELECT pg_is_in_recovery()"
>>>>> DEBUG:  pool_write: to backend: 0 kind:Q
>>>>> DEBUG:  pool_read: read 75 bytes from backend 0
>>>>> DEBUG:  do_query: kind: 'T'
>>>>> DEBUG:  do_query: received ROW DESCRIPTION ('T')
>>>>> DEBUG:  do_query: row description: num_fileds: 1
>>>>> DEBUG:  do_query: kind: 'D'
>>>>> DEBUG:  do_query: received DATA ROW ('D')
>>>>> DEBUG:  do_query: kind: 'C'
>>>>> DEBUG:  do_query: received COMMAND COMPLETE ('C')
>>>>> DEBUG:  do_query: kind: 'Z'
>>>>> DEBUG:  do_query: received READY FOR QUERY ('Z')
>>>>> DEBUG:  pool_write: to backend: 0 kind:X
>>>>> DEBUG:  find_primary_node: 1 node is standby
>>>>> DEBUG:  find_primary_node: no primary node found
>>>>>
>>>>> Manually I can connect from each pgpool host to each postgresql
>>>>> instance, and I can run this query: SELECT pg_is_in_recovery()
>>>>> On the primary node I got:
>>>>> pg_is_in_recovery
>>>>> -------------------
>>>>>  f
>>>>> (1 row)
>>>>>
>>>>> and on the secondary:
>>>>>  pg_is_in_recovery
>>>>> -------------------
>>>>>  t
>>>>> (1 row)
>>>> Pgpool-II version?
>>> ii  pgpool2                          3.6.5-1.pgdg16.04+1
>>> ii  postgresql-9.6-pgpool2           3.6.5-1.pgdg16.04+1
>> Ok, it seems Pgpool-II looks at a stale status file. (it's
>> $logdir/pgpool_status, where $logdir is the "logdir" value specified
>> in pgpool.conf).
>>
>> You could remove the file before restarting Pgpool-II and see if the
>> problem goes away.
> If I remove the file only on primary server, and restart pgpool2, I got
> the same error, but if I stop both servers and I remove pgpool_status
> from both, and I start pgpool, I don't got the error, pgpool2 starts fine.
> Thanks.
> 
> But how did you know, that this was cause the error?

Because after this

>>>>> LOG:  find_primary_node: checking backend no 0

No access to backend is logged, instead move to check backend 1. That
means Pgpool-II skipped checking against backend 0 because it thinks
node 0 is down. The only reason for this is node 0 status was marked
as down in the status file.

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp


More information about the pgpool-general mailing list