Re: Isn't it better with "autovacuum worker...." instead of "worker took too long to start; canceled" specific to "auto

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
Cc: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Isn't it better with "autovacuum worker...." instead of "worker took too long to start; canceled" specific to "auto
Date: 2021-10-27 19:26:11
Message-ID: 20211027192611.GU31568@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Oct 27, 2021 at 07:05:10PM +0000, Bossart, Nathan wrote:
> On 10/27/21, 9:29 AM, "Bharath Rupireddy" <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
> > Is there a specific reason that we have a generic WARNING "worker took
> > too long to start; canceled" for an autovacuum worker? Isn't it better
> > with "autovacuum worker took too long to start; canceled"? It is
> > confusing to see the generic message in the server logs while
> > debugging an issue for a user who doesn't know the internals of
> > autovacuum code.
>
> It looks like it has been this way for a while [0]. I don't know if
> I've ever seen this message before, and from the comments near it, it
> sounds like it is expected to rarely happen.

I was surprised to see that I have only two logs for this in the last 8 weeks.

> > To be more informative about the message, how about the following:
>
> My vote is to just change it to
>
> ereport(WARNING,
> (errmsg("autovacuum worker took too long to start; canceled")));
>
> and call it a day. If we wanted to add errdetail(), I think we should
> make sure it is providing useful context, but I'm not sure what that
> might look like.

I think that's fine.

Note that the backend_type is illuminating for those who use CSV logs, or use
P13+ and log_line_prefix += %b (see 70a7b4776).

session_line | 1
error_severity | WARNING
message | worker took too long to start; canceled
backend_type | autovacuum launcher

--
Justin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marcos Pegoraro 2021-10-27 19:48:40 Modifying TOAST policy will not affect the way existing data is stored ?
Previous Message Bossart, Nathan 2021-10-27 19:05:10 Re: Isn't it better with "autovacuum worker...." instead of "worker took too long to start; canceled" specific to "auto