From: Andres Freund <andres@anarazel.de>
To: Bossart, Nathan <bossartn@amazon.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Lyes Ameddah <lyes.amd@gmail.com>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: BUG #14941: Vacuum crashes
Date: Fri, 30 Mar 2018 17:19:46 -0700
Message-ID: <20180331001946.uie7elezusxes7qw@alap3.anarazel.de> (raw)
In-Reply-To: <4D1115BF-ED38-44E2-B799-C7F9E421A3B8@amazon.com>
References: <20180109042720.GG76418@paquier.xyz>
<4B232BD7-A97D-4461-81E6-28A49764B60E@amazon.com>
<20180110025331.GE336@paquier.xyz>
<CBEE19BB-6C70-424C-95E5-F8ABC7AA2185@amazon.com>
<20180110231442.GA22983@paquier.xyz>
<20180304001252.5sxn3glccnu5qxjm@alap3.anarazel.de>
<7327B413-1A57-477F-A6A0-6FD80CB5482D@amazon.com>
<20180307050345.GA3095@paquier.xyz>
<3834EFB8-2A90-41C7-A7C8-8B956150479D@amazon.com>
<4D1115BF-ED38-44E2-B799-C7F9E421A3B8@amazon.com>
Hi,
On 2018-03-30 18:39:01 +0000, Bossart, Nathan wrote:
> I've noticed one more problem with ACCESS EXCLUSIVE. If an ACCESS
> EXCLUSIVE lock is held on a child relation of a partitioned table,
> an ANALYZE on the partitioned table will be blocked at
> acquire_inherited_sample_rows().
>
> static int
> acquire_inherited_sample_rows(Relation onerel, int elevel,
> HeapTuple *rows, int targrows,
> double *totalrows, double *totaldeadrows)
> {
> ...
> /*
> * Find all members of inheritance set. We only need AccessShareLock on
> * the children.
> */
> tableOIDs =
> find_all_inheritors(RelationGetRelid(onerel), AccessShareLock, NULL);
Right.
> It also seems possible for the call to vac_open_indexes() in
> do_analyze_rel() to block.
Yup.
> 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.
I'm actually wondering if we shouldn't just ignore this problem. While
the other cases VACUUM (SKIP LOCKED) are intended to solve seem common,
these seem less so. But it'd be a bit weird, too..
Could you post a rebased version of the patch, with an incremental
addition of what you propose in a separate patch?
Greetings,
Andres Freund
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: andres@anarazel.de, bossartn@amazon.com, michael@paquier.xyz, sawada.mshk@gmail.com, robertmhaas@gmail.com, lyes.amd@gmail.com, tomas.vondra@2ndquadrant.com, pgsql-hackers@postgresql.org
Subject: Re: BUG #14941: Vacuum crashes
In-Reply-To: <20180331001946.uie7elezusxes7qw@alap3.anarazel.de>
References: <20180109042720.GG76418@paquier.xyz> <4B232BD7-A97D-4461-81E6-28A49764B60E@amazon.com> <20180110025331.GE336@paquier.xyz> <CBEE19BB-6C70-424C-95E5-F8ABC7AA2185@amazon.com> <20180110231442.GA22983@paquier.xyz> <20180304001252.5sxn3glccnu5qxjm@alap3.anarazel.de> <7327B413-1A57-477F-A6A0-6FD80CB5482D@amazon.com> <20180307050345.GA3095@paquier.xyz> <3834EFB8-2A90-41C7-A7C8-8B956150479D@amazon.com> <4D1115BF-ED38-44E2-B799-C7F9E421A3B8@amazon.com> <20180331001946.uie7elezusxes7qw@alap3.anarazel.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox