Re: Proposal: Log inability to lock pages during vacuum

Поиск
Список
Период
Сортировка
От Jim Nasby
Тема Re: Proposal: Log inability to lock pages during vacuum
Дата
Msg-id 545BE049.4090500@BlueTreble.com
обсуждение исходный текст
Ответ на Re: Proposal: Log inability to lock pages during vacuum  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Ответы Re: Proposal: Log inability to lock pages during vacuum  (Andres Freund <andres@2ndquadrant.com>)
Список pgsql-hackers
On 10/29/14, 11:49 AM, Jim Nasby wrote:
> On 10/21/14, 6:05 PM, Tom Lane wrote:
>> Jim Nasby <Jim.Nasby@BlueTreble.com> writes:
>>> - What happens if we run out of space to remember skipped blocks?
>>
>> You forget some, and are no worse off than today.  (This might be an
>> event worthy of logging, if the array is large enough that we don't
>> expect it to happen often ...)
>
> Makes sense. I'll see if there's some reasonable way to retry pages when the array fills up.
>
> I'll make the array 2k in size; that allows for 512 pages without spending a bunch of memory.

Attached is a patch for this. It also adds logging of unobtainable cleanup locks, and refactors scanning a page for
vacuuminto it's own function. 

Anyone reviewing this might want to look at
https://github.com/decibel/postgres/commit/69ab22f703d577cbb3d8036e4e42563977bcf74b,which is the refactor with no
whitespacechanges. 

I've verified this works correctly by connecting to a backend with gdb and halting it with a page pinned. Both vacuum
andvacuum freeze on that table do what's expected, but I also get this waring (which AFAICT is a false positive): 

decibel@decina.local=# vacuum verbose i;
INFO:  vacuuming "public.i"
INFO:  "i": found 0 removable, 399774 nonremovable row versions in 1769 out of 1770 pages
DETAIL:  200000 dead row versions cannot be removed yet.
There were 0 unused item pointers.
0 pages are entirely empty.
Retried cleanup lock on 0 pages, retry failed on 1, skipped retry on 0.
CPU 0.00s/0.06u sec elapsed 12.89 sec.
WARNING:  buffer refcount leak: [105] (rel=base/16384/16385, blockNum=0, flags=0x106, refcount=2 1)
VACUUM

I am doing a simple static allocation of retry_pages[]; my understanding is that will only exist for the duration of
thisfunction so it's OK. If not I'll palloc it. If it is OK then I'll do the same for the freeze array. 
--
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com

Вложения

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Tweaking Foreign Keys for larger tables
Следующее
От: Tom Lane
Дата:
Сообщение: Re: json, jsonb, and casts