standby apply lag on inactive servers

Поиск
Список
Период
Сортировка
Искать
От
Alvaro Herrera
Тема
standby apply lag on inactive servers
Дата
Msg-id
20200110140828.GA6228@alvherre.pgsql
Список
Дерево обсуждения
standby apply lag on inactive servers Alvaro Herrera <alvherre@2ndquadrant.com>
Re: standby apply lag on inactive servers Alvaro Herrera <alvherre@2ndquadrant.com>
Re: standby apply lag on inactive servers Alvaro Herrera <alvherre@2ndquadrant.com>
Re: standby apply lag on inactive servers Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: standby apply lag on inactive servers Alvaro Herrera <alvherre@2ndquadrant.com>
Re: standby apply lag on inactive servers Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: standby apply lag on inactive servers Alvaro Herrera <alvherre@2ndquadrant.com>
Re: standby apply lag on inactive servers Alvaro Herrera <alvherre@2ndquadrant.com>
Re: standby apply lag on inactive servers Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: standby apply lag on inactive servers Alvaro Herrera <alvherre@2ndquadrant.com>
Re: standby apply lag on inactive servers Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: standby apply lag on inactive servers Fujii Masao <masao.fujii@oss.nttdata.com>
Re: standby apply lag on inactive servers Alvaro Herrera <alvherre@2ndquadrant.com>
Re: standby apply lag on inactive servers Fujii Masao <masao.fujii@oss.nttdata.com>
Re: standby apply lag on inactive servers Alvaro Herrera <alvherre@2ndquadrant.com>
Re: standby apply lag on inactive servers Fujii Masao <masao.fujii@oss.nttdata.com>
Re: standby apply lag on inactive servers Alvaro Herrera <alvherre@2ndquadrant.com>
Re: standby apply lag on inactive servers Kyotaro Horiguchi <horikyota.ntt@gmail.com>
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
Дата:
От: Tom Lane
Дата:
FAQ