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 1oYKUX-00079f-6d for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Sep 2022 04:59:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oYKUW-0005RH-47 for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Sep 2022 04:59:16 +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 1oYKUV-0005R8-BZ for pgsql-hackers@lists.postgresql.org; Wed, 14 Sep 2022 04:59:15 +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 1oYKUO-0002tj-Cv for pgsql-hackers@lists.postgresql.org; Wed, 14 Sep 2022 04:59:14 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 7D70D5C01B5; Wed, 14 Sep 2022 00:59:07 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 14 Sep 2022 00:59:07 -0400 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=1663131547; x=1663217947; bh=/Jezv8IDxw WZpKpBgwhRl+l4DjiWXa//iOj8H1b901o=; b=PwwCE6MHSdQGex4J1njJhj8chv nc7ipdul6FX7U+8eY6a/m23tlZOGPGI1xYA0Fi3mJpY6W+YzMXvH4CzPQ90CNWBp TJ+Q3dC6AWUs7/Bc5CkqXsXWLD0tHM8IQ7ZnRKyfdJxo4MPz5skKLPj5HSKf1Tua a6tr5CbiTIHmpnHEcgZV1JPr6fpNM5ZC6emUfH3xLImuFH1QWdD7c6bOHICVnmDN +ISuSkLssDg6hBU1NvnWUes8ZPwgawUaK1OQU1IgAfrszbUC8jbIBOFiDKaOnZjK QQ4v8NnsDA2tN+zdfMURRxgJDMwbHyPJHnI7ivPG9HM+u6EqeGLozyqyoojQ== 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=1663131547; x=1663217947; bh=/Jezv8IDxwWZpKpBgwhRl+l4DjiW Xa//iOj8H1b901o=; b=vvixMn5sem/cn0rkU3ugA2+AOomknx+lddZM7zDglbpX xSavRu76xMO/cbxd0Y+I+1lI2MxWVy3A1NKFl+BsIKwEU6PXfntjuL0NDv+SsFMy vvt6FWBn/HamUME720RLGDE/iOEHnEaE4iFsQveyMzio4/qAXALUV81Vgy0WvOPS 9aU+nfgRPxjTzBBYfqg4GXgzgPX+Y4UKGH8g0KpuAAYesJTnnCDFsZ4sYnVXnBmY 0fwpAHVImd9qdqB6JDGbFj5E2noqqSXFVKSytwwT3mi+VWmRRBpVFV+gzkEIlYyY nbOpd/ksyF83Bi4uPyMCJqYlLXf2PpdgtXiM3Uhp3Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeduhedgkeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpeffhf fvvefukfhfgggtuggjsehgtdorredttddvnecuhfhrohhmpefoihgthhgrvghlucfrrghq uhhivghruceomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvg hrnhepffduleehgefhkeefgfeftdfhkedutddvhfdukeeggeehieekffelhfelkeehteef necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitg hhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 14 Sep 2022 00:59:05 -0400 (EDT) Date: Wed, 14 Sep 2022 13:59:01 +0900 From: Michael Paquier To: Tom Lane Cc: pgsql-hackers@lists.postgresql.org Subject: Re: pg_basebackup's --gzip switch misbehaves Message-ID: References: <1400032.1662217889@sss.pgh.pa.us> <2402847.1663105127@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="z6MFPyXDA2OZpkyO" Content-Disposition: inline In-Reply-To: <2402847.1663105127@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --z6MFPyXDA2OZpkyO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 13, 2022 at 05:38:47PM -0400, Tom Lane wrote: > is something I tried along the way to diagnosing the problem, and > it turns out to have exactly zero effect. The $tempdir is some > temporary subdirectory of tmp_check that will get nuked at the end > of the TAP test no matter what. So these rmtrees are merely making > the evidence disappear a bit faster; it will anyway. FWIW, I just stick a die() in the middle of the code path when I want to look at specific results. Similar method, same result. > # Test background stream process terminating before the basebackup has >=20 > which is not real clean, since then the files get left behind even > on success, which I doubt we want either. Another thing that could be done here is to use the same base location as the cluster nodes aka $PostgreSQL::Test::Utils::tmp_check. That would mean storing in a repo more data associated to the base backups after a fresh run, though. I am not sure that small machine would like this accumulation in a single run even if disk space is cheap these days. > Anyway, I have no objection to dropping the rmtrees, since they're > pretty useless as the code stands. Just wanted to mention this > issue for the archives. I see more ways to change the existing behavior, so for now I have left that untouched. And so, I have spent a couple of hours torturing the patch, applying it after a few tweaks and CI runs: - --without-zlib was causing a failure in the pg_basebackup tests as we have a few tests that parse and validate a set of invalid specs for the client-side and server-side compression. With zlib around, the tests and their expected results are unchanged, that's just a=20 consequence of moving the assignment of a default level much earlier. - pg_basebackup was triggering an assertion when using client-lz4 or client-zstd as we use the directory method of walmethods.c. In this case, we just support zlib as compression and enforce no compression when we are under lz4 or zstd. This came from an over-simplification of the code. There is a gap in the testing of pg_basebackup, actually, because we have zero tests for LZ4 and zstd there. - The documentation of the replication protocol needed some adjustments for the default comporession levels. The buildfarm is green so I think that we are good. I have closed the open item. You have mentioned upthread an extra thing about the fact that we pass down 0 to deflateParams(). This is indeed wrong and we are lucky that Z_DEFAULT_STRATEGY maps to 0. Better to fix and backpatch this one down to where gzip compression has been added to walmethods.c.. I'll just do that in a bit after double-checking the area and the other routines. -- Michael --z6MFPyXDA2OZpkyO Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmMhX5UACgkQnvQgOdby QH3SeQ//T6ac4/BdMjqqhl8JdD7CjD5XjI+FOdwOSazjVwNJiLaqfr9d6kd2Ied8 LW9rDAuXRtqSBZdY3R2PT9jzRMOJlFS24qiYrwfsU447TViaxEhByQoAsRzf27cS uHTDsVHHWLpucJccEqGcqXOYQJmkaytPONF69b2c7kgqY+94h/i1GdD9iUp8uGr6 ygiAS77gAz7QE22fp4iRrYGtlgpwqT3632USgZohn5MRuq527gf4gJ5lVWUJo5hj CCoaGRzo59xghpK471yMsmaXKDtnWXJvsmNMd2zHTWIKigjXvYa9ycLn9w9SnCWd rA/G/0T0sC+KpuBzOlt34EpzVB6OwE/YZmTM9lFNASEmEHWqNnB+EF7Q9TRD/41H t9rvCOKVLVWEZTlKDaRisjZx97myvzMLFpHRhQlLvtzq6jCmIu7uP0hHWfHm2x3w ir7AMMq18SMhAslGj3dR9C8Ah50Y18vzP9SqkKhBH8A/SPMn1yonOLjHfCd+UT15 yNaKGZnoc/YSoiwE7xDzJErHiqDf7d7W0uS4wsz2RXMkAHNZtogGLEbkPM14rlW8 5JCAdKro9BB8UM17dgt19LGzlkJgFc8BXpotYqsF8PhHAG6eu63jh3esNTOcqkFx FmL/nU9uTEGGgA8C1pEZinLNg1JGlbEXw+Mwq2P90o7IobjZsC8= =8ymU -----END PGP SIGNATURE----- --z6MFPyXDA2OZpkyO--