Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1stjiM-001C8j-Dy for pgsql-committers@arkaria.postgresql.org; Thu, 26 Sep 2024 08:19:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1stjiL-004fM3-OK for pgsql-committers@arkaria.postgresql.org; Thu, 26 Sep 2024 08:19:05 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1stjiL-004fLo-Ga for pgsql-committers@lists.postgresql.org; Thu, 26 Sep 2024 08:19:05 +0000 Received: from fhigh-a5-smtp.messagingengine.com ([103.168.172.156]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1stjiJ-0017wQ-2N for pgsql-committers@lists.postgresql.org; Thu, 26 Sep 2024 08:19:04 +0000 Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfhigh.phl.internal (Postfix) with ESMTP id 5BE2F114027E; Thu, 26 Sep 2024 04:19:02 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Thu, 26 Sep 2024 04:19:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1727338742; x=1727425142; bh=hk64yEm74y xa2u4W9QeT/3eVCz8B1apFHfKQMkYyku0=; b=y2VTn/2nuCi2NfbjghL/Ob+17J WsKMiWQZdbdeZurgvdis3fVMw1yewFDHnzS56U/K5hxcqiwZoIVn7FiEsQvq5E1N eMzLmz7DADr7V06f/hbPva4vdb/3AG2VFX6RTuq5aapf/fOxKZ42HAvCR1iq9frn fKFrm9NOGLEHKf0/uofrY3U0F+13Sfh7dpjGB2i9odNf61GIuJRw8yvTK/fCv3SI pd6Dnr0uhIPYXcgYSchx5YwgI7fBEZc5QcHUFWiuuvC/bJ/rE33IXCf0udVy4WJ9 qEz2QVm6KPF8ausMZpmCEJ32DKutRiaNob38vD1H0mivvye6gwQXBYwUpTCw== 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:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1727338742; x=1727425142; bh=hk64yEm74yxa2u4W9QeT/3eVCz8B 1apFHfKQMkYyku0=; b=A1ZwArNqyH8IWGsio25ORt2vVRXRy7pP4yoFZOwlNNXT j1QTBNntF+iU6BEjnniCylE3q54ZkCkyM79RR30zb+P14nmfPLZPsiDwA3abVHJh coL6GGBnd+m6RlRktSY95M7MAO8MrtPKdzT9smW8+Byxr08WnGacRl7GMBbpyupv dH/4lsuKXAQnM6u4nohmhv6b2sNH1SxvxYVzyjPIEPU48VSjSmWmIrP2NpTy1HUa GkdeLWzPjc+eS2o7OMwxZUPpMQHbGnKaRVkhluQPyXkLSRgYdANvprWYld55vV1b J8479rt3/VIhSbhBBD5vPtfBbnhvBHsAPLo4/y9r4w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddtjedgtddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnegfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhf gggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruc eomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteel ieefudffhffhtdetleeggeegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhes phgrqhhuihgvrhdrgiihiidpnhgspghrtghpthhtohepvddpmhhouggvpehsmhhtphhouh htpdhrtghpthhtoheprghkohhrohhtkhhovhesphhoshhtghhrvghsqhhlrdhorhhgpdhr tghpthhtohepphhgshhqlhdqtghomhhmihhtthgvrhhssehlihhsthhsrdhpohhsthhgrh gvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 26 Sep 2024 04:19:00 -0400 (EDT) Date: Thu, 26 Sep 2024 17:18:49 +0900 From: Michael Paquier To: Alexander Korotkov Cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Implement pg_wal_replay_wait() stored procedure Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="b/HK/Q6TvvcMTRre" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --b/HK/Q6TvvcMTRre Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Alexander, On Fri, Aug 02, 2024 at 06:22:21PM +0000, Alexander Korotkov wrote: > Implement pg_wal_replay_wait() stored procedure >=20 > pg_wal_replay_wait() is to be used on standby and specifies waiting for > the specific WAL location to be replayed. This option is useful when > the user makes some data changes on primary and needs a guarantee to see > these changes are on standby. >=20 > The queue of waiters is stored in the shared memory as an LSN-ordered pai= ring > heap, where the waiter with the nearest LSN stays on the top. During > the replay of WAL, waiters whose LSNs have already been replayed are dele= ted > from the shared memory pairing heap and woken up by setting their latches. >=20 > pg_wal_replay_wait() needs to wait without any snapshot held. Otherwise, > the snapshot could prevent the replay of WAL records, implying a kind of > self-deadlock. This is why it is only possible to implement > pg_wal_replay_wait() as a procedure working without an active snapshot, > not a function. >=20 > Catversion is bumped. I've spotted that this patch uses an OID that should not be used during the development cycle: +{ oid =3D> '111', + descr =3D> 'wait for the target LSN to be replayed on standby with an op= tional timeout',=20 Please use something in the 8000-9999 range, as required by 98eab30b93d5. Thanks, -- Michael --b/HK/Q6TvvcMTRre Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmb1GOkACgkQnvQgOdby QH31NhAAkL/11JzmWnEwA3zWkF2oPUaxs205OzyCqbf43vaPGCKJ+PSc3Zx1D4Dy bLA5gd748gz1QRZXnvO7Yz2hh4edCJAnTWr2Z0eQfBuvfmpevmrQ7Vq2Z9AEZWgr NHhlvaiNuivUvsaRm2q71IAyTL9UP2ZdV9jxFxHzWprPt0BNe1Sn7pXE21sl+oBv GUCRtgejOIR5Na795RosEiIaOePT02jZlcNBaFPGqkJdO4giTGfIrZ/d8p3VWn+S WNlKc6ZdavNq/GH9QQ7aka7m5ejqWxKmwJn1IweKoDzRJNNiDnt4/rCx2sT4Bxli 8N9bonufOfAkjijVS5RzLqPO30yAG6IhyO+EBFfm+qMtxW7N7g3z7c52Vab6TzIc AEcLnHYO8p8r/nLG4paMtfuKiu5enS166M9AOsS4OCgcXrr7yvTnHAMH0XZYnA9y Uuo7jXisCY0/33Vwx14n8dWE+TYOvfOgIIrHsLuLogqHeJOJd7AlSxKwn2Vgz7gl ydD8jPcMEfSWdSeLODGXdHvWm/u/znKyS2Vdr2bhueEln5UYYF4W1r3wXGLVwUtA VVnFNcM6/vOZGV8gF0+b9JWACA0nPJNmyL8yvYrEt2jlssYy0s7XCmEi5UZizzYe hpCBuM2JqqbvxwMmWbqGdR2ukEo1lU4q4yV38A1HWJgaPieIdM8= =q4jK -----END PGP SIGNATURE----- --b/HK/Q6TvvcMTRre--