8000 Adjust "pgstat wait timeout" message to be a translatable LOG message. · garyhuntddn/postgres@19794e9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 19794e9

Browse files
committed
Adjust "pgstat wait timeout" message to be a translatable LOG message.
Per discussion, change the log level of this message to be LOG not WARNING. The main point of this change is to avoid causing buildfarm run failures when the stats collector is exceptionally slow to respond, which it not infrequently is on some of the smaller/slower buildfarm members. This change does lose notice to an interactive user when his stats query is looking at out-of-date stats, but the majority opinion (not necessarily that of yours truly) is that WARNING messages would probably not get noticed anyway on heavily loaded production systems. A LOG message at least ensures that the problem is recorded somewhere where bulk auditing for the issue is possible. Also, instead of an untranslated "pgstat wait timeout" message, provide a translatable and hopefully more understandable message "using stale statistics instead of current ones because stats collector is not responding". The original text was written hastily under the assumption that it would never really happen in practice, which we now know to be unduly optimistic. Back-patch to all active branches, since we've seen the buildfarm issue in all branches.
1 parent 509da59 commit 19794e9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/backend/postmaster/pgstat.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3307,7 +3307,7 @@ PgstatCollectorMain(int argc, char *argv[])
33073307
* first water, but until somebody wants to debug exactly what's
33083308
* happening there, this is the best we can do. The two-second
33093309
* timeout matches our pre-9.2 behavior, and needs to be short enough
3310-
* to not provoke "pgstat wait timeout" complaints from
3310+
* to not provoke "using stale statistics" complaints from
33113311
* backend_read_statsfile.
33123312
*/
33133313
wr = WaitLatchOrSocket(&pgStatLatch,
@@ -4354,7 +4354,9 @@ backend_read_statsfile(void)
43544354
}
43554355

43564356
if (count >= PGSTAT_POLL_LOOP_COUNT)
4357-
elog(WARNING, "pgstat wait timeout");
4357+
ereport(LOG,
4358+
(errmsg("using stale statistics instead of current ones "
4359+
"because stats collector is not responding")));
43584360

43594361
/*
43604362
* Autovacuum launcher wants stats about all databases, but a shallow read

0 commit comments

Comments
 (0)
0