Re: Poorly thought out code in vacuum - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Poorly thought out code in vacuum
Date
Msg-id CA+U5nMLjPGe0J1e8P_8aQxQFjViyYk_7andy2Ot_sBcgrT544g@mail.gmail.com
Whole thread Raw
In response to Poorly thought out code in vacuum  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, Jan 6, 2012 at 12:37 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> We could fix the direct symptom by inserting UnlockReleaseBuffer()
> in front of the continue, but AFAICS that just makes this into a
> busy-waiting equivalent of waiting unconditionally, so I don't really
> see why we should not revert the above fragment altogether.  However,
> I suppose Robert had something more intelligent in mind than a tight
> loop when the buffer can't be exclusively locked, so maybe there is
> some other change that should be made here instead.

Skipping the block completely isn't feasible. The only options are to
wait or to do out of order cleaning.

The conditional behaviour in vacuum_scan_heap() is much more important
that it is here, so just waiting for the lock wouldn't be too bad. Out
of order cleaning could be very expensive in terms of I/O and could
make that less robust. So I'd say lets just wait normally for the
lock.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


pgsql-hackers by date:

Previous
From: Alex Hunsaker
Date:
Subject: Re: [COMMITTERS] pgsql: Fix breakage from earlier plperl fix.
Next
From: Simon Riggs
Date:
Subject: Re: CLOG contention