Re: [PATCHES] vacuum as flags in PGPROC

2007-10-25 Thread Alvaro Herrera
Alvaro Herrera wrote: > Hmm, now it's misbehaving strangely. Nevermind, I think I see what's happening. -- Alvaro Herrerahttp://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support ---(end of broadca

Re: [PATCHES] vacuum as flags in PGPROC

2007-10-25 Thread Alvaro Herrera
Tom Lane wrote: > Alvaro Herrera <[EMAIL PROTECTED]> writes: > > Also, I forgot to mention it on the first email, but this patch adds > > errcontext() lines when an autovacuum/analyze is being aborted. It > > works fine, but I'm not seeing code anywhere else that does something > > like this. > >

Re: [PATCHES] vacuum as flags in PGPROC

2007-10-24 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > Also, I forgot to mention it on the first email, but this patch adds > errcontext() lines when an autovacuum/analyze is being aborted. It > works fine, but I'm not seeing code anywhere else that does something > like this. This is a little bit scary be

Re: [PATCHES] vacuum as flags in PGPROC

2007-10-24 Thread Heikki Linnakangas
Tom Lane wrote: > Heikki Linnakangas <[EMAIL PROTECTED]> writes: >> Alvaro Herrera wrote: >>> I did it that way (i.e. added locking) and then realized that it >>> shouldn't really be a problem, because the only one who can be setting >>> vacuum flags is the process itself. Other processes can only

Re: [PATCHES] vacuum as flags in PGPROC

2007-10-24 Thread Tom Lane
Heikki Linnakangas <[EMAIL PROTECTED]> writes: > Alvaro Herrera wrote: >> I did it that way (i.e. added locking) and then realized that it >> shouldn't really be a problem, because the only one who can be setting >> vacuum flags is the process itself. Other processes can only read the >> flags. >

Re: [PATCHES] vacuum as flags in PGPROC

2007-10-24 Thread Alvaro Herrera
Heikki Linnakangas wrote: > Alvaro Herrera wrote: > > I did it that way (i.e. added locking) and then realized that it > > shouldn't really be a problem, because the only one who can be setting > > vacuum flags is the process itself. Other processes can only read the > > flags. > > It would still

Re: [PATCHES] vacuum as flags in PGPROC

2007-10-24 Thread Heikki Linnakangas
Alvaro Herrera wrote: > I did it that way (i.e. added locking) and then realized that it > shouldn't really be a problem, because the only one who can be setting > vacuum flags is the process itself. Other processes can only read the > flags. It would still be a problem if there was any other fie

Re: [PATCHES] vacuum as flags in PGPROC

2007-10-24 Thread Alvaro Herrera
Tom Lane wrote: > Alvaro Herrera <[EMAIL PROTECTED]> writes: > > I'm wondering if it's safe to do something like > > MyProc->vacuumFlags |= PROC_FOR_XID_WRAPAROUND > > without holding the ProcArrayLock. > > This seems a bit itchy. > > One thing I'd be worried about is processors that implement th

Re: [PATCHES] vacuum as flags in PGPROC

2007-10-24 Thread Alvaro Herrera
Tom Lane wrote: > Alvaro Herrera <[EMAIL PROTECTED]> writes: > > In the spirit of incremental improvement, here is a patch that turns the > > couple of bools in PGPROC into a bitmask, and associated fallout. > > Maybe declare the field as uint8 instead of char? Otherwise, +1. I'm wondering if it

Re: [PATCHES] vacuum as flags in PGPROC

2007-10-24 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > I'm wondering if it's safe to do something like > MyProc->vacuumFlags |= PROC_FOR_XID_WRAPAROUND > without holding the ProcArrayLock. This seems a bit itchy. One thing I'd be worried about is processors that implement that by fetching the whole word co

Re: [PATCHES] vacuum as flags in PGPROC

2007-10-23 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > In the spirit of incremental improvement, here is a patch that turns the > couple of bools in PGPROC into a bitmask, and associated fallout. Maybe declare the field as uint8 instead of char? Otherwise, +1. > This patch also contains a change to make a