pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: Jason Petersen <jason@citusdata.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Subject: Re: Concurrent ALTER SEQUENCE RESTART Regression
Date: Wed, 26 Apr 2017 12:15:53 -0400
Message-ID: <9240bf94-44a8-671a-27bd-500eb868226a@2ndquadrant.com> (raw)
In-Reply-To: <CAB7nPqSDhVn6+yrteh+K4Z58F93dQd-S40N5HL6HQsFMYccL6w@mail.gmail.com>
References: <D992B4C2-8F80-4DE0-8348-6E0696C3F967@citusdata.com>
	<CAB7nPqRUXMvo5xy9cLFyhuHErN9WVCckuKaUbJpxPGBzxqVFdw@mail.gmail.com>
	<CAB7nPqRev_wK4k39hQBpQZRQ17v29guxfobnnmTYT_-hUU67BA@mail.gmail.com>
	<16ed823b-44e4-dc51-3da9-a3d66b71ed5c@2ndquadrant.com>
	<CAB7nPqSDhVn6+yrteh+K4Z58F93dQd-S40N5HL6HQsFMYccL6w@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 4/25/17 21:24, Michael Paquier wrote:
> Yes, and that's fine, taking a stronger lock on pg_sequence would be
> disruptive for other sessions, including the ones updating pg_sequence
> for different sequences. The point I am trying to make here is that
> the code path updating pg_sequence should make sure that the
> underlying object is properly locked first, so as the update is
> concurrent-safe because this uses simple_heap_update that assumes that
> the operation will be concurrent-safe. For example, take tablecmds.c,
> we make sure that any relation ALTER TABLE works on gets a proper lock
> with relation_open first, in what sequences would be different now
> that they have their own catalog?

Pretty much everything other than tables is a counterexample.

git grep RowExclusiveLock src/backend/commands/*.c

Only tables have an underlying object to lock.  Most other DDL commands
don't have anything else to lock and run DDL under RowExclusiveLock.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (84+ messages)  latest in thread

Message-ID: <9240bf94-44a8-671a-27bd-500eb868226a@2ndquadrant.com>
Permalink:  ../9240bf94-44a8-671a-27bd-500eb868226a@2ndquadrant.com/
Also on:    postgresql.org/message-id/9240bf94-44a8-671a-27bd-500eb868226a@2ndquadrant.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: peter.eisentraut@2ndquadrant.com, michael.paquier@gmail.com, jason@citusdata.com
  Subject: Re: Concurrent ALTER SEQUENCE RESTART Regression
  In-Reply-To: <9240bf94-44a8-671a-27bd-500eb868226a@2ndquadrant.com>
  References: <D992B4C2-8F80-4DE0-8348-6E0696C3F967@citusdata.com> <CAB7nPqRUXMvo5xy9cLFyhuHErN9WVCckuKaUbJpxPGBzxqVFdw@mail.gmail.com> <CAB7nPqRev_wK4k39hQBpQZRQ17v29guxfobnnmTYT_-hUU67BA@mail.gmail.com> <16ed823b-44e4-dc51-3da9-a3d66b71ed5c@2ndquadrant.com> <CAB7nPqSDhVn6+yrteh+K4Z58F93dQd-S40N5HL6HQsFMYccL6w@mail.gmail.com> <9240bf94-44a8-671a-27bd-500eb868226a@2ndquadrant.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