Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitaf43581

Browse files
committed
Reimplement nullification of walsender timestamp
Make the value null only at pg_stat_activity-output time, as suggestedby Tom Lane, instead of messing with the internal state. This shouldappease buildfarm members with force_parallel_mode=regress, which arerunning parallel queries on logical replication walsenders.The fact that walsenders can run parallel queries should perhaps bestudied more carefully, but for the moment let's get rid of the redblots in buildfarm.Backpatch to pg10, like the previous commit.Discussion:https://postgr.es/m/30804.1578438763@sss.pgh.pa.us
1 parent789bc29 commitaf43581

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

‎src/backend/access/transam/xact.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -750,13 +750,6 @@ GetCurrentTransactionStopTimestamp(void)
750750
void
751751
SetCurrentStatementStartTimestamp(void)
752752
{
753-
/*
754-
* Skip if on a walsender; this is not needed, and it confuses monitoring
755-
* if we publish non-NULL values.
756-
*/
757-
if (am_walsender)
758-
return;
759-
760753
if (!IsParallelWorker())
761754
stmtStartTimestamp=GetCurrentTimestamp();
762755
else

‎src/backend/utils/adt/pgstatfuncs.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,13 @@ pg_stat_get_activity(PG_FUNCTION_ARGS)
736736
else
737737
nulls[7]= true;
738738

739-
if (beentry->st_xact_start_timestamp!=0)
739+
/*
740+
* Don't expose transaction time for walsenders; it confuses
741+
* monitoring, particularly because we don't keep the time up-to-
742+
* date.
743+
*/
744+
if (beentry->st_xact_start_timestamp!=0&&
745+
beentry->st_backendType!=B_WAL_SENDER)
740746
values[8]=TimestampTzGetDatum(beentry->st_xact_start_timestamp);
741747
else
742748
nulls[8]= true;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp