xact_start for walsender & logical decoding not updated
Tomas Vondra <tomas.vondra@2ndquadrant.com>
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: pgsql-hackers@postgresql.org
Date: 2019-12-09T23:44:09Z
Lists: pgsql-hackers
Attachments
- reorderbuffer-timestamp-fix.patch (text/plain) patch
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. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Reimplement nullification of walsender timestamp
- f5d28710c707 13.0 landed
- da42b9f3ff43 10.12 landed
- af43581e8b29 11.7 landed
- 20c4df8c8d7c 12.2 landed
-
pg_stat_activity: show NULL stmt start time for walsenders
- 8de3b68faffc 10.12 landed
- fce9ba8192b4 12.2 landed
- b175bd59fa54 13.0 landed
- 896db774e5b0 11.7 landed