Re: autovauum integration patch: Attempt #4

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Matthew T(dot) O'Connor" <matthew(at)zeut(dot)net>
Cc: PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Subject: Re: autovauum integration patch: Attempt #4
Date: 2004-08-03 14:50:33
Message-ID: 22965.1091544633@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

"Matthew T. O'Connor" <matthew(at)zeut(dot)net> writes:
> I agree. The thought had crossed my mind that autovac should shut down
> first, but I'm really not sure how to make that happen.

You have to issue the kill() when the postmaster first receives the
shutdown signal, rather than waiting till after all backends exit.
Also, there needs to be some provision for sending a SIGINT to whichever
backend is actually running an autovac-commanded vacuum. One way to do
this is for autovac, when it gets the SIGUSR2, to turn around and do
PQqueryCancel (sp?) against the active connection. I'm not sure offhand
how to shoehorn that into your code.

> Right, I didn't want to use GUC vars for this. As I said in the other
> email, I will take a whack at using a new special .autovacpasswd file in
> the $PGDATA dir.

I'd go with autovac.parms or some such. $PGDATA isn't anyone's home dir
(normally) and there's no need to tuck config files out of sight.

> BTW, is this really something that needs to get solved? It could just
> be considered a limitation of the 7.5 implementation that it requires
> local trust or ident authentication.

On platforms with no local ident support, that would equate to making
autovac unusable. I think it's a must-fix.

> I looked into changing my elog calls to ereport, but I thought it wasn't
> necessary since ordinary users won't see these messages, they will only
> be in the postmaster log file.

DBAs are ordinary users in this context. I think elog is okay for stuff
that only a developer would ever see, but DBAs want translated messages.

> Ok, some of this cruft is related to its roots as a stand-alone app. I
> will fix this too. So the correct answer here is to skip the
> elog/ereport and call proc_exit(), or should I just downgrade the elog
> to NOTICE and then call proc_exit()? Lemme know and I'll fix.

Actually what I was thinking of was removing the sigsetjmp block (which
would need updated anyway if you keep it). That would cause elog(ERROR)
to go to proc_exit itself. You cannot avoid the issue by not using
elog(ERROR), because you are (or will be) calling subroutines that might
use it.

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Matthew T. O'Connor 2004-08-03 15:20:07 Re: autovauum integration patch: Attempt #4
Previous Message Tom Lane 2004-08-03 14:28:42 Re: psql latex bugfixes