aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2020-01-08 14:33:49 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2020-01-08 14:33:49 -0300
commitaf43581e8b297b2527e0b1716b616b7ea1fc496f (patch)
treeda6994e3166f7b3881dc274bc007d05a27f9be2e /src/backend/utils
parent789bc293b3419cd4437dc6a7e99ec47882f91d04 (diff)
downloadpostgresql-af43581e8b297b2527e0b1716b616b7ea1fc496f.tar.gz
postgresql-af43581e8b297b2527e0b1716b616b7ea1fc496f.zip
Reimplement nullification of walsender timestamp
Make the value null only at pg_stat_activity-output time, as suggested by Tom Lane, instead of messing with the internal state. This should appease buildfarm members with force_parallel_mode=regress, which are running parallel queries on logical replication walsenders. The fact that walsenders can run parallel queries should perhaps be studied more carefully, but for the moment let's get rid of the red blots in buildfarm. Backpatch to pg10, like the previous commit. Discussion: https://postgr.es/m/30804.1578438763@sss.pgh.pa.us
Diffstat (limited to 'src/backend/utils')
-rw-r--r--src/backend/utils/adt/pgstatfuncs.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/utils/adt/pgstatfuncs.c b/src/backend/utils/adt/pgstatfuncs.c
index e95e3471846..02ab6433f94 100644
--- a/src/backend/utils/adt/pgstatfuncs.c
+++ b/src/backend/utils/adt/pgstatfuncs.c
@@ -736,7 +736,13 @@ pg_stat_get_activity(PG_FUNCTION_ARGS)
else
nulls[7] = true;
- if (beentry->st_xact_start_timestamp != 0)
+ /*
+ * Don't expose transaction time for walsenders; it confuses
+ * monitoring, particularly because we don't keep the time up-to-
+ * date.
+ */
+ if (beentry->st_xact_start_timestamp != 0 &&
+ beentry->st_backendType != B_WAL_SENDER)
values[8] = TimestampTzGetDatum(beentry->st_xact_start_timestamp);
else
nulls[8] = true;