Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5mog-0000q3-Uv for pgsql-bugs@arkaria.postgresql.org; Wed, 03 May 2017 05:27:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d5mog-0003EH-GG for pgsql-bugs@arkaria.postgresql.org; Wed, 03 May 2017 05:27:10 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d5mnz-00021C-Oq for pgsql-bugs@postgresql.org; Wed, 03 May 2017 05:26:27 +0000 Received: from mail-wr0-x22d.google.com ([2a00:1450:400c:c0c::22d]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1d5mnw-0005vc-AD for pgsql-bugs@postgresql.org; Wed, 03 May 2017 05:26:25 +0000 Received: by mail-wr0-x22d.google.com with SMTP id l9so97089210wre.1 for ; Tue, 02 May 2017 22:26:23 -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=5YO3G4TtHr3MP0r0+ux1dqodNtb+a1aXM9xt4y51fDw=; b=u5AV91KVllxrECAvlKNTRDPUmqSaTO5P+4CYMgLcXEbTkA2dRVYAarQo0rdA3Z+w9r 3baxZPA1veW5gYUXsPn3FqFCwUQnN8ioKK/H3rUwzh0RlV/aYgnfrFiYhW00/arAU0pI UFMn0WFMnrJ0Z7eKUxpR/I99Uf7mDrXVUF53l1rEuOfYcxayx4OX+etvUe19kOVCxF4y wYdxvJJlBKMNANpgJiSsu8PLviLBLuNBw/RE6UOeeBJnp410jrX/YFZl08RxbrotTRMR V1ui42L22Pd5tBAqABOJkokrHX92gwLV/lE8VEeuVyISvVU1fuCFY17EWXHsEwPldQgv VA+A== 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=5YO3G4TtHr3MP0r0+ux1dqodNtb+a1aXM9xt4y51fDw=; b=eq0Q6PS7essBdRfwpQ7qnVb+cI/N7iKG7lF8le5Ge1ekAs74F9Vy6hZdTYh2e/o7H4 ihHyJzQsbqAiRCC0/w9M+O8gtJkBd/q+P7omhKo3t7mH3GxbDAp8plZ4XY1T0HEDXoqj UzbFRuom1jIlLrGrK7T/vQYeW5Wb+nbKUBi+rIKOgh5h4pg85bIYdKZUgOjVQcdDkq/+ Tr8wFirZdgBCa0RwiZeDUOOIgxSOMfgnb45auHv4ye/x2MKSx/nnJPp1wuqJ//R+IwVc SSwIG7ZEfxocihgFPJjKw1mpmsoM+xo897a0/+TTd9L2gjjQb/o90tb1+zD2E7eKZWaC zG0w== X-Gm-Message-State: AN3rC/4evHqyIp3rhzcTcgHWZqhh49LnHhVhBMIXiG+iBqh2nhbKQ1hn X3g2jGr+o5i1UTierYlivIMACUZyC99Dqb1BvzcNlHVcDz8nL3FlZAaprQd0Ir5x03z/9/08Wn8 Z5IhphImUBh8rUhWjEYR/ZbStYuv3fJWezdJaswdb/3J+oYGQou2ojQ62jwJYNmWqr+m8 X-Received: by 10.223.151.6 with SMTP id r6mr22001841wrb.189.1493789182702; Tue, 02 May 2017 22:26:22 -0700 (PDT) Received: from [192.168.0.105] (150.123.broadband11.iol.cz. [90.178.123.150]) by smtp.gmail.com with ESMTPSA id z84sm3487869wmh.27.2017.05.02.22.26.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 May 2017 22:26:21 -0700 (PDT) Subject: Re: Concurrent ALTER SEQUENCE RESTART Regression To: Andres Freund References: <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> <448422f6-9b83-3146-3602-6bd40997003e@2ndquadrant.com> <20170503052246.ss6xfpc3tvizngyj@alap3.anarazel.de> Cc: Robert Haas , Peter Eisentraut , Michael Paquier , Jason Petersen , PostgreSQL mailing lists From: Petr Jelinek Message-ID: <70a5d5d7-a08d-b7af-0e0c-75aded3bad11@2ndquadrant.com> Date: Wed, 3 May 2017 07:26:21 +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: <20170503052246.ss6xfpc3tvizngyj@alap3.anarazel.de> Content-Type: text/plain; charset=windows-1252 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 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 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). > > 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