From: Petr Jelinek <petr.jelinek@2ndquadrant.com>
To: Andres Freund <andres@anarazel.de>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: Jason Petersen <jason@citusdata.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Subject: Re: Concurrent ALTER SEQUENCE RESTART Regression
Date: Wed, 3 May 2017 07:26:21 +0200
Message-ID: <70a5d5d7-a08d-b7af-0e0c-75aded3bad11@2ndquadrant.com> (raw)
In-Reply-To: <20170503052246.ss6xfpc3tvizngyj@alap3.anarazel.de>
References: <20170426174813.slaq6mka7v6xohap@alap3.anarazel.de>
<CAB7nPqR_K5pSnP9WUyvgn_76Qurz7BtJZgF6tL1+3cFwxwj68w@mail.gmail.com>
<99a009ea-1797-5b82-f3d3-eb4a5a8eb5dc@2ndquadrant.com>
<20170427011258.2tpv55b6leqe2uva@alap3.anarazel.de>
<1e5bb916-fd58-3995-851b-6875c6dd73eb@2ndquadrant.com>
<20170427055211.jc5tblpguawbeqjq@alap3.anarazel.de>
<CA+TgmoZne41kmc7bT3LH8r4M2hmxzqK33nPXGhXQmfh9ar4ZZQ@mail.gmail.com>
<20170502173605.x6p2ghvjzqxrupu5@alap3.anarazel.de>
<CA+TgmoagN_3h2cPV31433zBJkEh=kvMmwzHYm64TgrOCBx2ing@mail.gmail.com>
<448422f6-9b83-3146-3602-6bd40997003e@2ndquadrant.com>
<20170503052246.ss6xfpc3tvizngyj@alap3.anarazel.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
On 03/05/17 07:22, Andres Freund wrote:
> On 2017-05-03 07:19:16 +0200, Petr Jelinek wrote:
>> On 02/05/17 20:40, Robert Haas wrote:
>>> On Tue, May 2, 2017 at 1:36 PM, Andres Freund <andres@anarazel.de> wrote:
>>>>> But by the same token surely we don't want to do
>>>>> CatalogUpdateIndexes() while holding the buffer lock either; mutual
>>>>> exclusion needs to be managed at some higher level, using, say, a
>>>>> heavyweight tuple lock.
>>>>
>>>> Right, I don't want that to happen - I think it means we need a proper
>>>> lock here, but Peter seems to be against that for reasons I don't
>>>> understand. It's what Michael had suggested in:
>>>> http://archives.postgresql.org/message-id/CAB7nPqRev_wK4k39hQBpQZRQ17v29guxfobnnmTYT_-hUU67BA%40mail...
>>>
>>> Yes, I didn't understand Peter's objection, either. It's true that
>>> there are multiple levels of locks here, but if we've got things
>>> failing that used to work, then we've not got all the right ones.
>>>
>>
>> I do understand the objection, Peter wants to keep metadata
>> transactional which I would prefer as well (and that's not going to be
>> the case with Michael's approach).
>
> Huh? How does increasing the locklevel (from AccessShare to
> ShareUpdateExclusive) make it nontransactional?
>
Ah damn, I looked at wrong patch (the one that did inline heap update,
Michael produces too many patches ;)).
Yes that one is good.
>> It could be done if ALTER SEQUENCE held stronger lock on the sequence
>> relation though, but it needs to block nextval as well in that case
>> (which I think would mean nextval would need row share lock, unless we
>> are okay with doing access exclusive lock during ALTER) as I mentioned
>> up thread.
>
> That one is more complicated, because AccessShareLocks on sequences are
> held on for performance reasons... Possibly not really required
> anymore, due to fast-path locks? Still'd increase the number of
> lock/unlock cycles.
Right but won't we still have problem with nextval ignoring the ALTER
until it commits without that?
--
Petr Jelinek http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: petr.jelinek@2ndquadrant.com, andres@anarazel.de, robertmhaas@gmail.com, peter.eisentraut@2ndquadrant.com, michael.paquier@gmail.com, jason@citusdata.com
Subject: Re: Concurrent ALTER SEQUENCE RESTART Regression
In-Reply-To: <70a5d5d7-a08d-b7af-0e0c-75aded3bad11@2ndquadrant.com>
References: <20170426174813.slaq6mka7v6xohap@alap3.anarazel.de> <CAB7nPqR_K5pSnP9WUyvgn_76Qurz7BtJZgF6tL1+3cFwxwj68w@mail.gmail.com> <99a009ea-1797-5b82-f3d3-eb4a5a8eb5dc@2ndquadrant.com> <20170427011258.2tpv55b6leqe2uva@alap3.anarazel.de> <1e5bb916-fd58-3995-851b-6875c6dd73eb@2ndquadrant.com> <20170427055211.jc5tblpguawbeqjq@alap3.anarazel.de> <CA+TgmoZne41kmc7bT3LH8r4M2hmxzqK33nPXGhXQmfh9ar4ZZQ@mail.gmail.com> <20170502173605.x6p2ghvjzqxrupu5@alap3.anarazel.de> <CA+TgmoagN_3h2cPV31433zBJkEh=kvMmwzHYm64TgrOCBx2ing@mail.gmail.com> <448422f6-9b83-3146-3602-6bd40997003e@2ndquadrant.com> <20170503052246.ss6xfpc3tvizngyj@alap3.anarazel.de> <70a5d5d7-a08d-b7af-0e0c-75aded3bad11@2ndquadrant.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox