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 1p79YP-00018l-Gr for pgsql-hackers@arkaria.postgresql.org; Mon, 19 Dec 2022 06:23:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p79YO-0002Jg-6R for pgsql-hackers@arkaria.postgresql.org; Mon, 19 Dec 2022 06:23:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p79YN-0002JX-TJ for pgsql-hackers@lists.postgresql.org; Mon, 19 Dec 2022 06:23:11 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p79YL-00027b-NT for pgsql-hackers@postgresql.org; Mon, 19 Dec 2022 06:23:11 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 50CE15C00DF; Mon, 19 Dec 2022 01:23:05 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 19 Dec 2022 01:23:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc: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=1671430985; x=1671517385; bh=so7vQBa5uH nwb6m3hn5iRKPd/cLVDGJsk5LfGIRE7o0=; b=sXBd0ZK6rzuOz156UjiKMZ/S5G F6uTZh80+zsMvcRVqjf33txW+vQHy33Gm+D8MyY91z4gu2Z7plGjRfn0Gkgx0Zpg T4vPbJDy0vBI4rHWjRxzFcbPZ+Q3aXGLgcnA8qk5VfVw+ZsUsVqCn0T9dJaZwm4T RSEcAUx7ddSJ75gUBBnOZ+494hegFc0E4eE+rn/oT8HmK4lC0qqX8BERLlAMxI23 RjwTCITgBcj8AbZgURI7j2ewu+r7l+S7qIVKV7e3nFQylBM8lHI3oeNRQotPQ8Z4 Oypf4Eah0aEz3tI0D17AaNwgoh0SGudYJaViqVqTo9CvjzmhejQbWvuZsuXQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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=1671430985; x=1671517385; bh=so7vQBa5uHnwb6m3hn5iRKPd/cLV DGJsk5LfGIRE7o0=; b=QqvLcryMZIifKSDctCLFck/l/6GNng0txSgKx0cM8ua9 nbZhkVwJfLdZTTFL1bDdYLmKET7wrob07HzT/P94iw93V+W8yj5Ps1pDuqzBvaAG kfRmzkMZwh7+6YB+rCm5PhUR7wAAyPnyUr+9AHoJKjuSsMWTfOk+4oHpWwg5Q9+N didxx5Wr4ivpGso7j1bGGCpSgIZEHYPT6B2ZTabApNu0k1e2p+xi+28Le18pYsO0 JoVbw/AdJqFx+/8Eniat2GmXl+1SNaTwjGF/Ze7JFCtvx6w2BrlgQ74X/YsecJUi MmTBprlDNbvUm1U3GI84/tYni9QFoWbn1eJMGekutw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgedvgdelfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeg geffhfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 19 Dec 2022 01:23:02 -0500 (EST) Date: Mon, 19 Dec 2022 15:22:59 +0900 From: Michael Paquier To: David Christensen Cc: Bharath Rupireddy , Justin Pryzby , Ian Lawrence Barwick , Matthias van de Meent , pgsql-hackers@postgresql.org Subject: Re: [PATCH] Teach pg_waldump to extract FPIs from the WAL Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="q834xFlEFiG7OiLc" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --q834xFlEFiG7OiLc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 15, 2022 at 05:17:46PM -0600, David Christensen wrote: > On Thu, Dec 15, 2022 at 12:36 AM Michael Paquier wr= ote: > This v10 should incorporate your feedback as well as Bharath's. Thanks for the new version. I have minor comments. >> It seems to me that you could allow things to work even if the >> directory exists and is empty. See for example >> verify_dir_is_empty_or_create() in pg_basebackup.c. >=20 > The `pg_mkdir_p()` supports an existing directory (and I don't think > we want to require it to be empty first), so this only errors when it > can't create a directory for some reason. Sure, but things can also be made so as we don't fail if the directory exists and is empty? This would be more consistent with the base directories created by pg_basebackup and initdb. >> +$node->safe_psql('postgres', <> +SELECT 'init' FROM pg_create_physical_replication_slot('regress_pg_wald= ump_slot', true, false); >> +CREATE TABLE test_table AS SELECT generate_series(1,100) a; >> +CHECKPOINT; -- required to force FPI for next writes >> +UPDATE test_table SET a =3D a + 1; >> Using an EOF to execute a multi-line query would be a first. Couldn't >> you use the same thing as anywhere else? 009_twophase.pl just to >> mention one. (Mentioned by Bharath upthread, where he asked for an >> extra opinion so here it is.) >=20 > Fair enough, while idiomatic perl to me, not a hill to die on; > converted to a standard multiline string. By the way, knowing that we have an option called --fullpage, could be be better to use --save-fullpage for the option name? + OPF =3D fopen(filename, PG_BINARY_W); + if (!OPF) + pg_fatal("couldn't open file for output: %s", filename); [..] + if (fwrite(page, BLCKSZ, 1, OPF) !=3D 1) + pg_fatal("couldn't write out complete full page image to file: = %s", filename); These should more more generic, as of "could not open file \"%s\"" and "could not write file \"%s\"" as the file name provides all the information about what this writes. -- Michael --q834xFlEFiG7OiLc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmOgA0MACgkQnvQgOdby QH2Xsg//YjDLEhD1yvKhvii2/QehLFVBxAgYcZsEpsv/9FH2kp4McNHh6PF6w3yU BvymzYZnbDCXSBC2EeFT92K5s41CwbeLfBGqZFC+wW1cORmweekn5CaPwtMJdGIn f5AV9SW95saqxxs62jGBZJgv9I2I4MB0RAT4KAs3wVpn5btpRolYFTajVWquOXeH 2LNW0E1gWFQVSVq8myVaLftYT4+502dg5Waim/W3QIMMLWy9utybeXfAI8f5+8bJ 9DYkH6ruCibMKjVvkuVnaWUrEeOnk2yAfjp2lPzULC00vhRO6doWTdSrL6cHrelI BO0J03z/y3A3zJFiuHNnFC0A3sc/c2X3YV+jl5YMMNGtZ9Uz8PWxRP4lQAhj2Q3R qtCFtOgH4uEWJv4vR/teyL9+rTZjsM1JQCTqroKFL3fqv2CYmuzvSMn37bybzKAD XPobCHesk5sY8skaCUwF8HrqvwTb1yQnQBGizjflH47lmwSQ9duWvqZDBc2yjnFF TV8vOs6qQXfBNevjSd9D6ZtSmxXf6xfFitykGBXY2Un5ZRNuNIDPoDEZqlJuCZ4Y dRz8IBqtOjfQTMp/8zrl6wyjr9dU9wE3PgQld8NNrWkBJHq9PT+dvr1A43XmrLl8 EPhmxZDK9KWXRhW79zZkRqCnTgIdDfJU9mNHclcy6VaDCtMUy8o= =ycLE -----END PGP SIGNATURE----- --q834xFlEFiG7OiLc--