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

Commit7d88bb7

Browse files
committed
Add some temporary instrumentation to pgstat.c.
Log main-loop blocking events and the results of inquiry messages.This is to get some clarity as to what's happening on those Windowsbuildfarm members that still don't like the latch-ified stats collector.This bulks up the postmaster log a tad, so I won't leave it in place forlong.
1 parentb834713 commit7d88bb7

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

‎src/backend/postmaster/pgstat.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3107,7 +3107,12 @@ PgstatCollectorMain(int argc, char *argv[])
31073107
* satisfied by existing file.
31083108
*/
31093109
if (last_statwrite<last_statrequest)
3110+
{
3111+
elog(LOG,"pgstat: writing new stats file");
31103112
pgstat_write_statsfile(false);
3113+
}
3114+
3115+
elog(LOG,"pgstat: attempting recv()");
31113116

31123117
/*
31133118
* Try to receive and process a message. This will not block,
@@ -3124,6 +3129,9 @@ PgstatCollectorMain(int argc, char *argv[])
31243129
errmsg("could not read statistics message: %m")));
31253130
}
31263131

3132+
elog(LOG,"pgstat: received msg type %d len %d",
3133+
msg.msg_hdr.m_type,len);
3134+
31273135
/*
31283136
* We ignore messages that are smaller than our common header
31293137
*/
@@ -3218,12 +3226,16 @@ PgstatCollectorMain(int argc, char *argv[])
32183226
}
32193227
}/* end of inner message-processing loop */
32203228

3229+
elog(LOG,"pgstat: waiting");
3230+
32213231
/* Sleep until there's something to do */
32223232
wr=WaitLatchOrSocket(&pgStatLatch,
32233233
WL_LATCH_SET |WL_POSTMASTER_DEATH |WL_SOCKET_READABLE,
32243234
pgStatSock,
32253235
-1L);
32263236

3237+
elog(LOG,"pgstat: wait result 0x%x",wr);
3238+
32273239
/*
32283240
* Emergency bailout if postmaster has died. This is to avoid the
32293241
* necessity for manual cleanup of all postmaster children.
@@ -4006,7 +4018,15 @@ static void
40064018
pgstat_recv_inquiry(PgStat_MsgInquiry*msg,intlen)
40074019
{
40084020
if (msg->inquiry_time>last_statrequest)
4021+
{
40094022
last_statrequest=msg->inquiry_time;
4023+
if (last_statwrite<last_statrequest)
4024+
elog(LOG,"pgstat: received new inquiry message");
4025+
else
4026+
elog(LOG,"pgstat: received stale inquiry message");
4027+
}
4028+
else
4029+
elog(LOG,"pgstat: received out-of-order inquiry message");
40104030
}
40114031

40124032

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp