Skip site navigation (1) Skip section navigation (2)

Change pg_last_xlog_receive_location not to move backwards

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Change pg_last_xlog_receive_location not to move backwards
Date: 2011-01-13 07:24:31
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers

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:


Fujii Masao
NTT Open Source Software Center


pgsql-hackers by date

Next:From: Alex HunsakerDate: 2011-01-13 07:28:54
Subject: Re: arrays as pl/perl input arguments [PATCH]
Previous:From: Tatsuo IshiiDate: 2011-01-13 07:13:09
Subject: Re: Error code for "terminating connection due to conflict with recovery"

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group