Re: BUG #14941: Vacuum crashes

From: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
To: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, "lyes(dot)amd(at)gmail(dot)com" <lyes(dot)amd(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #14941: Vacuum crashes
Date: 2017-12-01 18:53:03
Message-ID: 1E4815BF-18D2-4184-989A-975728F59B88@amazon.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On 12/1/17, 11:16 AM, "Tomas Vondra" <tomas(dot)vondra(at)2ndquadrant(dot)com> wrote:
>> The behavior I would like to see is that the void ignores this table and
>> moves to another instead of being blocked.
>>
>
> I believe autovacuum should not block waiting for a heavy-weight lock on
> a table since this commit that went into 9.1:
>
> https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=32896c40ca766146312b28a5a0eb3f66ca0300ed
>
> So I'm wondering what problem you're running into.

It sounds like Lyes is doing a periodic database-wide VACUUM that is
getting blocked on certain relations that are already locked (perhaps
because autovacuum is already working on it). IIUC, the ask is to provide
a way to skip vacuuming relations that cannot be immediately locked.

There is already an internal flag called VACOPT_NOWAIT that gives
autovacuum this ability in certain cases (introduced in the aforementioned
commit), and I recently brought up this potential use-case as
justification for a patch [0]. I'd be happy to submit a patch for
providing VACOPT_NOWAIT to users if others think it's something we should
do.

As a side note, this seems more like a feature request than a bug report,
so I'm adding pgsql-hackers@ here, too.

Nathan

[0] https://www.postgresql.org/message-id/875815E8-7A99-4488-AA07-F254C404E2CF%40amazon.com

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Haas 2017-12-01 21:03:59 Re: BUG #14941: Vacuum crashes
Previous Message Tomas Vondra 2017-12-01 18:30:33 Re: BUG #14938: ALTER TABLE hang/ poor performance

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-12-01 18:55:48 Re: Use get_greatest_modulus() in partition_bounds_equal()
Previous Message Robert Haas 2017-12-01 18:50:19 Re: Unclear regression test for postgres_fdw