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 1neQqB-0001g6-EJ for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Apr 2022 00:26:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1neQqA-0001wT-8o for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Apr 2022 00:26:34 +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 1neQq8-0001wD-CY for pgsql-hackers@lists.postgresql.org; Wed, 13 Apr 2022 00:26:33 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1neQq5-0002DE-I8 for pgsql-hackers@postgresql.org; Wed, 13 Apr 2022 00:26:31 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 78F155C01A9; Tue, 12 Apr 2022 20:26:28 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 12 Apr 2022 20:26:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1649809588; x=1649895988; bh=iJCGwXSW8c pzZRNZ4p8FrsQiiLDIrMx2fWXdj2D4PVc=; b=zGV9CXLzr4trfnXM1dt+sDf82d C5HquF5wswe5NDREUg+LVhUb7Ep7Q4j02oUEKqxSvp8FJTBTXK8gGoZx2Ax9rcEt DI5BAdzH9DeFLTh7NFEv8rL9SQo1NF2xIYN3wxH5j9LZOir7QlobgD8u5VnmrTUO 7FULrqpOByJdvj1kveXnTCTlpkNDRhYCIaOrusOcTU66N2/Wd9jwqyGG3/NE4K8x xeW/yar5aa27z3hVH13u49PMdDeg2j+MkqPaH7jiycDMdvv2l8shnPZ45xduGqX3 ntUTzvnineGWH3hmZjEwdl5pqsIzve2JmsgHoo+VM65mF8VBn8TdfRmapoYw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1649809588; x= 1649895988; bh=iJCGwXSW8cpzZRNZ4p8FrsQiiLDIrMx2fWXdj2D4PVc=; b=J zBcLjz+s53cTdVrnOhBCvNcNLHdGUU9pkfcV/NqPLPemXAmnNQW61t11mGcfjL/y xgwmph6GSdfcqn8cjLwiNChl5uCtu9QexX2vuXtwzzAekB2hzozMN1hTsOKySmOx ubPBMh7aHnt85BbylSmhaea4Pz6UZ+MHiidYXFes3N5vOfm5gQTYIvIyzgMYYjAe X+gC61HfS8U9QsSUCbvj+WTdsRFXjP0UiRk6LxEekKWoeAvK1r1rv8FJfH0IxzAo BMZ7kf93TovHJZF3UiPTqO7ifIRXVjjpwe4UVtNv+Tu4e22yI3ifIDbTfTeXkG76 BkumaAI8I4RW4W/9RUgkw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudekledgfeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtffrrg htthgvrhhnpedukefhkeelueegveetheelffffjeegleeuudelfeefuedtleffueejfffh ueffudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grnhgurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 12 Apr 2022 20:26:28 -0400 (EDT) Date: Tue, 12 Apr 2022 17:26:26 -0700 From: Andres Freund To: Tom Lane , Robert Haas Cc: pgsql-hackers@postgresql.org, Thomas Munro Subject: Re: failures in t/031_recovery_conflict.pl on CI Message-ID: <20220413002626.udl7lll7f3o7nre7@alap3.anarazel.de> References: <20220409045515.35ypjzddp25v72ou@alap3.anarazel.de> <20220409050501.frejv2i46m54keem@alap3.anarazel.de> <20220409220054.fqn5arvbeesmxdg5@alap3.anarazel.de> <20220409231002.mddrr7mtca7p55v5@alap3.anarazel.de> <20220409233107.v7okovwr46xsizfk@alap3.anarazel.de> <5111.1649547266@sss.pgh.pa.us> <20220412184913.3wrt4olkdiqvicsj@alap3.anarazel.de> <907760.1649790322@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <907760.1649790322@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2022-04-12 15:05:22 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2022-04-09 19:34:26 -0400, Tom Lane wrote: > >> +1. This is probably more feasible given the latch infrastructure > >> than it was when that code was first written. > > > What do you think about just reordering the disable_all_timeouts() to be > > before the got_standby_deadlock_timeout check in the back branches? I think > > that should close at least the most obvious hole. And fix it properly in > > HEAD? > > I don't have much faith in that, and I don't see why we can't fix it > properly. It's not too hard, agreed. It's somewhat hard to test that it works though. The new recovery conflict tests test all recovery conflicts except for deadlock ones, because they're not easy to trigger... But I think I nearly got it working reliably. It's probably worth backpatching the tests, after stripping them of the stats checks? Three questions: - For HEAD we have to replace the disable_all_timeouts() calls, it breaks the replay progress reporting. Is there a reason to keep them in the backbranches? Hard to see how an extension or something could rely on it, but ...? - I named the variable set by the signal handler got_standby_delay_timeout, because just got_standby_timeout looked weird besides the _deadlock_. Which makes me think that we should rename STANDBY_TIMEOUT to STANDBY_DELAY_TIMEOUT too? - There's the following comment in ResolveRecoveryConflictWithBufferPin(): "We assume that only UnpinBuffer() and the timeout requests established above can wake us up here." That bogus afaict? There's plenty other things that can cause MyProc->latch to be set. Is it worth doing something about this at the same time? Right now we seem to call ResolveRecoveryConflictWithBufferPin() in rapid succession initially. Greetings, Andres Freund