Re: Concurrent ALTER SEQUENCE RESTART Regression

Michael Paquier <michael.paquier@gmail.com>

From: Michael Paquier <michael.paquier@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>, Jason Petersen <jason@citusdata.com>, PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Date: 2017-04-27T01:51:39Z
Lists: pgsql-bugs, pgsql-hackers
On Thu, Apr 27, 2017 at 10:12 AM, Andres Freund <andres@anarazel.de> wrote:
> On 2017-04-26 21:07:20 -0400, Peter Eisentraut wrote:
>> One thing we could do, since all catalog updates now go through
>> CatalogTupleUpdate(), is not use simple_heap_update() there but do the
>> heap_update() directly and provide a better user-facing error message.
>
> I think it's unacceptable to regress with an error message here.  I've
> seen sequence DDL being used while concurrent DML was onging in a number
> of production use cases, and just starting to error out instead of
> properly blocking doesn't seem acceptable to me.

+1'ing on this argument.
-- 
Michael


Commits

  1. Make ALTER SEQUENCE, including RESTART, fully transactional.

  2. Modify sequence catalog tuple before invoking post alter hook.

  3. Use weaker locks when updating pg_subscription_rel

  4. Add pg_sequence system catalog

  5. Modify sequence state storage to eliminate dangling-pointer problem