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 1p0vI8-0008WG-Kf for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Dec 2022 01:56:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p0vI7-0005az-Fh for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Dec 2022 01:56:39 +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 1p0vI6-0005aC-E0 for pgsql-hackers@lists.postgresql.org; Fri, 02 Dec 2022 01:56:39 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p0vI2-0001gm-Dj for pgsql-hackers@lists.postgresql.org; Fri, 02 Dec 2022 01:56:37 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 530EC5C014B; Thu, 1 Dec 2022 20:56:33 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 01 Dec 2022 20:56:33 -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=fm1; t=1669946193; x=1670032593; bh=9Ihj1oyOgI Vded/9NhyMWjCwAP2003T5DJK2pUxNZ4E=; b=XoY7aHfdrPuz2BxvxWZdzS8I5R vwPkv/3SMWiy39/QC+aWS09laEzqxi0NjL4/oXNpQPSUPgsyZxUaZHAaaa2rWHRJ xjyyzXLguG3bqKp718TNtnsH48obxTVmTEZmNbO6hrI6W6mHO5L5Uv/hvc4qKf+p Iy8YaKzZr6grkA/0u0TvbbpF3QDXjaLSjbnVe3djkja9KtTBwXCXny4Og9iHt8c5 q7PHmYkS9Iw71SA7yVLq5FraqqhhUoImfFCu3p736YCvcLwM3aGmB0NBIaSwwogl stfdebD7Ht41Qw8jIKtiNRqa5SHyUV3Z8aqHPTKmE2nWxe893nX284OF7lUg== 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= fm1; t=1669946193; x=1670032593; bh=9Ihj1oyOgIVded/9NhyMWjCwAP20 03T5DJK2pUxNZ4E=; b=FkemwVzxinTDpagPr8ratiR4XpmfoHRyDSuhbYDFz5jk MLsq0s6VJsiTvScTf3D08jIH8Twsi/LIbQZ/90T+aiIfRkyZJ6VrUmp+0wzS277d iStS7Etko5IOV4dGlUTZVmgfxxIRocJay+LlkO2vFvIXPlNQLrzg1STUmP7paviQ a8UlKWa7ziagbUsioYmzafoE1ElJpnqx4BQvt3wlfNko26eTA4g5/8or7Vjarl/f Frzs42PZS6Q/AZYp9A/Uih47UlQnwKEbeEG+EE613lPvaeEwr2CYIVp+YBP+z1Y7 3fUQjd9Nwfcp2cdSoReixfUc/p2pDLxesmn/iu8A6A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrtdeigdegudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdefhedmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeg geffhfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 1 Dec 2022 20:56:31 -0500 (EST) Date: Fri, 2 Dec 2022 10:56:26 +0900 From: Michael Paquier To: gkokolatos@pm.me Cc: Justin Pryzby , pgsql-hackers@lists.postgresql.org, Rachel Heaton Subject: Re: Add LZ4 compression in pg_dump Message-ID: References: <-pU80vtiyXMfSSpn4SWOR97t71MVmDOyHaJtvGsdEfroFsFUDdc-UaqD-8LMPMw2sy-7B2_IVnlrATfVvXwtv8n3kexLePZ7iWgiOnE4jRI=@pm.me> <1j_ONBQqU3lQW7OqwbAFKbgcqjQosikcp7VPINqegLrHMCMGtFcXAuyjmW__VeviKyCbKTtucxFyPFUJ7sfqeOf4O90JEuUIe99Z5v7sdOg=@pm.me> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qGhWo5HV+sq+yPFB" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --qGhWo5HV+sq+yPFB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 01, 2022 at 02:58:35PM +0000, gkokolatos@pm.me wrote: > Nuking the warning from orbit and changing the behaviour around disabling > the requested compression when the libraries are not present, should not > mean that we need to change the behaviour of default values for different > formats. Please find v13 attached which reinstates it. Gah, thanks! And this default behavior is documented as dependent on the compilation as well. > Which in itself it got me looking and wondering why the tests succeeded. > The only existing test covering that path is `defaults_dir_format` in > `002_pg_dump.pl`. However as the test is currently written it does not > check whether the output was compressed. The restore command would succeed > in either case. A simple `gzip -t -r` against the directory will not > suffice to test it, because there exist files which are never compressed > in this format (.toc). A little bit more involved test case would need > to be written, yet before I embark to this journey, I would like to know > if you would agree to reinstate the defaults for those formats. On top of my mind, I briefly recall that -r is not that portable. And the toc format makes the files generated non-deterministic as these use OIDs.. [.. thinks ..] We are going to need a new thing here, as compress_cmd cannot be directly used. What if we used only an array of glob()-able elements? Let's say "expected_contents" that could include a "dir_path/*.gz" conditional on $supports_gzip? glob() can only be calculated when the test is run as the file names cannot be known beforehand :/ >> As per the patch, it is true that we do not need to bump the format of >> the dump archives, as we can still store only the compression level >> and guess the method from it. I have added some notes about that in >> ReadHead and WriteHead to not forget. >=20 > Agreed. A minor suggestion if you may. >=20 > #ifndef HAVE_LIBZ > - if (AH->compression !=3D 0) > + if (AH->compression_spec.algorithm =3D=3D PG_COMPRESSION_GZIP) > pg_log_warning("archive is compressed, but this installat= ion does not support compression -- no data will be available"); > #endif >=20 > It would seem a more consistent to error out in this case. We do error > in all other cases where the compression is not available. Makes sense. I have gone through the patch again, and applied it. Thanks! -- Michael --qGhWo5HV+sq+yPFB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmOJW0oACgkQnvQgOdby QH0huQ//dwUhr8C35LCzZdD9VNhdXPk7qHod/J5qDxjoZO865lW9mPp4MlqrXn80 GP3PqJSffc+xS5TezJN8trlEirUbIi1O+iYLd8lDy4iRTgyFqwZmvt3qpiBtM8M6 Jf0C2ZzRJQda0IJLzMQv6+apW41diPp5oSDVttYmizRtJ30YBNE4GYDPQw+g0rYc 91uOpAVougR1yIp116HQkO0aWVTwn/5rab2vI89rieiMOSyfqjRrAceSTBvSCHuU R/nCoGZkTDC9uE4JFA24y4/SJYXtIm/cj34yNvLtDKrSa7ZmJzys5MQMvfLFdCKr tLeGyKaCbCN7xwFoE28O5BOT2C+xMzpkcw3soQYYzGeDtC1UqN3I33OSFa3ZTotG /04XVN8wstUiMT/17P6eZZnTHNlLzwCh935cImB7MvnQhzOcI0OZIamjnPsPjZJu go4SWV/51ABiS2Q37KQ7hT1OCNjphk/iMcpjJhqhNXreWDBEQ8xtr9IzSRkCm3Ky FtweIXReFpvO7tZLlM0bb0OPfDLGAJZ3AgZGZoa33hOKpCwjHiRHkExrunA1mNsp yin35ZbX0pgVvTARF+cQCox1wiRuIKtUs8gBQtLKzycCfE5aUrt/Mad+PHj3UaXS y5FuKgQYBBxXWqqKWVGuO++zg/XD/ASnkUmZDRNqYq5RyVHz1C8= =LR82 -----END PGP SIGNATURE----- --qGhWo5HV+sq+yPFB--