Re: Proposal: two new role attributes and/or capabilities?

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Proposal: two new role attributes and/or capabilities?
Дата
Msg-id CA+TgmoZz8TbuSy2KfLFhLpxwUP=K=JDwTa7rLSJAnTivZNPr1A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Proposal: two new role attributes and/or capabilities?  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Ответы Re: Proposal: two new role attributes and/or capabilities?  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Список pgsql-hackers
On Thu, Jan 29, 2015 at 4:09 PM, Jim Nasby <Jim.Nasby@bluetreble.com> wrote:
>> The difference between the autovacuum-run vacuum and the cron-run vacuum
>> is that the one running out of cron will just keep holding the lock
>> until it's actually able to truncate the end of the relation, no?  I
>> recall discussion previously that we need a way to either support that
>> in autovacuum for (a configurable set of) regular relations or come up
>> with a solution that doesn't require that lock.
>
> AFAICT, in master, there is no difference in truncation between auto and
> manual vacuum. What we do is attempt to acquire the truncation lock for up
> to 5 seconds, giving up after that. Once we do have the lock, we check to
> see how many pages we can actually truncate. During that check, we test
> every ~20ms or so to see if someone else is waiting on our exclusive lock;
> if they are we stop counting and will only truncate the relation up to that
> point.

I don't think this is true, and I don't think it's been true for a
long time, if ever.  The difference between a manual vacuum and
autovacuum is that autovacuum commits suicide when it conflicts with
somebody else's lock request, and a manual vacuum doesn't.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: jsonb, unicode escapes and escaped backslashes
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Fix column-privilege leak in error-message paths