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 1tBOP3-003WDc-1t for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Nov 2024 01:12:08 +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 1tBOP0-00HYUx-Dt for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Nov 2024 01:12:07 +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 1tBOP0-00HYUo-43 for pgsql-hackers@lists.postgresql.org; Thu, 14 Nov 2024 01:12:06 +0000 Received: from fout-a6-smtp.messagingengine.com ([103.168.172.149]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tBOOt-001nrq-Kf for pgsql-hackers@lists.postgresql.org; Thu, 14 Nov 2024 01:12:06 +0000 Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfout.phl.internal (Postfix) with ESMTP id 6CD3E1380212; Wed, 13 Nov 2024 20:11:59 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Wed, 13 Nov 2024 20:11:59 -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=fm3; t=1731546719; x=1731633119; bh=rTLVNZFBrc 0W9fuTwJ1eBtBf7HCx3r3O8v3ocBECWv4=; b=A5hUTgCS9HZutRMFg0PsXV7BZR 66ARU8xOVnvIfWPoZyXOjPjCRFISRURl4K/3E24VUOmLtV024Dat4h3qxdcUhc6u BrN29aGi1rrPfRJOax6yLtbh6ike70IYurU8eq2kw4IkUlGTN6yfvZf0gbUUcCBb A72o+QQlFfWj4tLDgnqSSKA51Hv/cDhajNEf5boegtZ3IJMHHpzKBofNkc/ACbhB /8KqOkIjsG0n4zjuKJPy0o+mwSQpD1iRJ6MA1xOyqugLrBglAL80VRMTRmeE7wiE 1AhjfLbWJae/DxKABurg6gmQa0pTcPP75TwsO2xrXqPEYVux8GkP7FcGxxBQ== 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=fm3; t= 1731546719; x=1731633119; bh=rTLVNZFBrc0W9fuTwJ1eBtBf7HCx3r3O8v3 ocBECWv4=; b=SSr4H+1fZ0VXhfm3FbHHVk0341Ul8NebcPPMmKSWQwf3rzXo3Gt mHpSIO6XGRqrMpoKbyWer56zNkr7rfHQH4FJyozbesIwblR1vG6BP9oWqdt/hJqf 1SW3+WB3k7DK7aQNBh9QznTjH1j79LLk63FfsW/OUUBvZXY0sfs9/5h7x2gM2hYb O8hY1Gzwch4jO9QAOlYgQbYYXJQXq6qBvMjXha8jBLjYy6EoJbusD7fIrQOy63wk FNFOPGi+GYrM34gqEkgvD37GxkqaipwVNTeHSAVh5hqCOd9lhjV+FF/F9HCmjlmJ 9NT1fAw+yB7mpUuLWxacTy5Y63oo/uQXKqQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrvddugdefudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenfghrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhgg tggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoe hmihgthhgrvghlsehprghquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleei fedufffhhfdtteelgeeggeffhfekueevteeigfduudevudetgfegiedvjeenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehp rghquhhivghrrdighiiipdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuth dprhgtphhtthhopegrlhgvkhhsrghnuggvrhesthhimhgvshgtrghlvgdrtghomhdprhgt phhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlh drohhrgh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 13 Nov 2024 20:11:58 -0500 (EST) Date: Thu, 14 Nov 2024 10:11:41 +0900 From: Michael Paquier To: Aleksander Alekseev Cc: PostgreSQL Hackers Subject: Re: [PATCH] Refactor SLRU to always use long file names Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="zkscBWd7EnQj/C0P" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --zkscBWd7EnQj/C0P Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Nov 12, 2024 at 05:37:02PM +0300, Aleksander Alekseev wrote: > Also it occured to me that as a 4th option we could just get rid of > this check. Users however will pay the price every time they execute > pg_upgrade so I doubt we are going to do this. We cannot remove the check, or Nathan will come after us as he's working hard on reducing the time pg_upgrade takes. We should not make it longer if there is no need to. The scans may be quite long as well, actually, which could be a bottleneck. Did you measure the runtime with a maximized (still realistic) pool of files for these SLRUs in the upgrade time? For upgrades, data would be the neck. # equals SLRU_SEG_FILENAMES_CHANGE_CAT_VER in pg_upgrade.h my $slru_seg_filenames_change_cat_ver = 202411121; [...] open my $fh, "+<", $pg_control_fname or die $!; binmode($fh); sysseek($fh, 12, 0); my $binval = pack("L!", $slru_seg_filenames_change_cat_ver - 1); syswrite($fh, $binval, 4); close($fh); Control file manipulation may be useful as a routine in Cluster.pm, based on an offset in the file and a format to pack as argument? Note that this also depends on the system endianness, see 039_end_of_wal.pl. It's one of these things I could see myself reuse to force a state in the cluster and make a test cheaper, for example. You don't really need the lookup part, actually? You would just need the part where the control file is rewritten, which should be OK as long as the cluster is freshly initdb'd meaning that there should be nothing that interacts with the new value set. pg_upgrade only has CAT_VER flags for some multixact changes and the jsonb check from 9.4. -- Michael --zkscBWd7EnQj/C0P Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmc1Tk0ACgkQnvQgOdby QH1QLw//QdwGtrgD3yDDoNPFW5wW7xVmDOgJUSg2FLSQVuFH783aA+Q5JljSZydd gcGdjXpo+DdbGApjnQ+6ShzO5LvvWk5mRhxf3VPntjPfxdx0yp5mmsG0x5gary6s Vk55XofppI/rgLA36HIu6nGw3hfH7ZIto5n2MbAxG8ZDJGCNEujpKI2nVT0TK85E TDhCrAsQp2ppPfRIyQkoLBl3av8/uzGj/TtuSJiYRbx/9g0C1Oji9MYo3wM4AFAm od8Q/ZVZ3x2MEiDeVSrcv0D8Baa+pFx6XGEUJva2PbLMP/6K1n1zVGo2EUTt0X/I B7++GyBcP7yXoL9J8Nggih8kCYx3j401CbsMxeaLAgikP7fsjY/nfO8mb3HkZ5Ho xleW/c93yaJQxowN+8/0Z0ZuS6vzWJyhMQmyp01I/n5lggpWfQ0oQl0dtWQENvQa TKm0IzmwfW2o8/8sHjSK09+BcjZtuWz50NwoxOnaSDmb4EqeNoUrU5pDcw/JyqGu 5ERJgukwGLGMqZ1pGokQ+CksvM1+/hReAeUJiCDnqB8J35m2Eo4pe2v/lLJaH/t+ uB1a//KlF6NSN2w7H2CRrZPYhTeKtVrqN+9/QdA7Gv5irFg60Fgd2dSB5k1EmlKZ mdJOMYoNN5ytDKjoHjJS5/95ovXAf/fu6TZfaehnKlACarkWkUU= =LTBb -----END PGP SIGNATURE----- --zkscBWd7EnQj/C0P--