Re: Poorly thought out code in vacuum

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: Poorly thought out code in vacuum
Дата
Msg-id CA+U5nMLjPGe0J1e8P_8aQxQFjViyYk_7andy2Ot_sBcgrT544g@mail.gmail.com
обсуждение исходный текст
Ответ на Poorly thought out code in vacuum  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Alex Hunsaker
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Fix breakage from earlier plperl fix.
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: CLOG contention