Thread: Vacuum cancels autovacuum error message confusing?

Vacuum cancels autovacuum error message confusing?

From
Josh Berkus
Date:
All:

NOTICE:  ALTER TABLE / ADD PRIMARY KEY will create implicit index
"pgbench_branches_pkey" for table "pgbench_branches"
NOTICE:  ALTER TABLE / ADD PRIMARY KEY will create implicit index
"pgbench_tellers_pkey" for table "pgbench_tellers"
NOTICE:  ALTER TABLE / ADD PRIMARY KEY will create implicit index
"pgbench_accounts_pkey" for table "pgbench_accounts"

vacuum...ERROR:  canceling autovacuum task
CONTEXT:  automatic analyze of table "bench.public.pgbench_accounts"
ERROR:  canceling autovacuum task
CONTEXT:  automatic analyze of table "bench.public.pgbench_accounts"
done.

What happened above is that the build of the new pgbench database
triggered an autovacuum, and then pgbench called a manual vacuum,
cancelling the autovacuum.

However, the error message which autovacuum gives does not indicate that
it was superceded by a manual vacuum, which could confuse users and make
them think there's some kind of actual vacuum failure.  Is it worth
fixing the error message?

--                                  -- Josh Berkus                                    PostgreSQL Experts Inc.
                        http://www.pgexperts.com
 


Re: Vacuum cancels autovacuum error message confusing?

From
Alvaro Herrera
Date:
Josh Berkus wrote:

> vacuum...ERROR:  canceling autovacuum task
> CONTEXT:  automatic analyze of table "bench.public.pgbench_accounts"
> ERROR:  canceling autovacuum task
> CONTEXT:  automatic analyze of table "bench.public.pgbench_accounts"
> done.
> 
> What happened above is that the build of the new pgbench database
> triggered an autovacuum, and then pgbench called a manual vacuum,
> cancelling the autovacuum.

Isn't this just because you ran the postmaster in the same terminal as
pgbench?

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


Re: Vacuum cancels autovacuum error message confusing?

From
Josh Berkus
Date:
> Isn't this just because you ran the postmaster in the same terminal as
> pgbench?

Right, but those messages appear in the logs as well.  I'm thinking of
the reaction of anyone reading the logs ... since they wouldn't, at that
time, know about a manual vacuum that happened.

--                                  -- Josh Berkus                                    PostgreSQL Experts Inc.
                        http://www.pgexperts.com
 


Re: Vacuum cancels autovacuum error message confusing?

From
Alvaro Herrera
Date:
Josh Berkus wrote:
> 
> > Isn't this just because you ran the postmaster in the same terminal as
> > pgbench?
> 
> Right, but those messages appear in the logs as well.  I'm thinking of
> the reaction of anyone reading the logs ... since they wouldn't, at that
> time, know about a manual vacuum that happened.

Eh?  I think they could examine pg_stat_user_tables to see the last
vacuum time of the table ... in fact, wouldn't one do exactly that
before reaching any conclusions about this error message?

Or are you saying that each and every VACUUM should emit a LOG message?
You know, so that the user knows that a vacuum happened, manual or
otherwise.

That said, I'm not wedded to that message wording; feel free to propose
something better.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


Re: Vacuum cancels autovacuum error message confusing?

From
Josh Berkus
Date:
> That said, I'm not wedded to that message wording; feel free to propose
> something better.

Yeah, I'm looking to see if we can determine the difference between an
autovac which was cancelled by vacuum and one which was cancelled for
another reason.

--                                  -- Josh Berkus                                    PostgreSQL Experts Inc.
                        http://www.pgexperts.com
 


Re: Vacuum cancels autovacuum error message confusing?

From
Tom Lane
Date:
Josh Berkus <josh@agliodbs.com> writes:
> vacuum...ERROR:  canceling autovacuum task
> CONTEXT:  automatic analyze of table "bench.public.pgbench_accounts"
> ERROR:  canceling autovacuum task
> CONTEXT:  automatic analyze of table "bench.public.pgbench_accounts"
> done.

> What happened above is that the build of the new pgbench database
> triggered an autovacuum, and then pgbench called a manual vacuum,
> cancelling the autovacuum.

> However, the error message which autovacuum gives does not indicate that
> it was superceded by a manual vacuum, which could confuse users and make
> them think there's some kind of actual vacuum failure.  Is it worth
> fixing the error message?

What's to fix?  The autovacuum was in fact canceled.  What would you
propose doing differently?
        regards, tom lane