Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 75b48e1

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 2d115e4 commit 75b48e1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/backend/postmaster/pgstat.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -3369,7 +3369,7 @@ PgstatCollectorMain(int argc, char *argv[])
33693369
* first water, but until somebody wants to debug exactly what's
33703370
* happening there, this is the best we can do. The two-second
33713371
* timeout matches our pre-9.2 behavior, and needs to be short enough
3372-
* to not provoke "pgstat wait timeout" complaints from
3372+
* to not provoke "using stale statistics" complaints from
33733373
* backend_read_statsfile.
33743374
*/
33753375
wr = WaitLatchOrSocket(MyLatch,
@@ -4442,7 +4442,9 @@ backend_read_statsfile(void)
44424442
}
44434443

44444444
if (count >= PGSTAT_POLL_LOOP_COUNT)
4445-
elog(WARNING, "pgstat wait timeout");
4445+
ereport(LOG,
4446+
(errmsg("using stale statistics instead of current ones "
4447+
"because stats collector is not responding")));
44464448

44474449
/*
44484450
* Autovacuum launcher wants stats about all databases, but a shallow read

0 commit comments

Comments
 (0)