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

Commit896db77

Browse files
committed
pg_stat_activity: show NULL stmt start time for walsenders
Returning a non-NULL time is pointless, sinc a walsender is not aprocess that would be running normal transactions anyway, but the codewas unintentionally exposing the process start time intermittently,which was not only bogus but it also confused monitoring systems lookingfor idle transactions. Fix by avoiding all updates in walsenders.Backpatch to 11, where walsenders started appearing in pg_stat_activity.Reported-by: Tomas VondraDiscussion:https://postgr.es/m/20191209234409.exe7osmyalwkt5j4@development
1 parent7474393 commit896db77

File tree

1 file changed

+7
-0
lines changed
  • src/backend/access/transam

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,13 @@ 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+
753760
if (!IsParallelWorker())
754761
stmtStartTimestamp=GetCurrentTimestamp();
755762
else

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp