pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bossart, Nathan <bossartn@amazon.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Andres Freund <andres@anarazel.de>
Cc: Michael Paquier <michael.paquier@gmail.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: Wed, 7 Mar 2018 15:32:33 +0000
Message-ID: <3834EFB8-2A90-41C7-A7C8-8B956150479D@amazon.com> (raw)
In-Reply-To: <20180307050345.GA3095@paquier.xyz>
References: <32F4B778-292B-41AF-891A-497B8127CD59@amazon.com>
	<CAD21AoCsbqVh5P=ZA479DHrXmtUY2TxPxotE0jPiwM2+gQUjxw@mail.gmail.com>
	<5B80D67E-A664-495A-A0BE-CEA847676164@amazon.com>
	<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>

On 3/6/18, 11:04 PM, "Michael Paquier" <michael@paquier.xyz> wrote:
> +       if (!(options & VACOPT_SKIP_LOCKED))
> +           relid = RangeVarGetRelid(vrel->relation, AccessShareLock,
> false);
> +       else
> +       {
> +           relid = RangeVarGetRelid(vrel->relation, NoLock, false);
> Yeah, I agree with Andres that getting all this logic done in
> RangeVarGetRelidExtended would be cleaner.  Let's see where the other
> thread leads us to:
> https://www.postgresql.org/message-id/20180306005349.b65whmvj7z6hbe2y%40alap3.anarazel.de

I had missed that thread.  Thanks for pointing it out.

> +       /*
> +        * We must downcase the statement type for log message
> consistency
> +        * between expand_vacuum_rel(), vacuum_rel(), and analyze_rel().
> +        */
> +       stmttype_lower = asc_tolower(stmttype, strlen(stmttype));
> This blows up on multi-byte characters and may report incorrect relation
> name if double quotes are used, no?

At the moment, stmttype is either "VACUUM" or "ANALYZE", but I suppose
there still might be multi-byte risk in translations.

> +       /*
> +        * Since autovacuum workers supply OIDs when calling vacuum(), no
> +        * autovacuum worker should reach this code, and we can make
> +        * assumptions about the logging levels we should use in the
> checks
> +        * below.
> +        */
> +       Assert(!IsAutoVacuumWorkerProcess());
> This is a good idea, should be a separate patch as other folks tend to
> be confused with relid handling in expand_vacuum_rel().

Will do.

> +      Specifies that <command>VACUUM</command> should not wait for any
> +      conflicting locks to be released: if a relation cannot be locked
> +      immediately without waiting, the relation is skipped
> Should this mention as well that no errors are raised, allowing the
> process to move on with the next relations?

IMO that is already covered by saying the relation is skipped,
although I'm not against explicitly stating it, too.  Perhaps we could
outline the logging behavior as well.

Nathan



view thread (42+ messages)  latest in thread

Message-ID: <3834EFB8-2A90-41C7-A7C8-8B956150479D@amazon.com>
Permalink:  ../3834EFB8-2A90-41C7-A7C8-8B956150479D@amazon.com/
Also on:    postgresql.org/message-id/3834EFB8-2A90-41C7-A7C8-8B956150479D@amazon.com

 · 

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: bossartn@amazon.com, michael@paquier.xyz, andres@anarazel.de, michael.paquier@gmail.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: <3834EFB8-2A90-41C7-A7C8-8B956150479D@amazon.com>
  References: <32F4B778-292B-41AF-891A-497B8127CD59@amazon.com> <CAD21AoCsbqVh5P=ZA479DHrXmtUY2TxPxotE0jPiwM2+gQUjxw@mail.gmail.com> <5B80D67E-A664-495A-A0BE-CEA847676164@amazon.com> <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>

* 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