pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael.paquier@gmail.com>
To: Bossart, Nathan <bossartn@amazon.com>
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: Tue, 9 Jan 2018 13:27:20 +0900
Message-ID: <20180109042720.GG76418@paquier.xyz> (raw)
In-Reply-To: <5B80D67E-A664-495A-A0BE-CEA847676164@amazon.com>
References: <CA+TgmobBsYxLT586dHBtcsHHeSsJ7T6tr447tY3C08X5fFFraQ@mail.gmail.com>
	<D3FC73E2-9B1A-4DB4-8180-55F57D116B4E@amazon.com>
	<CAB7nPqTyY_7rXFi_=7DX_xZad43snZvDpw-KU+SuX20euGNhbQ@mail.gmail.com>
	<CAD21AoBGtBXxsDECmVVHsM-d64nK2qiDhZ5_tOreBH86=h7Smw@mail.gmail.com>
	<AD80AE03-8A5D-40A2-99C9-C26646489E49@amazon.com>
	<48A02BB8-A7DE-4D11-9586-0BBE5E6FE4F3@amazon.com>
	<CAD21AoC9D528HBugWumq678t_GOLft-KyeGyG=VFeyKfHY4Z5A@mail.gmail.com>
	<32F4B778-292B-41AF-891A-497B8127CD59@amazon.com>
	<CAD21AoCsbqVh5P=ZA479DHrXmtUY2TxPxotE0jPiwM2+gQUjxw@mail.gmail.com>
	<5B80D67E-A664-495A-A0BE-CEA847676164@amazon.com>

On Thu, Dec 28, 2017 at 10:46:18PM +0000, Bossart, Nathan wrote:
> I agree, this makes more sense.  I've made this change in v3 of 0003.

Based on the opinions gathered on this thread, 0001 and 0002 seem to be
in the shape wanted, and those look good for shipping. Now for 0003 we
are not there yet.

-       if (relation == NULL)
+       if (relation != NULL)
+           relname = relation->relname;
+       else if (!rel_lock)
+           relname = get_rel_name(relid);
+
+       if (relname == NULL)
I think that you are doing it wrong here. In get_all_vacuum_rels() you
should build a RangeVar to be reused in the context of this error
message, and hence you'll save an extra lookup based on the relation
OID here, saving from any timing issues that you have overseen as in
this code path a lock on the relation whose name is looked at is not
taken. Relying on the RangeVar being NULL to not generate any logs is
fine as a concept to me, but let's fill it where it is needed, and in
the case of this patch a VACUUM NOWAIT on the whole database is such a
case.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (42+ messages)  latest in thread

Message-ID: <20180109042720.GG76418@paquier.xyz>
Permalink:  ../20180109042720.GG76418@paquier.xyz/
Also on:    postgresql.org/message-id/20180109042720.GG76418@paquier.xyz

 · 

reply

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: michael.paquier@gmail.com, bossartn@amazon.com, 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: <20180109042720.GG76418@paquier.xyz>
  References: <CA+TgmobBsYxLT586dHBtcsHHeSsJ7T6tr447tY3C08X5fFFraQ@mail.gmail.com> <D3FC73E2-9B1A-4DB4-8180-55F57D116B4E@amazon.com> <CAB7nPqTyY_7rXFi_=7DX_xZad43snZvDpw-KU+SuX20euGNhbQ@mail.gmail.com> <CAD21AoBGtBXxsDECmVVHsM-d64nK2qiDhZ5_tOreBH86=h7Smw@mail.gmail.com> <AD80AE03-8A5D-40A2-99C9-C26646489E49@amazon.com> <48A02BB8-A7DE-4D11-9586-0BBE5E6FE4F3@amazon.com> <CAD21AoC9D528HBugWumq678t_GOLft-KyeGyG=VFeyKfHY4Z5A@mail.gmail.com> <32F4B778-292B-41AF-891A-497B8127CD59@amazon.com> <CAD21AoCsbqVh5P=ZA479DHrXmtUY2TxPxotE0jPiwM2+gQUjxw@mail.gmail.com> <5B80D67E-A664-495A-A0BE-CEA847676164@amazon.com> <20180109042720.GG76418@paquier.xyz>

* 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