pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Robert Haas <robertmhaas@gmail.com>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: Noah Misch <noah@leadboat.com>
Cc: Jason Petersen <jason@citusdata.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Subject: Re: [BUGS] Concurrent ALTER SEQUENCE RESTART Regression
Date: Wed, 31 May 2017 14:24:38 -0700
Message-ID: <20170531212438.rup2qyphp3ig4mvs@alap3.anarazel.de> (raw)
In-Reply-To: <CA+TgmoaigU_uAw6uP+Jp8w9YumKiZjXETEGBE4KWOhgJ5RC+gA@mail.gmail.com>
References: <20170518205428.kxxtsdl6wswnz3e3@alap3.anarazel.de>
	<CA+TgmoadW_JQRSCn4qCQE1FsD+FNwzW+_cLdHDnMf6Qk+S1XiQ@mail.gmail.com>
	<20170522154227.nvafbsm62sjpbxvd@alap3.anarazel.de>
	<CA+TgmoYQHukyVADmRoWKA1KPzgduXVTbkywCtuQQjnVPCyh+Cg@mail.gmail.com>
	<20170524032516.rsggec2yrd4cqvv2@alap3.anarazel.de>
	<CA+TgmoZWmxkg1BC637-yY=OOyTLd00ADTfXY30YudXCtjcYBKA@mail.gmail.com>
	<54DD1674-B9FC-4723-AC3E-890373889E25@anarazel.de>
	<CA+TgmoYQ_RAJbyupefJsg2W2P4vjKfCuLHyuqOuX_54SNCA9DQ@mail.gmail.com>
	<20170524143239.2dzn3hq3k5wt6shf@alap3.anarazel.de>
	<CA+TgmoaigU_uAw6uP+Jp8w9YumKiZjXETEGBE4KWOhgJ5RC+gA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On 2017-05-24 10:52:37 -0400, Robert Haas wrote:
> On Wed, May 24, 2017 at 10:32 AM, Andres Freund <andres@anarazel.de> wrote:
> > Well, but then we should just remove minval/maxval if we can't rely on
> > it.
>
> That seems like a drastic overreaction to me.

Well, either they work, or they don't.  But since it turns out to be
easy enough to fix anyway...


> > I wonder if that's not actually very little new code, and I think we
> > might end up regretting having yet another inconsistent set of semantics
> > in v10, which we'll then end up changing again in v11.
>
> I'm not exercised enough about it to spend time on it or to demand
> that Peter do so, but feel free to propose something.

This turns out to be fairly simple patch.  We already do precisely what
I describe when resetting a sequence for TRUNCATE, so it's an already
tested codepath.  It also follows a lot more established practice around
transactional schema changes, so I think that's architecturally better
too.  Peter, to my understanding, agreed with that reasoning at pgcon.

I just have two questions:
1) We've introduced, in 3d092fe540, infrastructure to avoid unnecessary
   catalog updates, in an attemt to fix the "concurrently updated"
   error. But that turned out to not be sufficient anyway, and it bulks
   up the code.  I'd vote for just removing that piece of logic, it
   doesn't buy us anything meaningful, and it's bulky.

2) There's currently logic that takes a lower level lock for ALTER
   SEQUENCE RESET without other options.  I think that's a bit confusing
   with the proposed change, because then it's unclear when ALTER
   SEQUENCE is transactional and when not.  I think it's actually a lot
   easier to understand if we keep nextval()/setval() as
   non-transactional, and ALTER SEQUENCE as transactional.

Comments?

- Andres


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



view thread (84+ messages)  latest in thread

Message-ID: <20170531212438.rup2qyphp3ig4mvs@alap3.anarazel.de>
Permalink:  ../20170531212438.rup2qyphp3ig4mvs@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20170531212438.rup2qyphp3ig4mvs@alap3.anarazel.de

 · 

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: andres@anarazel.de, robertmhaas@gmail.com, peter.eisentraut@2ndquadrant.com, pgsql-hackers@postgresql.org, michael.paquier@gmail.com, noah@leadboat.com, jason@citusdata.com
  Subject: Re: [BUGS] Concurrent ALTER SEQUENCE RESTART Regression
  In-Reply-To: <20170531212438.rup2qyphp3ig4mvs@alap3.anarazel.de>
  References: <20170518205428.kxxtsdl6wswnz3e3@alap3.anarazel.de> <CA+TgmoadW_JQRSCn4qCQE1FsD+FNwzW+_cLdHDnMf6Qk+S1XiQ@mail.gmail.com> <20170522154227.nvafbsm62sjpbxvd@alap3.anarazel.de> <CA+TgmoYQHukyVADmRoWKA1KPzgduXVTbkywCtuQQjnVPCyh+Cg@mail.gmail.com> <20170524032516.rsggec2yrd4cqvv2@alap3.anarazel.de> <CA+TgmoZWmxkg1BC637-yY=OOyTLd00ADTfXY30YudXCtjcYBKA@mail.gmail.com> <54DD1674-B9FC-4723-AC3E-890373889E25@anarazel.de> <CA+TgmoYQ_RAJbyupefJsg2W2P4vjKfCuLHyuqOuX_54SNCA9DQ@mail.gmail.com> <20170524143239.2dzn3hq3k5wt6shf@alap3.anarazel.de> <CA+TgmoaigU_uAw6uP+Jp8w9YumKiZjXETEGBE4KWOhgJ5RC+gA@mail.gmail.com> <20170531212438.rup2qyphp3ig4mvs@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