Re: [BUGS] Concurrent ALTER SEQUENCE RESTART Regression

From: Andres Freund <andres(at)anarazel(dot)de>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org, Noah Misch <noah(at)leadboat(dot)com>, Jason Petersen <jason(at)citusdata(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: [BUGS] Concurrent ALTER SEQUENCE RESTART Regression
Date: 2017-05-11 20:34:33
Message-ID: 20170511203433.rvkx2pm4kzthn62b@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On 2017-05-11 11:35:22 -0400, Peter Eisentraut wrote:
> On 5/10/17 12:24, Andres Freund wrote:
> > The issue isn't the strength, but that we currently have this weird
> > hackery around open_share_lock():
> > /*
> > * Open the sequence and acquire AccessShareLock if needed
> > *
> > * If we haven't touched the sequence already in this transaction,
> > * we need to acquire AccessShareLock. We arrange for the lock to
> > * be owned by the top transaction, so that we don't need to do it
> > * more than once per xact.
> > */
> >
> > This'd probably need to be removed, as we'd otherwise would get very
> > weird semantics around aborted subxacts.
>
> Can you explain in more detail what you mean by this?

Well, right now we don't do proper lock-tracking for sequences, always
assigning them to the toplevel transaction. But that doesn't seem
proper when nextval() would conflict with ALTER SEQUENCE et al, because
then locks would continue to be held by aborted savepoints.

- Andres

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-05-11 20:35:14 Re: [BUGS] Concurrent ALTER SEQUENCE RESTART Regression
Previous Message Konstantin Knizhnik 2017-05-11 20:30:46 Re: Cached plans and statement generalization

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2017-05-11 20:35:14 Re: [BUGS] Concurrent ALTER SEQUENCE RESTART Regression
Previous Message Peter Eisentraut 2017-05-11 20:27:48 Re: [HACKERS] Concurrent ALTER SEQUENCE RESTART Regression