Re: Concurrent ALTER SEQUENCE RESTART Regression
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Michael Paquier <michael.paquier@gmail.com>, Jason Petersen <jason@citusdata.com>, PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Date: 2017-05-02T15:41:48Z
Lists: pgsql-bugs, pgsql-hackers
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
Commits
-
Make ALTER SEQUENCE, including RESTART, fully transactional.
- 3d79013b970d 10.0 landed
-
Modify sequence catalog tuple before invoking post alter hook.
- 665104557fdc 10.0 landed
-
Use weaker locks when updating pg_subscription_rel
- 521fd4795e3e 10.0 cited
-
Add pg_sequence system catalog
- 1753b1b02703 10.0 cited
-
Modify sequence state storage to eliminate dangling-pointer problem
- a2597ef17958 7.3.1 cited