Re: Concurrent ALTER SEQUENCE RESTART Regression

From: Andres Freund <andres(at)anarazel(dot)de>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: Jason Petersen <jason(at)citusdata(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Concurrent ALTER SEQUENCE RESTART Regression
Date: 2017-05-02 15:07:44
Message-ID: 20170502150744.l6jr32attx2f6575@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On 2017-05-02 10:53:19 -0400, Peter Eisentraut wrote:
> On 4/24/17 15:52, Jason Petersen wrote:
> > 1. Create a new sequence: CREATE SEQUENCE my_seq;
> > 2. Start this loop twice in different shells:
> > while true; do psql -1Xtc 'ALTER SEQUENCE my_seq RESTART 1'; done
>
> > Each loop should repeatedly succeed and simply print ALTER SEQUENCE over and over.
>
> > The output stream is punctuated by occasional "ERROR: tuple concurrently updated" messages.
>
> This message comes from the pg_sequence catalog update. But in the case
> of the RESTART clause, you don't need to update the catalog, because it
> just needs to write to the sequence's relation. So I have tweaked the
> code a little to omit the catalog update if it's not needed. Your test
> case works without errors now.

Wait, how does this *actually* solve anything, but scratch at the
surface? You just add a MAXVALUE and it starts failing (and not being
adhered to) again?

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Eisentraut 2017-05-02 15:19:08 Re: Concurrent ALTER SEQUENCE RESTART Regression
Previous Message Peter Eisentraut 2017-05-02 15:05:38 Re: Concurrent ALTER SEQUENCE RESTART Regression

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2017-05-02 15:19:08 Re: Concurrent ALTER SEQUENCE RESTART Regression
Previous Message Peter Eisentraut 2017-05-02 15:05:38 Re: Concurrent ALTER SEQUENCE RESTART Regression