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 1k8BOY-0008PU-Qc for pgsql-committers@arkaria.postgresql.org; Tue, 18 Aug 2020 23:51:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k8BOX-0001FV-NA for pgsql-committers@arkaria.postgresql.org; Tue, 18 Aug 2020 23:51:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k8BOX-0001FN-Hq for pgsql-committers@lists.postgresql.org; Tue, 18 Aug 2020 23:51:57 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k8BOV-0001LH-Ja for pgsql-committers@lists.postgresql.org; Tue, 18 Aug 2020 23:51:57 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 536595C00EE; Tue, 18 Aug 2020 19:51:54 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 18 Aug 2020 19:51:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=2C3FWMDGtF9RGXLcNQ83A5ox6mT B2iS3ddrESaiRh18=; b=TlJtJ/1dGhd7t5bScthA/zCXcw46uFed0SV3KyqEc/9 +Jbv/qarzlP8n2DjIVQpG/hqbL4tKAeXweTVM6Q6Bm5/5RZeqYn3OvAvJMGE2Gxk CWkmfhGFee8haimf2A8wFM5EOYW+D2w3Q9XvNtif9XBpA1r7tHRfAKM7UbaBUjoc 7EfyyT2Qudpjugl2gvoOC2g9FcGRbQaqEGaAJ86H6JLAG9h0OYh3jtrPVqYCT/ZQ g6wY+ArVh8ePKq86ECvoTHCDcVNoIj66WqlZea4vHtEZNSyHtZjiUY3UZEveV7EH LkxGc3EBu5IgFJirUJ0p57spXJDC6Jfrtk3lVwh9Zdg== 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:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=2C3FWM DGtF9RGXLcNQ83A5ox6mTB2iS3ddrESaiRh18=; b=fzca7lZorc6H9Ka8jfhWOx fAdNIEiaKbD+SLXPAUXw9QImU/3lzUxRE+K5RaZOAHl0OQD/VenuuzCqaodMHye7 F/R/s91RE4hHhJhYfTInzAZSRciTNQ0iM0H7H65jsBJqpcteDuSZbNJljQYOUpCU rBDCe3wcHBW5v2BvXXGKKXNYVOXnw1RU2BZ1+kOAXjJUoBFijjG8hRg8CCSPlE5n baMBGW5l2l4cv41lO447ohruHzPOIgjqE1fZ3ZRmCC/zlkIYvYLEQwLX85QRUnFJ 2yJtvAI0oT5v9y0GoZpGng+v2z1EnL6P+RLZLjZQ9PSGTeawf77mH11awCFh7Vow == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedruddtjedgvdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkfhggtggujgesthdtre dttddtvdenucfhrhhomheptehnughrvghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghn rghrrgiivghlrdguvgeqnecuggftrfgrthhtvghrnhepudekhfekleeugeevteehleffff ejgeelueduleeffeeutdelffeujeffhfeuffdunecukfhppeeijedrudeitddrvddujedr vdehtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grnhgurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Received: from intern.anarazel.de (c-67-160-217-250.hsd1.ca.comcast.net [67.160.217.250]) by mail.messagingengine.com (Postfix) with ESMTPA id C76AF30600A6; Tue, 18 Aug 2020 19:51:53 -0400 (EDT) Date: Tue, 18 Aug 2020 16:51:52 -0700 From: Andres Freund To: Tom Lane Cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Fix race condition in snapshot caching when 2PC is used. Message-ID: <20200818235152.4hxyb3hrvcm7pwom@alap3.anarazel.de> References: <1355915.1597794204@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1355915.1597794204@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2020-08-18 19:43:24 -0400, Tom Lane wrote: > Andres Freund writes: > > Fix race condition in snapshot caching when 2PC is used. > > Uh, is it really okay to modify that variable with only shared > ProcArrayLock? Uh, you're right. I assume it'll fix the buildfarm visible issue regardless, but we surely don't want to rely on that. I'm inclined to just make ClearTransaction take an exclusive lock - the rest of the 2PC operations are so heavyweight that I can't imagine making a difference. When I tested the locking changes in ProcArrayAdd()/Remove() the more heavyweight locking wasn't at all visible. Greetings, Andres Freund