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

Commit99b5454

Browse files
committed
Remove debug logging for pgstat wait timeout.
This reverts commit79b2ee2, which provedto not be very informative; it looks like the "pgstat wait timeout"warnings in the buildfarm are just a symptom of running on heavily loadedmachines, and there isn't any weird mechanism causing them to appear.To try to reduce the frequency of buildfarm failures from this effect,increase PGSTAT_MAX_WAIT_TIME from 5 seconds to 10.Also, arrange to not send a fresh inquiry message every single time throughthe loop, as that seems more likely to cause problems (by swamping thecollector) than fix them. We'll now send an inquiry the first time throughthe delay loop, and every 640 msec thereafter.
1 parent86a3f2d commit99b5454

File tree

1 file changed

+11
-26
lines changed

1 file changed

+11
-26
lines changed

‎src/backend/postmaster/pgstat.c

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,15 @@
8080
#definePGSTAT_STAT_INTERVAL500/* Minimum time between stats file
8181
* updates; in milliseconds. */
8282

83-
#definePGSTAT_RETRY_DELAY10/* How long to wait betweenstatistics
84-
*update requests; in milliseconds. */
83+
#definePGSTAT_RETRY_DELAY10/* How long to wait betweenchecks for
84+
*a new file; in milliseconds. */
8585

86-
#definePGSTAT_MAX_WAIT_TIME5000/* Maximum time to wait for a stats
86+
#definePGSTAT_MAX_WAIT_TIME10000/* Maximum time to wait for a stats
8787
* file update; in milliseconds. */
8888

89+
#definePGSTAT_INQ_INTERVAL640/* How often to ping the collector for
90+
* a new file; in milliseconds. */
91+
8992
#definePGSTAT_RESTART_INTERVAL 60/* How often to attempt to restart a
9093
* failed statistics collector; in
9194
* seconds. */
@@ -94,6 +97,7 @@
9497
* death; in seconds. */
9598

9699
#definePGSTAT_POLL_LOOP_COUNT(PGSTAT_MAX_WAIT_TIME / PGSTAT_RETRY_DELAY)
100+
#definePGSTAT_INQ_LOOP_COUNT(PGSTAT_INQ_INTERVAL / PGSTAT_RETRY_DELAY)
97101

98102

99103
/* ----------
@@ -3758,7 +3762,6 @@ backend_read_statsfile(void)
37583762
TimestampTzcur_ts;
37593763
TimestampTzmin_ts;
37603764
intcount;
3761-
intlast_delay_errno=0;
37623765

37633766
/* already read it? */
37643767
if (pgStatDBHash)
@@ -3788,7 +3791,7 @@ backend_read_statsfile(void)
37883791
/*
37893792
* Loop until fresh enough stats file is available or we ran out of time.
37903793
* The stats inquiry message is sent repeatedly in case collector drops
3791-
* it.
3794+
* it; but not every single time, as that just swamps the collector.
37923795
*/
37933796
for (count=0;count<PGSTAT_POLL_LOOP_COUNT;count++)
37943797
{
@@ -3800,29 +3803,11 @@ backend_read_statsfile(void)
38003803
file_ts >=min_ts)
38013804
break;
38023805

3803-
/* Make debugging printouts once we've waited unreasonably long */
3804-
if (count >=PGSTAT_POLL_LOOP_COUNT/2)
3805-
{
3806-
TimestampTznow_ts=GetCurrentTimestamp();
3807-
3808-
#ifdefHAVE_INT64_TIMESTAMP
3809-
elog(WARNING,"pgstat waiting for "INT64_FORMAT" usec (%d loops), file timestamp "INT64_FORMAT" target timestamp "INT64_FORMAT" last errno %d",
3810-
now_ts-cur_ts,count,
3811-
file_ts,min_ts,
3812-
last_delay_errno);
3813-
#else
3814-
elog(WARNING,"pgstat waiting for %.6f sec (%d loops), file timestamp %.6f target timestamp %.6f last errno %d",
3815-
now_ts-cur_ts,count,
3816-
file_ts,min_ts,
3817-
last_delay_errno);
3818-
#endif
3819-
}
3820-
38213806
/* Not there or too old, so kick the collector and wait a bit */
3822-
errno=0;
3823-
pgstat_send_inquiry(min_ts);
3807+
if ((count %PGSTAT_INQ_LOOP_COUNT)==0)
3808+
pgstat_send_inquiry(min_ts);
3809+
38243810
pg_usleep(PGSTAT_RETRY_DELAY*1000L);
3825-
last_delay_errno=errno;
38263811
}
38273812

38283813
if (count >=PGSTAT_POLL_LOOP_COUNT)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp