pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Petr Jelinek <petr.jelinek@2ndquadrant.com>
To: Robert Haas <robertmhaas@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: 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, 3 May 2017 07:19:16 +0200
Message-ID: <448422f6-9b83-3146-3602-6bd40997003e@2ndquadrant.com> (raw)
In-Reply-To: <CA+TgmoagN_3h2cPV31433zBJkEh=kvMmwzHYm64TgrOCBx2ing@mail.gmail.com>
References: <16ed823b-44e4-dc51-3da9-a3d66b71ed5c@2ndquadrant.com>
	<CAB7nPqSDhVn6+yrteh+K4Z58F93dQd-S40N5HL6HQsFMYccL6w@mail.gmail.com>
	<9240bf94-44a8-671a-27bd-500eb868226a@2ndquadrant.com>
	<20170426174813.slaq6mka7v6xohap@alap3.anarazel.de>
	<CAB7nPqR_K5pSnP9WUyvgn_76Qurz7BtJZgF6tL1+3cFwxwj68w@mail.gmail.com>
	<99a009ea-1797-5b82-f3d3-eb4a5a8eb5dc@2ndquadrant.com>
	<20170427011258.2tpv55b6leqe2uva@alap3.anarazel.de>
	<1e5bb916-fd58-3995-851b-6875c6dd73eb@2ndquadrant.com>
	<20170427055211.jc5tblpguawbeqjq@alap3.anarazel.de>
	<CA+TgmoZne41kmc7bT3LH8r4M2hmxzqK33nPXGhXQmfh9ar4ZZQ@mail.gmail.com>
	<20170502173605.x6p2ghvjzqxrupu5@alap3.anarazel.de>
	<CA+TgmoagN_3h2cPV31433zBJkEh=kvMmwzHYm64TgrOCBx2ing@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 02/05/17 20:40, Robert Haas wrote:
> On Tue, May 2, 2017 at 1:36 PM, Andres Freund <andres@anarazel.de> wrote:
>>> But by the same token surely we don't want to do
>>> CatalogUpdateIndexes() while holding the buffer lock either; mutual
>>> exclusion needs to be managed at some higher level, using, say, a
>>> heavyweight tuple lock.
>>
>> Right, I don't want that to happen - I think it means we need a proper
>> lock here, but Peter seems to be against that for reasons I don't
>> understand.  It's what Michael had suggested in:
>> http://archives.postgresql.org/message-id/CAB7nPqRev_wK4k39hQBpQZRQ17v29guxfobnnmTYT_-hUU67BA%40mail...
> 
> Yes, I didn't understand Peter's objection, either.  It's true that
> there are multiple levels of locks here, but if we've got things
> failing that used to work, then we've not got all the right ones.
> 

I do understand the objection, Peter wants to keep metadata
transactional which I would prefer as well (and that's not going to be
the case with Michael's approach). It could be done if ALTER SEQUENCE
held stronger lock on the sequence relation though, but it needs to
block nextval as well in that case (which I think would mean nextval
would need row share lock, unless we are okay with doing access
exclusive lock during ALTER) as I mentioned up thread.

-- 
  Petr Jelinek                  http://www.2ndQuadrant.com/
  PostgreSQL Development, 24x7 Support, 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: <448422f6-9b83-3146-3602-6bd40997003e@2ndquadrant.com>
Permalink:  ../448422f6-9b83-3146-3602-6bd40997003e@2ndquadrant.com/
Also on:    postgresql.org/message-id/448422f6-9b83-3146-3602-6bd40997003e@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: petr.jelinek@2ndquadrant.com, robertmhaas@gmail.com, andres@anarazel.de, peter.eisentraut@2ndquadrant.com, michael.paquier@gmail.com, jason@citusdata.com
  Subject: Re: Concurrent ALTER SEQUENCE RESTART Regression
  In-Reply-To: <448422f6-9b83-3146-3602-6bd40997003e@2ndquadrant.com>
  References: <16ed823b-44e4-dc51-3da9-a3d66b71ed5c@2ndquadrant.com> <CAB7nPqSDhVn6+yrteh+K4Z58F93dQd-S40N5HL6HQsFMYccL6w@mail.gmail.com> <9240bf94-44a8-671a-27bd-500eb868226a@2ndquadrant.com> <20170426174813.slaq6mka7v6xohap@alap3.anarazel.de> <CAB7nPqR_K5pSnP9WUyvgn_76Qurz7BtJZgF6tL1+3cFwxwj68w@mail.gmail.com> <99a009ea-1797-5b82-f3d3-eb4a5a8eb5dc@2ndquadrant.com> <20170427011258.2tpv55b6leqe2uva@alap3.anarazel.de> <1e5bb916-fd58-3995-851b-6875c6dd73eb@2ndquadrant.com> <20170427055211.jc5tblpguawbeqjq@alap3.anarazel.de> <CA+TgmoZne41kmc7bT3LH8r4M2hmxzqK33nPXGhXQmfh9ar4ZZQ@mail.gmail.com> <20170502173605.x6p2ghvjzqxrupu5@alap3.anarazel.de> <CA+TgmoagN_3h2cPV31433zBJkEh=kvMmwzHYm64TgrOCBx2ing@mail.gmail.com> <448422f6-9b83-3146-3602-6bd40997003e@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