Re: BUG #14941: Vacuum crashes

From: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>, Andres Freund <andres(at)anarazel(dot)de>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Lyes Ameddah <lyes(dot)amd(at)gmail(dot)com>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, "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: 2018-04-05 20:29:38
Views: Raw Message | Whole Thread | Download mbox
Lists: pgsql-bugs pgsql-hackers

On 3/30/18, 7:19 PM, "Andres Freund" <andres(at)anarazel(dot)de> wrote:
> Could you post a rebased version of the patch, with an incremental
> addition of what you propose in a separate patch?

Here is a new patch set. I have attempted to add skip-locked
functionality everywhere it is needed, including VACUUM FULL.

On 4/3/18, 12:12 AM, "Michael Paquier" <michael(at)paquier(dot)xyz> wrote:
> On Fri, Mar 30, 2018 at 05:19:46PM -0700, Andres Freund wrote:
>> On 2018-03-30 18:39:01 +0000, Bossart, Nathan wrote:
>>> I think the most straightforward approach for fixing this is to add
>>> skip-locked functionality in find_all_inheritors(),
>>> find_inheritance_children(), and vac_open_indexes(), but I am curious
>>> what others think.
> For vac_open_indexes() it may make the most sense to introduce a new
> try_open_index which wraps on top of try_relation_open with checks on
> the opened relation's relkind.

I looked into this, but I noticed that the analogous
try_relation_open() implements missing-ok for relation_open(). So, I
thought it might be confusing to have try_index_open() be a skip-
locked version of index_open().

The new tests are now passing as expected, but I am still doing some
manual testing. Since there is quite a bit of added complexity in
this new patch set, I will certainly not be surprised if this gets
moved to the next commitfest.


Attachment Content-Type Size
v7-0001-Add-skip_locked-argument-to-find_inheritance_chil.patch application/octet-stream 8.5 KB
v7-0002-Add-skip_locked-argument-to-find_all_inheritors.patch application/octet-stream 11.8 KB
v7-0003-Add-skip_locked-argument-to-vac_open_indexes.patch application/octet-stream 3.9 KB
v7-0004-Rename-VACOPT_NOWAIT-to-VACOPT_SKIP_LOCKED.patch application/octet-stream 3.1 KB
v7-0005-Add-assertion-that-we-are-not-an-autovacuum-worke.patch application/octet-stream 970 bytes
v7-0006-Create-a-helper-function-for-determining-the-log-.patch application/octet-stream 4.9 KB
v7-0007-Create-a-helper-function-for-cleaning-up-from-do_.patch application/octet-stream 2.1 KB
v7-0008-Skip-VACUUM-ANALYZE-with-VACOPT_SKIP_LOCKED-if-in.patch application/octet-stream 6.9 KB
v7-0009-Skip-ANALYZE-with-VACOPT_SKIP_LOCKED-if-acquire_i.patch application/octet-stream 4.0 KB
v7-0010-Skip-VACUUM-ANALYZE-with-VACOPT_SKIP_LOCKED-if-ex.patch application/octet-stream 2.6 KB
v7-0011-Skip-VACUUM-FULL-with-VACOPT_SKIP_LOCKED-if-clust.patch application/octet-stream 5.7 KB
v7-0012-Open-up-VACOPT_SKIP_LOCKED-to-users.patch application/octet-stream 13.0 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2018-04-05 20:35:23 Re: WIP: a way forward on bootstrap data
Previous Message John Naylor 2018-04-05 20:28:10 Re: WIP: a way forward on bootstrap data

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2018-04-05 21:41:14 Re: BUG #14941: Vacuum crashes
Previous Message Andrew Gierth 2018-04-05 14:57:08 Re: BUG #15142: ERROR: MultiXactId nnnnn has not been created yet -- apparent wraparound in v9.5