Change pg_last_xlog_receive_location not to move backwards - Mailing list pgsql-hackers

From Fujii Masao
Subject Change pg_last_xlog_receive_location not to move backwards
Date
Msg-id AANLkTimW014iye8xxYyco2_nc-DPcz5kgrhTdtfyCDpO@mail.gmail.com
Whole thread Raw
Responses Re: Change pg_last_xlog_receive_location not to move backwards  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
Hi,

In the case where there are multiple standbys, when a failover
happens, we usually calculate most advanced standby by using
pg_last_xlog_receive_location or pg_last_xlog_replay_location,
and promote it to new master. The problem is that neither
function might return the right last location of WAL available in
the standby. So we cannot use them to check which standby
is most ahead.

Since pg_last_xlog_receive_location moves backwards when
the standby attempts to reconnect to the primary, it might fall
behind the last location of WAL available. OTOH,
pg_last_xlog_replay_location might also fall behind because
of Hot Standby query conflict.

So I'm thinking to change pg_last_xlog_receive_location not to
move backwards. There is no need to move it backwards when
the standby reconnects to the primary. So we can do that.

BTW, the related discussion was done before:
http://archives.postgresql.org/pgsql-hackers/2010-06/msg00576.php

Regards,

-- 
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: Error code for "terminating connection due to conflict with recovery"
Next
From: Anthony Gentile
Date:
Subject: N-grams