Re: Cancel autovacuum conflicting with DROP TABLE

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Cancel autovacuum conflicting with DROP TABLE
Date: 2007-06-27 04:14:18
Message-ID: 20070627041418.GP11609@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

ITAGAKI Takahiro wrote:
> ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp> wrote:
>
> > Here is a patch that cancels autovacuum workers conflicting with
> > DROP TABLE, TRUNCATE and CLUSTER. It was discussed here:
> > http://archives.postgresql.org/pgsql-hackers/2007-06/msg00556.php
>
> I made an adjustment for the latest 'more autovacuum fixes' patch.
> http://archives.postgresql.org/pgsql-patches/2007-06/msg00217.php
>
> Now, autovacuum workers handles ProcDie signals using ERROR
> instead of FATAL. The exception is caught by the worker and
> converted to the following logs.
>
> SIGINT -- Cancel the current job.
> LOG: autovacuum on <db>.<schema>.<table> is canceled
> SIGTERM -- Cancel all jobs.
> LOG: autovacuum on <db> is canceled

Thanks for the patch. I think there are actually three patches in here:

1. changing SIGINT so that it cancels the current table instead of
shutting down the entire worker.

2. changing DROP TABLE and TRUNCATE so that they cancel an autovac
worker by sending SIGINT.

3. change the interrupt code so that autovac workers are terminated with
ERROR instead of FATAL, knowing that the final outcome is the same. If
I'm not mistaken the only point of the change is to be able to change
the error message, is that correct?

I don't feel very much comfortable with the patch (3). I would prefer
that we keep errcode FATAL and select a different error message in
ProcessInterrupts instead. I don't see the point in complicating the
sigjmp target without need.

I agree with the (2) change.

The change in (1) I don't feel comfortable with commenting. It seems
strange to me, and although it seems like it would be safe, I cannot
help having a strange feeling about it. I'll try to digest it a bit
more.

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

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Alvaro Herrera 2007-06-27 04:16:40 Re: psql: add volatility to \df+
Previous Message Neil Conway 2007-06-27 03:45:16 Re: psql: add volatility to \df+