[pgpool-hackers: 4393] Re: Proposal: promoting standby which is most up to date to become the new Primary

Tatsuo Ishii ishii at sraoss.co.jp
Thu Aug 31 09:51:21 JST 2023


Hi,

> Ishii-san,
> 
> Thank you for your comments.
> 
>> (a) Track replication delay and keep it.
>> 
>> At the time when failover script gets called, apparently we cannot
>> collect replication delay information since the existing primary
>> already went down. Probably we have to save the last replication delay
>> information collected by streaming replication check process to
>> somewhere (probably to shared memory).
> 
> SR worker process checkes periodically the standby delay
> and save it as "BACKEND_INFO(i).standby_delay".
> I think we can use it, isn't it?

I am not sure. The standby_delay seems to be overwritten to 0 if query
to the old primary fails, which could happen by the time when the
failover command gets executed. I think it's safer to save the last
standby_delay (when the primary is healthy) to somewhere and use it in
the failover process.

Best reagards,
--
Tatsuo Ishii
SRA OSS LLC
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp


More information about the pgpool-hackers mailing list