Re: [BUGS] Concurrent ALTER SEQUENCE RESTART Regression - Mailing list pgsql-bugs

From Andres Freund
Subject Re: [BUGS] Concurrent ALTER SEQUENCE RESTART Regression
Date
Msg-id 20170502154148.scik2utyqtkyfinb@alap3.anarazel.de
Whole thread Raw
In response to Re: [BUGS] Concurrent ALTER SEQUENCE RESTART Regression  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-bugs
On 2017-05-02 11:05:38 -0400, Peter Eisentraut wrote:
> On 4/27/17 01:52, Andres Freund wrote:
> > In contrast to <v10, the actual change of the tuple is *not* happening
> > with the page lock held.  But now we do log XLOG_SEQ_LOG, then unlock
> > the buffer, and then do a CatalogTupleUpdate().  How is that correct?
> 
> The change to the sequence data and the change to the catalog are two
> separate operations.  There is no need AFAICT for the latter to be done
> while the former is locked or vice versa.

You snipped the salient part of my response:

> Imagine two of these running concurrently - you might end up with
> A:XLogInsert B:XLogInsert B:CatalogTupleUpdate A:CatalogTupleUpdate

Which'll lead, yet another avenue, to sequence states that aren't in
sync with the catalog.

- Andres


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

pgsql-bugs by date:

Previous
From: Andres Freund
Date:
Subject: Re: [BUGS] Concurrent ALTER SEQUENCE RESTART Regression
Next
From: ray.warren@artsalliancemedia.com
Date:
Subject: [BUGS] BUG #14639: Different xmin values in a transaction