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 1tVJIH-007DRM-14 for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Jan 2025 23:47:29 +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 1tVJIF-009uuJ-HP for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Jan 2025 23:47:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tVJIE-009uu6-8U for pgsql-hackers@lists.postgresql.org; Tue, 07 Jan 2025 23:47:26 +0000 Received: from fout-a4-smtp.messagingengine.com ([103.168.172.147]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tVJI8-000QkD-1a for pgsql-hackers@lists.postgresql.org; Tue, 07 Jan 2025 23:47:25 +0000 Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfout.phl.internal (Postfix) with ESMTP id C2A581380181; Tue, 7 Jan 2025 18:47:18 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Tue, 07 Jan 2025 18:47:18 -0500 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=1736293638; x=1736380038; bh=8+BSRImTSD 7mJvWa3rD31SXAfWstedxg7iVPnr+PMQg=; b=IprhOe8R4Fw8BRIlyZJMTn46Nb Bq6O/sjH8ZkdZ1lz6wyXKYLdMfd7F78g2gQWtOGS6REKbwZof/eWXHUjLg7U5Wuw D/iidm5GrKCJvgcXst6XqYDpmKKH9JdWvel0AmvrdFJ6grdtvaeMVSo8ZNgCos9U iLtqSVn+Qqjq9s3V5tMNMyxIvKOs2D3HVjHehJknT7pSFTGAAzJ0fx5gRjCgurM7 TUKHL8y5ASEeOQ+MMkRk1W8xJHmy6MMqghnVPSVErqToQRcBP0QI47EkuKHMMuvv OoDiiAm+j99Vd7belCzk2gFKbkYLf3+9uVQ9iJ1P8TP6Ocxw/ytB1btVGZBw== 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-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1736293638; x=1736380038; bh=8+BSRImTSD7mJvWa3rD31SXAfWstedxg7iV Pnr+PMQg=; b=DiGtoYKKt4jM2TIzCT7JB1BojF1OpWZJuNj1MyV5uI5w/Zh0cTS tT0GcewNLRLNnL2Slbgi434lo+s182l0ozUxyCKKY4y9J3JRW44B/HmmdwRo9+Ok lhtfHg+Jvh3ATl3P3JyWcXqYxxpBtSj6CMDZw+dKWmlyQlqbmcgZWuct65Au3jTI 300WMNib26CxRc0t3MmHUHxjnkW9T2tma93AbLBkziyW9fSKdyZKtRWZziKUAmaE ygc2ClBj3PDcthBWMXI4RbLiee9dycDkSz9YtZup0SLceSfaRYrxxNCTcA6tuPZr 95Koitn+o6GXg4AAEJX6En33pTnGppw7nCQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudegfedgudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnegfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhf gggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruc eomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteel ieefudffhffhtdetleeggeegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhes phgrqhhuihgvrhdrgiihiidpnhgspghrtghpthhtohepledpmhhouggvpehsmhhtphhouh htpdhrtghpthhtohepgiegmhhmmheshigrnhguvgigqdhtvggrmhdrrhhupdhrtghpthht ohepsghhrghrrghthhdrrhhuphhirhgvugguhihfohhrphhoshhtghhrvghssehgmhgrih hlrdgtohhmpdhrtghpthhtohepnhgrthhhrghnuggsohhsshgrrhhtsehgmhgrihhlrdgt ohhmpdhrtghpthhtohepjhgrphhinhhliheshhhothhmrghilhdrtghomhdprhgtphhtth hopegsrghrfihitghksehgmhgrihhlrdgtohhmpdhrtghpthhtohephhhorhhikhihohht rgdrnhhtthesghhmrghilhdrtghomhdprhgtphhtthhopegtrghrhidrhhhurghngheshh highhhghhordgtrgdprhgtphhtthhopehsrghthigrnhgrrhhlrghpuhhrrghmsehgmhgr ihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrph hoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 7 Jan 2025 18:47:15 -0500 (EST) Date: Wed, 8 Jan 2025 08:47:05 +0900 From: Michael Paquier To: "Andrey M. Borodin" Cc: Bharath Rupireddy , Nathan Bossart , Japin Li , Ian Lawrence Barwick , Kyotaro Horiguchi , Cary Huang , SATYANARAYANA NARLAPURAM , pgsql-hackers@lists.postgresql.org Subject: Re: Switching XLog source from archive to streaming when primary available Message-ID: References: <20240305020452.GA3373526@nathanxps13> <20240305195212.GB3481820@nathanxps13> <20240306161926.GB3542434@nathanxps13> <2D6CD551-8110-450B-BBD9-DAE64822304D@yandex-team.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="F0Z65172267kNtfu" Content-Disposition: inline In-Reply-To: <2D6CD551-8110-450B-BBD9-DAE64822304D@yandex-team.ru> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --F0Z65172267kNtfu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jan 02, 2025 at 11:12:37PM +0500, Andrey M. Borodin wrote: > In my observation restore from archive is many orders of magnitude > faster than streaming replication. Advanced archive tools employ > compression (x6 to speed), download parallelism (x4), are not > constrained be primary's network limits (x3) and disk limits, do not > depend on complicated FEBE protocol, etc. This is a fair argument in terms of flexibility of what can be achieved on a file-basis, yes, because you are not bottlenecked by the existing replication protocol and can request them ahead of time if necessary and can decide what you want within a single restore_command or archive_command (or module for the latter). It may be relevant to think in terms of what could be done at protocol level to retrieve batches of WAL segments so as the backend has a better control on how each segment is handled in a batch, or provide better in-core tools to achieve that with the existing two command GUCs for restore and archiving? Nathan has also proposed a couple of months ago restore modules, because relying on commands can be very fancy in terms of error handling. And we already have the archive module part. -- Michael --F0Z65172267kNtfu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmd9vPkACgkQnvQgOdby QH1TNg//egcoX5cAathGLRRn3WT3Ucv8QcYRHruerJLzIyzlJZWWRPL9ymh1dLsK m9zuiVUvCehtxHgJMyCNY+xLtz1fL4nFmv2Pxk+yd4MqVTOssHQf/qGioKlaMVEq 9GKVJyEVKhl/cYNu9CoWSoUQ6XFfE7+iTJutTUBFAP0PXVScLerrAZIEM7dQBJ5R 3S/g38h7p4RxRF8DCKHraIVZpBlPLiOs/MG7kTZZxLgfSprP9RcKcxeYu8rEMJwt rRqNft0uJznt2oZVgiiN8Di+nTQ+56w6USQEx1+qfhSqRICxWPV+CS7Pt0e2Bkx/ oUZO8YY12/lV5kPZSeJESfrSPPKt88oV/kwZ3oLMPfWaEJWFKQus6dSrebTeqn7x 8hE2RRfy5IYsT9M5hjT30pepPBsvHXKVYQKQOno65qbwM4/NdtclO9eprOBWsij4 TjusUqTCUc3+GyRl9Y6ZJt9bxBWfkWidhvqRDqVF9I55DWpYazYKxxYeC4X5DriE whZ/dauCgzUymTWXsYLP9dJOUE87UYqLTAhU5UlVT4mqkNbkv77D2OXOEZCBfNdC bkyth+cNAsokIPqkTc1OjEhxme+t8aAoEDXsh8X51+wGkvmWIZKLw5x9iCueHRxu 8v3stcqp8DRl2EyznyYHZ7YHi+XONXOHRp0OPIsgCN1lqHXjH0k= =RLxG -----END PGP SIGNATURE----- --F0Z65172267kNtfu--