Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kcJRX-0003Sz-6y for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Nov 2020 02:31:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kcJRV-0002nk-4r for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Nov 2020 02:31:33 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kcJRU-0002nc-Ll for pgsql-hackers@lists.postgresql.org; Tue, 10 Nov 2020 02:31:32 +0000 Received: from [66.111.4.26] (helo=out2-smtp.messagingengine.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kcJRR-0002qY-SF for pgsql-hackers@lists.postgresql.org; Tue, 10 Nov 2020 02:31:31 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id C04805C013A; Mon, 9 Nov 2020 21:31:18 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 09 Nov 2020 21:31:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=tzn1NhdpwzwdPJf6Y Ynxra/0JJ90T54m/cLr8H63kjU=; b=f/Gfhox1Sr5h2aHQGHyMJ6mkgqbsI8dgQ 4WebPrmlix3aPsIURqj5A6tHMFn0HdwPkIpzjXx5mrMAEabHaYtUhuGfs4Or4OF8 /J9zz1jhdjWmr7aqolwJNfO8YRM0U/LpF9HcG7W1eaG94poJwCOlvVRi9bFqZQS/ D0diTSADK04bVJiUrbzI8gSuJi+YK2k97JkTf180HWpScn805whSL1W2gsZ+wfWe +hiLv9cjQKPpEhm9ib53POvYc9zveEIcsoNddMN3B2tb6qG6VUPVmNkr3xgohuk4 S0Bn8OF/qLci/ijXSPJst84W5Bcv17WUwaZA7caTeWC4YO6geiWVw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudduiedggeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdlfeehmdenucfjughrpeffhffvuffkgggtuggjfgesthdtredttder vdenucfhrhhomheptehlvhgrrhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlh hvhhdrnhhoqdhiphdrohhrgheqnecuggftrfgrthhtvghrnhepvefgleevgeeujeeghfeg teeghfegheeifeehheelteetieduieeihffggfehffetnecukfhppeduledtrdelhedrud elrddugeeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.148]) by mail.messagingengine.com (Postfix) with ESMTPA id 0771A328005E; Mon, 9 Nov 2020 21:31:18 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 261A12A09D4; Mon, 9 Nov 2020 23:31:15 -0300 (-03) Date: Mon, 9 Nov 2020 23:31:15 -0300 From: Alvaro Herrera To: Tom Lane Cc: Michael Paquier , Dmitry Dolgov <9erthalion6@gmail.com>, James Coleman , Pg Hackers Subject: Re: remove spurious CREATE INDEX CONCURRENTLY wait Message-ID: <20201110023115.GA18579@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2088512.1604973075@sss.pgh.pa.us> User-Agent: Mutt/1.10.1 (2018-07-13) X-Host-Lookup-Failed: Reverse DNS lookup failed for 66.111.4.26 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Nov-09, Tom Lane wrote: > Michael Paquier writes: > > On Mon, Nov 09, 2020 at 08:32:13PM -0500, Tom Lane wrote: > >> Do we really need exclusive lock on the ProcArray to make this flag > >> change? That seems pretty bad from a concurrency standpoint. > > > Any place where we update vacuumFlags acquires an exclusive LWLock on > > ProcArrayLock. That's held for a very short time, so IMO it won't > > matter much in practice, particularly if you compare that with the > > potential gains related to the existing wait phases. > > Not sure I believe that it doesn't matter much in practice. If there's > a steady stream of shared ProcArrayLock acquisitions (for snapshot > acquisition) then somebody wanting exclusive lock will create a big > hiccup, whether they hold it for a short time or not. Yeah ... it would be much better if we can make it use atomics instead. Currently it's an uint8, and in PGPROC itself it's probably not a big deal to enlarge that, but I fear that quadrupling the size of the mirroring array in PROC_HDR might be bad for performance. However, maybe if we use atomics to access it, then we don't need to mirror it anymore? That would need some benchmarking of GetSnapshotData.