* 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,
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
*/
}
} /* 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.
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");
}