Re: Fix lag columns in pg_stat_replication not advancing when replay LSN stalls

Поиск
Список
Период
Сортировка
От Fujii Masao
Тема Re: Fix lag columns in pg_stat_replication not advancing when replay LSN stalls
Дата
Msg-id CAHGQGwE26-Ei8iMr-O2ABGs4mW=XC9f_90CVf5oLv-mNJ3BGOQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Fix lag columns in pg_stat_replication not advancing when replay LSN stalls  (Shinya Kato <shinya11.kato@gmail.com>)
Ответы Re: Fix lag columns in pg_stat_replication not advancing when replay LSN stalls
Список pgsql-hackers
On Sun, Oct 19, 2025 at 2:04 AM Shinya Kato <shinya11.kato@gmail.com> wrote:
> Thank you for the patch. I have one comment.
>
> +       if (lag_tracker->overflowed[head].lsn > lsn)
> +           return now - lag_tracker->overflowed[head].time;
>
> Could this return a negative value if the clock somehow went
> backwards? The original code returns -1 in this case, so I'm curious
> about this.

Thanks for the review!

Yes, you're right. So I've updated the patch so that -1 is returned
when the current time is earlier than the time in the overflow entry,
treating it as "no new sample found".

Regards,

--
Fujii Masao

Вложения

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