Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5mhD-0000Vx-Gs for pgsql-bugs@arkaria.postgresql.org; Wed, 03 May 2017 05:19:27 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d5mhC-0000vD-D3 for pgsql-bugs@arkaria.postgresql.org; Wed, 03 May 2017 05:19:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d5mhB-0000v3-Ud for pgsql-bugs@postgresql.org; Wed, 03 May 2017 05:19:25 +0000 Received: from mail-wr0-x236.google.com ([2a00:1450:400c:c0c::236]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1d5mh7-0007Hg-CY for pgsql-bugs@postgresql.org; Wed, 03 May 2017 05:19:24 +0000 Received: by mail-wr0-x236.google.com with SMTP id w50so97088598wrc.0 for ; Tue, 02 May 2017 22:19:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=nshJjssqr1yM56pH8hWlWfzhfGnALRZZt5YKKVs5OJc=; b=sXyaHBu4s9P7+7gbKeI5nkWnNBhrkhB+1bCOGbWuY7OIHZQ1NYLgCOxrQLUlXTjypi fqxzcR77v++VbHB4DYJ8wE+ZKhJtSNGF/H3H/5T1czR16y5mWDma4Vz4gAmwKPuRZaW2 HVS29pZw/YfsefTEVWyLU3TchGpvKV2g0NLMb6JvK4F+KpErn4Ft6emg3Tg4iAb6tPq+ oY6+00sSX9A1diC/dPNG8ee1Ibj4+FkSGOEWda2GxBcAk25h6tluiAgiUEd+OSACrlKM 28rdwsE4E8LE9VFF+PWPvBktldXFJPmGl40vVg0lf5/6M6KP5IstuJ2PbBV3qL7RtXhU MH0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=nshJjssqr1yM56pH8hWlWfzhfGnALRZZt5YKKVs5OJc=; b=rgMQnspGB0up0XmNpxcmH8f1W+S8rXYgWeAmAMcok3V+m8/rx2vpWm3H0eqo66nsVn ii2jtzYwPHiDgm3Pv5oKVxTxX/yU4GcyLV1FPNZ+hiNtIVymyicAsrCBnJGLRxI44I79 17NwXMKQoLTI6d9c53IEguIw5gaEHVEEpC84119F05ABHO2OUkIJNxNDJ9l6e74LPzAl om7QotDjbHvAUVI5/aVT9SPSpRcTJwb/IDUQLO69aEfMQ9lG3s4YIqihLT7Fb/e62/oD KrVpCxLCbgCe7jZPgaeYMzxhi9KFVA5sOLar7qA7roLnkOQnIjfHFQ3HlS9KBGh3Koyg //ow== X-Gm-Message-State: AN3rC/4qzyWysZkE2lLof8VvyFj3aC9U9UKspk+ql/M+n2ypczWScx0O nXTUpDoucemNjKEskIKe55bRFLstHhLWczEhRAv6VHH9rXNsq6aOwJBg+ho+CLwOQCQOlmSMGEq 6xVi4YgrKmrKEiYhRwaHND6cyDvU5Ij/EpFQIpS7VxNka7L2s6ttRPtht7Zh3du4F/tY1 X-Received: by 10.223.165.94 with SMTP id j30mr24441672wrb.111.1493788759082; Tue, 02 May 2017 22:19:19 -0700 (PDT) Received: from [192.168.0.105] (150.123.broadband11.iol.cz. [90.178.123.150]) by smtp.gmail.com with ESMTPSA id l7sm33914397wrc.52.2017.05.02.22.19.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 May 2017 22:19:17 -0700 (PDT) Subject: Re: Concurrent ALTER SEQUENCE RESTART Regression To: Robert Haas , Andres Freund References: <16ed823b-44e4-dc51-3da9-a3d66b71ed5c@2ndquadrant.com> <9240bf94-44a8-671a-27bd-500eb868226a@2ndquadrant.com> <20170426174813.slaq6mka7v6xohap@alap3.anarazel.de> <99a009ea-1797-5b82-f3d3-eb4a5a8eb5dc@2ndquadrant.com> <20170427011258.2tpv55b6leqe2uva@alap3.anarazel.de> <1e5bb916-fd58-3995-851b-6875c6dd73eb@2ndquadrant.com> <20170427055211.jc5tblpguawbeqjq@alap3.anarazel.de> <20170502173605.x6p2ghvjzqxrupu5@alap3.anarazel.de> Cc: Peter Eisentraut , Michael Paquier , Jason Petersen , PostgreSQL mailing lists From: Petr Jelinek Message-ID: <448422f6-9b83-3146-3602-6bd40997003e@2ndquadrant.com> Date: Wed, 3 May 2017 07:19:16 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 02/05/17 20:40, Robert Haas wrote: > On Tue, May 2, 2017 at 1:36 PM, Andres Freund 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.gmail.com > > 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). 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. -- 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