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 1m3Czh-0002ZV-Qo for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Jul 2021 07:38:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m3Czd-00077W-O4 for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Jul 2021 07:38:13 +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 1m3Czc-00077F-Bi for pgsql-hackers@lists.postgresql.org; Tue, 13 Jul 2021 07:38:13 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m3CzV-00088r-48 for pgsql-hackers@lists.postgresql.org; Tue, 13 Jul 2021 07:38:11 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 5D7823200984; Tue, 13 Jul 2021 03:37:59 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 13 Jul 2021 03:37:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=iFLetLoVVyyY4w+9VY6wozygkUW c+2FvgCdycy+NvSM=; b=VyN44WnHP1S3hQ/PULhbZEu5NQKhZMXPUxmaQqAGNzi IiKoWjrZGvHvmIFYrAJO69mZhlul87YTdahu51bnyV7ZwtG29uR8nrtYOQQWZirx eRA/yghPyJvtDkYRNOliAdwaBiZVt32Csvfc69wNxlVFKVB+FblZ7OCyF62NsR8A TUZXOEaCo5QSwL6WgkFbwE+SAWdFbPL6WrQTqrXcx1fSvt73ZAcah7WJuT1iETHn gfzMCfJP7c07sk1PbF5xW140DtiF3CkUS7L2/ooodyQRWezXGwHHmQ9k2PShg06T AtcFaih01YGeZIRPNUvGCIejsboqAePaTBs3IT+03dQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=iFLetL oVVyyY4w+9VY6wozygkUWc+2FvgCdycy+NvSM=; b=K/WHBmIWI0b+cSpUor+V3S V3kqEj8QdQCUoL7uW7iIPsweNy8xbqu7HxYcYdcteHpPf6yfmRFiot8YmhbjBNaJ yt8Jlu126XBdX30iCDrKFNzpCzZYdOo9uGR6bsFY1B0Bw+oX1V1IgzpXlhWVfHlx tiw65cRj+CyrTa9FhKUkZuQnVy6UEhaqh23rd61/B0DJ9LPYjHJpzmd40KnAGUBT 45A6juBcrsckMF+Lg7jq5Jgb9wsmT6FAo3iKp5GPhQd186N9qtBRZowHkyZuIYGC F95YREkhc7PGFTWZ+MOXIEiOFAAA4mJptnCpckHlXXW/BScJFR29ENZZCzOnbXZA == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudeggdekjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdefhedmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepvdegudeuhfdtueeltedtveejheeh ieevueeigeelteegleejleeiueeiheegvefhnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 13 Jul 2021 03:37:57 -0400 (EDT) Date: Tue, 13 Jul 2021 16:37:53 +0900 From: Michael Paquier To: gkokolatos@pm.me Cc: PostgreSQL Hackers Subject: Re: Introduce pg_receivewal gzip compression tests Message-ID: References: <07BK3Mk5aEOsTwGaY77qBVyf9GjoEzn8TMgHLyPGfEFPIpTEmoQuP2P4c7teesjSg-LPeUafsp1flnPeQYINMSMB_UpggJDoduB5EDYBqaQ=@protonmail.com> <9JCA0-R5_v1ayPfI36e8HMfoVP4FPcL2PqDfC09iyeaWYFyXsfKjnIuk2EYxIVBMkiqwOPSvDHOj3jnuWCaKwmHqAkyPpcPWi78EtPulyc0=@pm.me> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Khi+z4XZfyZ5l8UN" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Khi+z4XZfyZ5l8UN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jul 13, 2021 at 06:36:59AM +0000, gkokolatos@pm.me wrote: > I am sorry this was not so clear. It is indeed running twice the binary > with different flags. However the goal is not to check the flags, but > to make certain that the partial file has now been completed. That is > why there was code asserting that the previous FILENAME.gz.partial file > after the second invocation is converted to FILENAME.gz. The first run you are adding checks the same thing thanks to pg_switch_wal(), where pg_receivewal completes the generation of 000000010000000000000002.gz and finishes with 000000010000000000000003.gz.partial. > Additionally the second invocation of pg_receivewal is extending the > coverage of FindStreamingStart(). Hmm. It looks like a waste in runtime once we mix LZ4 in that as that would mean 5 runs of pg_receivewal, but we really need only three of them with --endpos: - One with ZLIB compression. - One with LZ4 compression. - One without compression. Do you think that we could take advantage of what is now the only run of pg_receivewal --endpos for that? We could make the ZLIB checks run first, conditionally, and then let the last command with --endpos perform a full scan of the contents in $stream_dir with the .gz files already in place. The addition of LZ4 would be an extra conditional block similar to what's introduced in ZLIB, running before the last command without compression. -- Michael --Khi+z4XZfyZ5l8UN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmDtQtEACgkQnvQgOdby QH0gYA/+IjKB1+UB5yhlRZDSo4EbDTPq4f5NjlWrY/kbe4YjW1N9x4UJgvuZZVrb zklFm7SDAIT5t2Cw50MeKMzRhyWCcefHkOR+CahuQ+WF21FODFCC2FSNXgytahsi /eTPs0ITVWvm3KLtCDhqVyCaw+bdUnfKq8cI7Hkr1CsXvGq9fJRz/LZq6ORJSq1r Zht0KknYmMtS5ORCBTM09L3vDxcn4G9O8O3DqyItJD1mBiawZDkORZ656N2EFBWa T2AkMak+uFxJp/NNlgz4JclcCxhFcyKZQhFUMZmv+7Nyn1BAYt8eb2G9zcMqPwXz 7V+dSGXtkxuI3mJY0xY/U6e6kW7Jna557qd1VEpIu8vFr2Q2We/0xSLGGVVwoG/s WHRbmix/qGRr76+0uAKz7kkEJNcuWmabzgXIdEVf/FFvJimddTYbRwbmy6Vv42L+ jH1Q+S1Y61x5DEersSReHgeokVtm+01BYVY6oRaCNlvHSGksbqkc0DHe0b7/vffC s/3CjXSz1jHS5tf6qmaMWT53/fdgy+PK7uni7+tEo7VHAajEpXlF78aE9cwEr3qx wsEw+Qn8ulZc1VF39NhLB+GbEmeCU82WsTE8MI5gXMCLXVv37fmrXWOt8cHs+n5B pOMumu/BSEFUwdGGLebuDHoyNA1ZuzkDpuFkQc+5irQY7nM0o5c= =OfBP -----END PGP SIGNATURE----- --Khi+z4XZfyZ5l8UN--