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 1pj6CG-0002cq-RW for pgsql-hackers@arkaria.postgresql.org; Sun, 02 Apr 2023 22:29:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pj6CF-0002Qu-NB for pgsql-hackers@arkaria.postgresql.org; Sun, 02 Apr 2023 22:29:11 +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 1pj6CF-0002Ql-Dv for pgsql-hackers@lists.postgresql.org; Sun, 02 Apr 2023 22:29:11 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pj6CD-0004JW-5l for pgsql-hackers@postgresql.org; Sun, 02 Apr 2023 22:29:10 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id CD566320089C; Sun, 2 Apr 2023 18:29:06 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sun, 02 Apr 2023 18:29:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type: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=fm2; t=1680474546; x=1680560946; bh=M/ CcV7nbmIJROHsrkLjX7o30RSPwg0AauG5ZV6Rs4M8=; b=erxCH33hKaVzqToTST Yy0Mce6yFJ7rN/kVrUbBpkc1CS59oXocAPzClX0JWVgIdiiRVF4YDWUzyFDv7E7o hzfFgFPD/Ba1X4zy7kHfq/FLhH01IEj/ohOGtIIGAGl533ZyOTcCY+K0/6dcQ6P7 mDArI8P6nj9rzxGuC+kPbqACOC3Rno06p4uvyRn8swRL6zoAPHP2TGZqPgcF3kO3 ybSfD507+Zs58D+1vqfURS18sjTE5QjFR3IFYgFaUQnPaa0sG40yTlgTIK/N8ecM Dg1HRXWmN+Tiiz10Rhs3TFVwHWWMqEiSZwrjID/2iBZtt8F1n017QvM2/gKsvq1o q01g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id: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=fm2; t=1680474546; x=1680560946; bh=M/CcV7nbmIJRO HsrkLjX7o30RSPwg0AauG5ZV6Rs4M8=; b=Tu7DCJjSaEtqwjWe5zoaR5C4KS+9F WCG5i8YVvGTZk8qCILJ9gRu1ooWnP0JaXqCZDvCJZgObT55SU+FKmBZr1DBwjJ5M fqdPTOfikDEVqWXW5anJvSjrx7ZvJ5t8MOIEXfIi6F2jzxQWod2Yjl28StnO6j+4 4SgHp5/WIqxcD1QJQJumWj4EqVwSBKitxFQvDemdGQObOvtLHvQjb3/oC7+sexbD 27VMPHNdefzDCKJziKGZEyKzeEbFaLd1nlGEltTdjN0vKFOAl52YjY5ypPuOfn5B 03QYyD+yZ4HudXA+uQk0w8oERHljQGs+RJzEYotTHde6eXMzEiZuuBlYQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeiiedguddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughr vghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrf grthhtvghrnhepvdfffeevhfetveffgeeiteefhfdtvdffjeevhfeuteegleduheetvedu ieettddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eprghnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 2 Apr 2023 18:29:05 -0400 (EDT) Date: Sun, 2 Apr 2023 15:29:04 -0700 From: Andres Freund To: Jeff Davis Cc: "Drouvot, Bertrand" , Robert Haas , Thomas Munro , Alvaro Herrera , Ibrar Ahmed , Amit Khandekar , fabriziomello@gmail.com, tushar , Rahila Syed , pgsql-hackers Subject: Re: Minimal logical decoding on standbys Message-ID: <20230402222904.d3va24dwpr3mgbpj@awork3.anarazel.de> References: <061eeb26-156e-6011-02b6-b4b1422e2aa6@gmail.com> <8a7da0c2-b7fe-1c78-4e47-a16239bf4839@gmail.com> <6ab352de1553c1e3d0c7d97c038dc470ca51e772.camel@j-davis.com> <4df984c8-3adb-3b69-0e4e-a491097862ce@gmail.com> <20230402213506.ocprj6ky45s4ydtr@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2023-04-02 15:15:44 -0700, Jeff Davis wrote: > On Sun, 2023-04-02 at 14:35 -0700, Andres Freund wrote: > > Why not offer a function to add a CV to a WES? It seems somehow odd > > to require > > going through condition_variable.c to create a WES. > > I agree that it's a bit odd, but remember that after waiting on a CV's > latch, it needs to re-insert itself into the CV's wait list. > > A WaitEventSetWait() can't do that, unless we move the details of re- > adding to the wait list into latch.c. I considered that, but latch.c > already implements the APIs for WaitEventSet and Latch, so it felt > complex to also make it responsible for ConditionVariable. I agree that the *wait* has to go through condition_variable.c, but it doesn't seem right that creation of the WES needs to go through condition_variable.c. The only thing that ConditionVariableEventSleep() seems to require is that the WES is waiting for MyLatch. You don't even need a separate WES for that, the already existing WES should suffice. Greetings, Andres Freund