Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0xm9-0001A7-0X for pgsql-bugs@arkaria.postgresql.org; Wed, 19 Apr 2017 22:08:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d0xm8-0000sP-EZ for pgsql-bugs@arkaria.postgresql.org; Wed, 19 Apr 2017 22:08:36 +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 1d0xlS-00085g-0s for pgsql-bugs@postgresql.org; Wed, 19 Apr 2017 22:07:54 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d0xlP-0005rV-Gp for pgsql-bugs@postgresql.org; Wed, 19 Apr 2017 22:07:52 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v3JM7nFr001277; Wed, 19 Apr 2017 18:07:49 -0400 From: Tom Lane To: Nico Williams cc: pgsql-bugs@postgresql.org Subject: Re: pg_dump(1) failures when concurrently refreshing mat views In-reply-to: <20170419212356.GA2844@localhost> References: <20170419193212.GD2856@localhost> <31589.1492636831@sss.pgh.pa.us> <20170419212356.GA2844@localhost> Comments: In-reply-to Nico Williams message dated "Wed, 19 Apr 2017 16:23:56 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1275.1492639669.1@sss.pgh.pa.us> Date: Wed, 19 Apr 2017 18:07:49 -0400 Message-ID: <1276.1492639669@sss.pgh.pa.us> 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 Nico Williams writes: > On Wed, Apr 19, 2017 at 05:20:31PM -0400, Tom Lane wrote: >> ... uh, really? It's not supposed to take anything higher than ACCESS >> SHARE, which should coexist fine with anything short of ACCESS EXCLUSIVE. > Whoops, sorry, that's a mistake in drafting the report. You're right, > it takes an ACCESS SHARE MODE lock, NOWAIT. The remainder of the report > remains correct. But REFRESH CONCURRENTLY takes EXCLUSIVE lock, not ACCESS EXCLUSIVE lock, so it won't conflict with pg_dump. There's something missing from your explanation. Also, the only use of NOWAIT I see is in a parallel pg_dump worker. It is known that parallel pg_dump can lead to deadlocks if third parties are taking ACCESS EXCLUSIVE locks --- but you haven't identified where the ACCESS EXCLUSIVE request is coming from. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs