Re: [HACKERS] Concurrent ALTER SEQUENCE RESTART Regression
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>,
Petr Jelinek <petr.jelinek@2ndquadrant.com>,
pgsql-hackers@postgresql.org, Noah Misch <noah@leadboat.com>,
Jason Petersen <jason@citusdata.com>,
Michael Paquier <michael.paquier@gmail.com>,
PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Date: 2017-05-12T03:59:56Z
Lists: pgsql-bugs, pgsql-hackers
Andres Freund <andres@anarazel.de> writes: > On 2017-05-11 17:21:18 -0400, Tom Lane wrote: >> I doubt my machine is 6X faster than yours, >> so this indicates that the subtransaction overhead is pretty real. > Isn't that pretty much the point? The whole open_share_lock() > optimization looks like it really only can make a difference with > subtransactions? Uh, no; I'm pretty sure that that code is older than subtransactions. The point of it is to avoid taking and releasing a lock over and over within a single transaction. >> Hm. I don't think that's a sufficient code change, because if you do it >> like that then the lock remains held after nextval() returns. > Hm? That's not new, is it? We previously did a LockRelationOid(seq->relid) and > then relation_open(seq->relid, NoLock)? Right, but the existing code is *designed* to hold the lock till end of top-level transaction, regardless of what happens in any subtransaction. My understanding of your complaint is that you do not think that's OK for any lock stronger than AccessShareLock. regards, tom lane
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