standby apply lag on inactive servers

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема standby apply lag on inactive servers
Дата
Msg-id 20200110140828.GA6228@alvherre.pgsql
обсуждение исходный текст
Ответы Re: standby apply lag on inactive servers
Список pgsql-hackers
A customer of ours complained that if you have an inactive primary,
monitoring the apply lag on a standby reports monotonically increasing
lag.  The reason for this is that the apply lag is only updated on
COMMIT records, which of course don't occur in inactive servers.
But CHECKPOINT records do occur, so the WAL insert pointer continues to
move forward, which is what causes the spurious lag.

(I think newer releases are protected from this problem because they
don't emit checkpoints during periods of inactivity.  I didn't verify
this.)

This patch fixes the problem by using the checkpoint timestamp to update
the lag tracker in the standby.  This requires a little change in where
this update is invoked, because previously it was done only for the XACT
rmgr; this makes the patch a little bigger than it should.

-- 
Álvaro Herrera                PostgreSQL Expert, https://www.2ndQuadrant.com/

Вложения

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: standby recovery fails (tablespace related) (tentative patch anddiscussion)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: our checks for read-only queries are not great