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 1qEIPE-00048X-CQ for pgsql-hackers@arkaria.postgresql.org; Tue, 27 Jun 2023 23:47:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qEIPD-0004oR-9a for pgsql-hackers@arkaria.postgresql.org; Tue, 27 Jun 2023 23:47:31 +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 1qEIPC-0004ll-Sh for pgsql-hackers@lists.postgresql.org; Tue, 27 Jun 2023 23:47:31 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qEIPA-000osF-7w for pgsql-hackers@lists.postgresql.org; Tue, 27 Jun 2023 23:47:29 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id E6F3132008FD; Tue, 27 Jun 2023 19:47:26 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 27 Jun 2023 19:47:27 -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:sender :subject:subject:to:to; s=fm2; t=1687909646; x=1687996046; bh=SZ 1w+ptuY+NcnA//0Mhot0lEtLpgYNemJrqTV3Y7jrI=; b=swQbTRIqs3cFXO7Dko cpZcPty+dikf4KP9IaBywREeH5DOZ08NXwzbz59k6x+J/dLsunxOLANadYo9NcPM LeUVs2gsKU2pSJcoSQncaiB5HJ+RtDs0jqxtt8DyT8lARoRceiB4+uxNSJYqn+xq icWGIBXWr3xJDX7xpKqylHmrCALUInm9mwG4VmFCENcJviTLk551hLJjNmscNxkf WdQeM1jp1jg1/ICVmOYGJuFdB/ST3mQH6KDV9n4zPWRojZcylJgPEc4Z3gYLUM1E djgRNNJ6hS2tJQpJzBV8YKjVEHMibRtHsPJO/THvQZMmnPHgWN3HQWo9fWpia+rD WMeQ== 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=1687909646; x=1687996046; bh=SZ1w+ptuY+Ncn A//0Mhot0lEtLpgYNemJrqTV3Y7jrI=; b=JZ7gvBcsLxfqdWQT5KqsVaXhFhbMq Dftc0NxxP57JyukMp6iJGDUpIeRd0EfqVds+8BxEvx4xwGfRUtt34NUee7SQ/a1F WKmvzAv0VOJuMHLO3snDgVzcXh3lXQ+j0PlL8LR9Xajiu01zlTJ0yeBAc6RdVZSu MLlhAcqMBB9nlcPiBX/6fQjmNltJiHzRfOONMbJVCIFFXEm5/v+5GQiD3UjTyswo +7tFG77i2MV2Y3g0EovlqwEA5BQiiIJLFX35n44QrHVO2t83pCvKv/A9m8g1fcv6 oGKkpi39WtvRSGzVIYwmjHdXBWydYyihdHH41EeMiu0Q5b8+2T7smOkQQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrtddugddviecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecufghrlhcuvffnffculdejtddmnecujfgurhepfffhvf evuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhu ihgvrhcuoehmihgthhgrvghlsehprghquhhivghrrdighiiiqeenucggtffrrghtthgvrh hnpeetleeifedufffhhfdtteelgeeggeffhfekueevteeigfduudevudetgfegiedvjeen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthh grvghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 27 Jun 2023 19:47:24 -0400 (EDT) Date: Wed, 28 Jun 2023 08:47:21 +0900 From: Michael Paquier To: Kyotaro Horiguchi Cc: pgsql-hackers@lists.postgresql.org, masao.fujii@gmail.com, david.christensen@crunchydata.com Subject: Re: Add TLI number to name of files generated by pg_waldump --save-fullpage Message-ID: References: <20230627.154404.922227939135916807.horikyota.ntt@gmail.com> <20230627.163952.2129200447170879116.horikyota.ntt@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="LzLIzlZRltLaI+ot" Content-Disposition: inline In-Reply-To: <20230627.163952.2129200447170879116.horikyota.ntt@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --LzLIzlZRltLaI+ot Content-Type: multipart/mixed; boundary="RvhYCxatoFKl1Ope" Content-Disposition: inline --RvhYCxatoFKl1Ope Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jun 27, 2023 at 04:39:52PM +0900, Kyotaro Horiguchi wrote: > I meant that the name is structured as > TLIh-TLIl....._, which > appears to be inconsistent with the comment. (And I'm not sure what > "TLOID" is..) Well, to be clear, it should not be TLIh-TLIl but LSNh-LSNl :) I'm OK with these terms for the comments. This is very internal anyway so anybody using this feature should know what that means. And yes, the order of the items is wrong, and I agree that TLOID is a bit confusing once the TLI is added in the set. I have just used TBLSPCOID as term in the comment, and adjusted the XXX to be about the LSN numbers. Adjusted as per the v2 attached. -- Michael --RvhYCxatoFKl1Ope Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v2-0001-Add-timeline-to-file-names-generated-with-pg_wald.patch" Content-Transfer-Encoding: quoted-printable =46rom f0936a95651f767e0f56ff507db5d5a02c7629b2 Mon Sep 17 00:00:00 2001 =46rom: Michael Paquier Date: Wed, 28 Jun 2023 08:46:26 +0900 Subject: [PATCH v2] Add timeline to file names generated with pg_waldump --save-fullpage Reported-by: Fujii Masao --- src/bin/pg_waldump/pg_waldump.c | 3 ++- src/bin/pg_waldump/t/002_save_fullpage.pl | 9 +++++---- doc/src/sgml/ref/pg_waldump.sgml | 9 ++++++++- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/bin/pg_waldump/pg_waldump.c b/src/bin/pg_waldump/pg_waldum= p.c index c6d3ae6344..96845e1a1a 100644 --- a/src/bin/pg_waldump/pg_waldump.c +++ b/src/bin/pg_waldump/pg_waldump.c @@ -518,7 +518,8 @@ XLogRecordSaveFPWs(XLogReaderState *record, const char = *savepath) else pg_fatal("invalid fork number: %u", fork); =20 - snprintf(filename, MAXPGPATH, "%s/%08X-%08X.%u.%u.%u.%u%s", savepath, + snprintf(filename, MAXPGPATH, "%s/%08X-%08X-%08X.%u.%u.%u.%u%s", savepat= h, + record->seg.ws_tli, LSN_FORMAT_ARGS(record->ReadRecPtr), rnode.spcOid, rnode.dbOid, rnode.relNumber, blk, forkname); =20 diff --git a/src/bin/pg_waldump/t/002_save_fullpage.pl b/src/bin/pg_waldump= /t/002_save_fullpage.pl index 831ffdefef..f0725805f2 100644 --- a/src/bin/pg_waldump/t/002_save_fullpage.pl +++ b/src/bin/pg_waldump/t/002_save_fullpage.pl @@ -79,15 +79,16 @@ $node->command_ok( 'pg_waldump with --save-fullpage runs'); =20 # This regexp will match filenames formatted as: -# XXXXXXXX-XXXXXXXX.DBOID.TLOID.NODEOID.dd_fork with the components being: -# - WAL LSN in hex format, -# - Tablespace OID (0 for global) +# TLI-LSNh-LSNl.TBLSPCOID.DBOID.NODEOID.dd_fork with the components being: +# - Timeline ID in hex format. +# - WAL LSN in hex format, as two 8-character numbers. +# - Tablespace OID (0 for global). # - Database OID. # - Relfilenode. # - Block number. # - Fork this block came from (vm, init, fsm, or main). my $file_re =3D - qr/^([0-9A-F]{8})-([0-9A-F]{8})[.][0-9]+[.][0-9]+[.][0-9]+[.][0-9]+(?:_v= m|_init|_fsm|_main)?$/; + qr/^[0-9A-F]{8}-([0-9A-F]{8})-([0-9A-F]{8})[.][0-9]+[.][0-9]+[.][0-9]+[.= ][0-9]+(?:_vm|_init|_fsm|_main)?$/; =20 my $file_count =3D 0; =20 diff --git a/doc/src/sgml/ref/pg_waldump.sgml b/doc/src/sgml/ref/pg_waldump= =2Esgml index e5f9637847..4592d6016a 100644 --- a/doc/src/sgml/ref/pg_waldump.sgml +++ b/doc/src/sgml/ref/pg_waldump.sgml @@ -283,7 +283,7 @@ PostgreSQL documentation The full page images are saved with the following file name format: - LSN.RELTABLESPACE= .DATOID.RELNODE.BLKNOFORK + TIMELINE-LSN.RELTABLESPACE.DATOID.RELNODE.BLKNOFORK =20 The file names are composed of the following parts: @@ -296,6 +296,13 @@ PostgreSQL documentation =20 + + TIMELINE + The timeline of the WAL segment file where the record + is located formatted as one 8-character hexadecimal number + %08X + + LSN The LSN of the record with this imag= e, --=20 2.40.1 --RvhYCxatoFKl1Ope-- --LzLIzlZRltLaI+ot Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmSbdQkACgkQnvQgOdby QH1D5w//UkEW7tltE4DGKgzvk7ivWUn8hyiM4a7HFfd0DXLGiR+/ts7wYr6sc7Pi p4rK6TwoVqNsw3/PctKZVA0Mttczl1eT7pJKYwBNrmnO9iOw2FIuIhW0Q7ws4wbZ MxMEzCJehhHCNLNWjOggWi5ldsnD91rio3cpKKqohHHA+xcDcOfEXKVxT/nbnwNy G5CO6KlZljw202iChNDNV09QB18nDP6TiwD2VrlMKNuOwMXKgueQpMzDL6nZHCqn Wf2wgygLFC0Wsl4F2UkzWOPD7AGLXENnsr9/UKVAxgnKDiP2DShxkdokAzTzF2lY 12bcqfwWApFIqfY6fyhqRw6S4FuusMyPcng1Rsl5C4Qi45V6b/FTy3//ElescmRW wJYECOAwD5zLSUMbEonC6nOdfdK+Spnax15ohELMe5uWPA9sOJcsX2YZXRTq8cOG LrnB/tklzmZHMOHy+kbSbeCkemBnkXCVYhFUBt93uj16LJIwaHqfxiXfrqqijXZd eygVPG1v6sKySDx0npHJNTLYyPEjwHZv3irdbSd+7Vn2eYGxX7n9ZN9QhZgoRNfW YSYwVyY3knGy9mEZakYMWAmPI3rEKwtea7nXABcdSYBVoIDymFbRHljvkrWPB12G 9U6WCmI/XS6fU6DkfELX0w421/LjW8OUGB6K0HMKH8iMj0UAjJE= =QRCg -----END PGP SIGNATURE----- --LzLIzlZRltLaI+ot--