Re: xact_start for walsender & logical decoding not updated

Поиск
Список
Период
Сортировка
От Kyotaro Horiguchi
Тема Re: xact_start for walsender & logical decoding not updated
Дата
Msg-id 20191210.094217.2248726849034272968.horikyota.ntt@gmail.com
обсуждение исходный текст
Ответ на xact_start for walsender & logical decoding not updated  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Ответы Re: xact_start for walsender & logical decoding not updated  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Список pgsql-hackers
At Tue, 10 Dec 2019 00:44:09 +0100, Tomas Vondra <tomas.vondra@2ndquadrant.com> wrote in 
> Hi,
> 
> I think there's a minor bug in pg_stat_activity tracking of walsender
> processes. The issue is that xact_start is only updated at the very
> beginning when the walsender starts (so it's almost exactly equal to
> backend_start) and then just flips between NULL and that value.
> 
> Reproducing this is trivial - just create a publication/subscription
> with the built-in logical replication, and run arbitrary workload.
> You'll see that the xact_start value never changes.
> 
> I think the right fix is calling SetCurrentStatementStartTimestamp()
> right before StartTransactionCommand() in ReorderBufferCommit, per the
> attached patch.

I'm not sure how much xact_start for walsender is useful and we really
is not running a statement there.  Also autovac launcher starts
transaction without a valid statement timestamp perhaps for the same
reason.

However, if we want to show something meaningful there, I think
commit_time might be more informative there.  If we use
GetCurrentTimestamp(), StartTransaction() already has the same feature
for autonomous transactions. I suppose we should do them a unified
way.

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



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

Предыдущее
От: Daniel Gustafsson
Дата:
Сообщение: Re: global / super barriers (for checksums)
Следующее
От: Mark Dilger
Дата:
Сообщение: Re: Using multiple extended statistics for estimates