Re: Strange decreasing value of pg_last_wal_receive_lsn()

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Strange decreasing value of pg_last_wal_receive_lsn()
Дата
Msg-id 20200511065402.GD88791@paquier.xyz
обсуждение исходный текст
Ответ на Re: Strange decreasing value of pg_last_wal_receive_lsn()  (godjan • <g0dj4n@gmail.com>)
Ответы Re: Strange decreasing value of pg_last_wal_receive_lsn()  (Jehan-Guillaume de Rorthais <jgdr@dalibo.com>)
Список pgsql-hackers
On Sun, May 10, 2020 at 06:58:50PM +0500, godjan • wrote:
> synchronous_standby_names=ANY 1(host1, host2)
> synchronous_commit=on

Thanks for the details.  I was not sure based on your previous
messages.

> So to understand which standby wrote last data to disk I should know
> receive_lsn or write_lsn.

If you have just an access to the standbys, using
pg_last_wal_replay_lsn() should be enough, no?  One tricky point is to
make sure that each standby does not have more WAL to replay, though
you can do that by looking at the wait event called
RecoveryRetrieveRetryInterval for the startup process.
Note that when a standby starts and has primary_conninfo set, it would
request streaming to start again at the beginning of the segment as
mentioned, but it does not change the point up to which the startup
process replays the WAL available locally, as that's what takes
priority as WAL source (second choice is a WAL archive and third is
streaming if all options are set in the recovery configuration).

There are several HA solutions floating around in the community, and I
got to wonder as well if some of them don't just scan the local
pg_wal/ of each standby in this case, even if that's more simple to
let the nodes start and replay up to their latest point available.
--
Michael

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tatsuro Yamada
Дата:
Сообщение: Re: PG 13 release notes, first draft
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Problem with logical replication