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