diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2012-05-13 21:11:31 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2012-05-13 21:11:31 -0400 |
commit | 7d88bb73f755f7fb5d847ef2319c21076054fb0e (patch) | |
tree | bafb7fe13f00fe7eaa1c6577d0f3b6b00c6f5b23 /src | |
parent | b8347138e94c4e712334508c460cbe0062d21e70 (diff) |
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 Windows
buildfarm 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 for
long.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/postmaster/pgstat.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c index 01273e19340..cb437770830 100644 --- a/src/backend/postmaster/pgstat.c +++ b/src/backend/postmaster/pgstat.c @@ -3107,7 +3107,12 @@ PgstatCollectorMain(int argc, char *argv[]) * satisfied by existing file. */ if (last_statwrite < last_statrequest) + { + elog(LOG, "pgstat: writing new stats file"); pgstat_write_statsfile(false); + } + + elog(LOG, "pgstat: attempting recv()"); /* * Try to receive and process a message. This will not block, @@ -3124,6 +3129,9 @@ PgstatCollectorMain(int argc, char *argv[]) errmsg("could not read statistics message: %m"))); } + elog(LOG, "pgstat: received msg type %d len %d", + msg.msg_hdr.m_type, len); + /* * We ignore messages that are smaller than our common header */ @@ -3218,12 +3226,16 @@ PgstatCollectorMain(int argc, char *argv[]) } } /* end of inner message-processing loop */ + elog(LOG, "pgstat: waiting"); + /* Sleep until there's something to do */ wr = WaitLatchOrSocket(&pgStatLatch, WL_LATCH_SET | WL_POSTMASTER_DEATH | WL_SOCKET_READABLE, pgStatSock, -1L); + elog(LOG, "pgstat: wait result 0x%x", wr); + /* * Emergency bailout if postmaster has died. This is to avoid the * necessity for manual cleanup of all postmaster children. @@ -4006,7 +4018,15 @@ static void pgstat_recv_inquiry(PgStat_MsgInquiry *msg, int len) { if (msg->inquiry_time > last_statrequest) + { last_statrequest = msg->inquiry_time; + if (last_statwrite < last_statrequest) + elog(LOG, "pgstat: received new inquiry message"); + else + elog(LOG, "pgstat: received stale inquiry message"); + } + else + elog(LOG, "pgstat: received out-of-order inquiry message"); } |