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 1m4G64-0003Jf-TJ for pgsql-hackers@arkaria.postgresql.org; Fri, 16 Jul 2021 05:09: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 1m4G62-0005re-R7 for pgsql-hackers@arkaria.postgresql.org; Fri, 16 Jul 2021 05:09:10 +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 1m4G61-0005rW-8M for pgsql-hackers@lists.postgresql.org; Fri, 16 Jul 2021 05:09:10 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m4G5y-0008FQ-BH for pgsql-hackers@lists.postgresql.org; Fri, 16 Jul 2021 05:09:08 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 5C075320090E; Fri, 16 Jul 2021 01:09:04 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 16 Jul 2021 01:09:04 -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=xhDHnSLeRKISqJV5PJac1WqSaW4 XQQmppB96xwSeWtU=; b=ciY1AK/E9FwK+DIKthTOJeU7Cluy5d1Z1wznbc+Cx04 Vrp7noWkxVd6yotP1kifAiXaAN9dlsePoD20bMpOvu4qc8BAhMuuyGvE10Axbeuu zCKCORGW1u8zK/T4+RtqzWmRA+Nhamn9IAmxfQBbGmjZOZNGLinTcY3pT6NMIski Oh2PnNLXv61M1C1yZh07OFMJcA28W/voLtg1d2gPq/rz+rGTM96nNz5oG3lNN+fM xJEtI3pTr/MlfxnDjg7HLN+ajLpdXUT6s0hveC9SZmyHAFLxA431L68Fm35xm4qR bHxuC3BmOgYW62/xTzSYmBQGAbuhrBNRCz+xryPakIw== 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=xhDHnS LeRKISqJV5PJac1WqSaW4XQQmppB96xwSeWtU=; b=oCXpEkoitSEu+9l9OoaGvn Ew/9a7ZZ6DythPizaNbcKpPGOL8wlxsgqL34W6AB+QTPOlg2LDdNSNJH5Fb52Urd OgkGAoyPNspixcbDnNYa2gsZSTFGrUwa+IynS+HscMrSyhBvrO4o30XjtsAFC1PW /vS3XiCaNlmBor0px08jgRPtj/LFrLKEgBOvj7ofyeuwzgVWwotpCaZdncMFbnMV zA74CdqSBWJKQ6zmlm7UjImYtlH79JZHORyCFwtHbVKJHRaRU+24Rcr1XTX8zmJc ENU4eRST2mwvW8Dsh5aNn0Mag7mDJCot5fdAGOJStX4YzeMDpGOUuicW9E3+hmWQ == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddvgdekhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepfeeuieduhfekgeffleelgfdtjeeu jeejudffteetfeeggfettdegieeliedvieffnecuffhomhgrihhnpeiilhhisgdrnhgvth enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmihgt hhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 16 Jul 2021 01:09:02 -0400 (EDT) Date: Fri, 16 Jul 2021 14:08:57 +0900 From: Michael Paquier To: gkokolatos@pm.me Cc: PostgreSQL Hackers , Andrew Dunstan Subject: Re: Introduce pg_receivewal gzip compression tests Message-ID: References: <20S0VOZrXJglfVMkn44Lks8F3gh66sHlxdes-d8XzjfcFV6VDHv9rF3_-KE2mnKTGlwoedEBz1k2UKrd2_hFBEQo2585MkrrJ-wpKWgGcBU=@pm.me> <3NaNnzcFOo6mMA50bGVOS7RNlz1IqJ8nBxvMRQw9UZFUu9zSK2taKcmmrI2B0dehIXVskeCtbtA5yTnpkPGBTJvD-55DqTjRR-nji7tML68=@pm.me> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6vvi+n+Wda2O7pEv" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --6vvi+n+Wda2O7pEv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Jul 16, 2021 at 08:59:11AM +0900, Michael Paquier wrote: > --compress is used and the sync fails for a non-compressed segment. > Looking at the code it is pretty obvious that open_walfile() is > getting confused with the handling of an existing .partial segment > while walmethods.c uses dir_data->compression in all the places that > matter. So that's a legit bug, that happens only when mixing > pg_receivewal runs for where successive runs use the compression or > non-compression modes. Ditto. After reading the code more carefully, the code is actually able to work even if it could be cleaner: 1) dir_existsfile() would check for the existence of a non-compressed, partial segment all the time. 2) If this non-compressed file was padded, the code would use open_for_write() that would open a compressed, partial segment. 3) The compressed, partial segment would be the one flushed. This behavior is rather debatable, and it would be more instinctive to me to just skip any business related to the pre-padding if compression is enabled, at the cost of one extra callback in WalWriteMethod to grab the compression level (dir_open_for_write() skips that for compression) to allow receivelog.c to handle that. But at the same time few users are going to care about that as pg_receivewal has most likely always the same set of options, so complicating this code is not really appealing either. > I am amazed that the other buildfarm members are not complaining, to > be honest. jacana runs this TAP test with MinGW and ZLIB, and does > not complain. I have spent more time on that with my own environment, and while testing I have bumped on a different issue with zlib, which was really weird. In the same scenario as above, gzdopen() has been failing for me at step 2), causing the test to loop forever. We document to use DLLs for ZLIB coming from zlib.net, but the ones available there are really outdated as far as I can see (found some called zlib.lib/dll myself, breaking Solution.pm). For now I have disabled those tests on Windows to bring back bowerbird to green, but there is something else going on here. We don't do much tests with ZLIB on Windows for pg_basebackup and pg_dump, so there may be some more issues? @Andrew: which version of ZLIB are you using on bowerbird? That's the one in c:\prog\3p64. That's a zdll.lib, right? -- Michael --6vvi+n+Wda2O7pEv Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmDxFGkACgkQnvQgOdby QH1F3w//YlB+Z3sp0K4D+FT/YZDY1qThJJ0zuqUBtrLGw9kp65p8oVE2Hpv+Yv/v zkk/brNBHQAQdtggUOw/Ynwa1vnUzAVK/d681u2VEh+UxTdOq+uWGZuODYniUdV+ L07LgPhsA+vtNtsTAo4iQZYdzyUTKs4YRbIHgGySV+l2QC7hgR9ys0OJ78X87Akq 2NH/JmznoVqZEr4i72ODkvK2G81NkUdW6M3oo06AGH2v60rHhQ3dq25kyaS7l6xL HaKYEnk0XijCZe7BbAlTq/iaTCvLCd+to5MvtUT/Y2ovWnY8ZNnT/AFZ9nKrI1jy pfsGojh2ogbn6wKugSI0He7t1sJOWks4Xa0NMryAwZuz+hSf8zF1MYn6E6junVdm g6aK3qGgJCjF1Y8lQNTgDxI0YQ6dIPYtpuHYX2GBkbf0qqtXiXirOgjkrNPpQ0x2 WC8cQKsPfqnZ+ugYboR7rSxdsBMHCmpjLXA47pS4TkQxrFplUWf9IQjRiGo3WoL8 lFNvteZ9oW6RhNzKX5QcZUaljTJqbwLRWKiElQa8Unywh0RJEZcBodJiuBgJlq2w T82w7ssL/9eKL5xMYeQlMYGI1+f01ni+GM1FxO4ujpRGy5UT/ovd3Rtvt0uMfX9K rFwsWEpXXO4vgnUHkce20MaxXrG9u9S20A44hyiLw9JgBPoNk/Q= =HFGf -----END PGP SIGNATURE----- --6vvi+n+Wda2O7pEv--