pg_stat_replication lag fields return non-NULL values even with NULLLSNs

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема pg_stat_replication lag fields return non-NULL values even with NULLLSNs
Дата
Msg-id 20190717015144.GB2130@paquier.xyz
обсуждение исходный текст
Ответы Re: pg_stat_replication lag fields return non-NULL values even withNULL LSNs  (Thomas Munro <thomas.munro@gmail.com>)
Список pgsql-hackers
Hi all,
(Thomas in CC as per 6912acc0)

I got surprised by the following behavior from pg_stat_get_wal_senders
when connecting for example pg_receivewal to a primary:
=# select application_name, flush_lsn, replay_lsn, flush_lag,
replay_lag from pg_stat_replication;
 application_name | flush_lsn | replay_lsn |    flush_lag    |    replay_lag
------------------+-----------+------------+-----------------+-----------------
 receivewal       | null      | null       | 00:09:13.578185 | 00:09:13.578185
(1 row)

It makes little sense to me, as we are reporting a replay lag on a
position which has never been reported yet, so it cannot actually be
used as a comparison base for the lag.  Am I missing something or
should we return NULL for those fields if we have no write, flush or
apply LSNs like in the attached?

Thoughts?
--
Michael

Вложения

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

Предыдущее
От: Melanie Plageman
Дата:
Сообщение: Re: Extracting only the columns needed for a query
Следующее
От: Andres Freund
Дата:
Сообщение: Re: buildfarm's typedefs list has gone completely nutso