Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w4TDS-002E52-0n for pgsql-hackers@arkaria.postgresql.org; Mon, 23 Mar 2026 00:32:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w4TDQ-00EbxQ-1v for pgsql-hackers@arkaria.postgresql.org; Mon, 23 Mar 2026 00:32:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w4TDP-00EbxH-21 for pgsql-hackers@lists.postgresql.org; Mon, 23 Mar 2026 00:32:20 +0000 Received: from fout-b3-smtp.messagingengine.com ([202.12.124.146]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w4TDM-00000000ZYi-25dE for pgsql-hackers@lists.postgresql.org; Mon, 23 Mar 2026 00:32:19 +0000 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.stl.internal (Postfix) with ESMTP id 3E26F1D0019F; Sun, 22 Mar 2026 20:32:14 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Sun, 22 Mar 2026 20:32:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1774225934; x=1774312334; bh=WFYSRhMzc8 UXd4fl60w8PuUEwbZ5FUNVyUnfCnlRJaQ=; b=kolumcc0iAyE8j/ZME0lH/tNR+ bIclsfuPUE75sJL8fG7pfUCDWSq+FBI1DsoBVS36AeT0hszX3Up8fjEIiaZeHgnn oDHXtZIStfy1RE6QIT5uh+W3x8faEu6KfmBCEePo63N7xkggYTv+pTMeorQ8Pebc QWLG/ntS5VyvGMfCJ9ebVG/m9AtnzyPOQwAhp4J2q3lfiExT6tiaWA96vUU6vvJ8 Cqy+25CH+o9roMCDyfBUktjww7CQSAsluB1+xynqgU77CumbdQiZDxU383p2tQ9K ghhfo934AmJlAwrnpg31z+epeF3RSzHZMCFT132G3ViTToqIVgHxzT+D4snA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1774225934; x=1774312334; bh=WFYSRhMzc8UXd4fl60w8PuUEwbZ5FUNVyUn fCnlRJaQ=; b=U3FzaWlXx8GvgzRBH2o+s2EaWXWfK3LfQm0/1hnxAK8UB+IODFP nLS5WWP/yxb+czGSGdpDlcOtDy8HpTwgEvYvhMwVMt6HTOc3BCprAUXme2JvnU7x ALrF3U5U7ATLmjI6URYU1Fc5ln27IPDiGyA/vFFAE6OpXoQHOzxYXeHo/2FfiuvD 9jQJ4S1Ir+a4wC8wo3FKhAQjYw5QAb6xu+07ukdMpeHyBvIP1cYJrCwiA4ojyrbC uf/RdGdeI/wgBaBEJwuv2LVq+TIK2sqkmfLWJlVjsu4rsFprVBuRLrZ4/1knlH6m /4e8GhI1d6RBuHY8qRYOtxnr7PZkSDeloLw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdefudejvdehucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvve fukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhi vghruceomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnh epteelieefudffhffhtdetleeggeegfffhkeeuveetiefgudduvedutefggeeivdejnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrg gvlhesphgrqhhuihgvrhdrgiihiidpnhgspghrtghpthhtohepvddpmhhouggvpehsmhht phhouhhtpdhrtghpthhtohephihjhhhjshhtiiesghhmrghilhdrtghomhdprhgtphhtth hopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhr gh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 22 Mar 2026 20:32:12 -0400 (EDT) Date: Mon, 23 Mar 2026 09:31:36 +0900 From: Michael Paquier To: Jianghua Yang Cc: pgsql-hackers@lists.postgresql.org Subject: Re: basebackup: add missing deflateEnd() in gzip compression sink Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="813im3pBb72QsgIe" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --813im3pBb72QsgIe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Mar 21, 2026 at 02:22:25PM -0700, Jianghua Yang wrote: > v1-0001: basebackup: add missing deflateEnd() calls in gzip compression > sink After double-checking the whole code, I agree that this is a good practice to have in the tree. However, the issue is not worth bothering in back-branches as the server-side base backup gzip code relies on allocation and free callbacks, with zlib internals doing nothing with fds or more persistent states as far as I have read its code. For the current use, we'd bloat this data once per tablespace in a single base backup, safe even if the connection is persistent (missed that in my first message). What I am more worried about are future callers of this code, though, and we care about having a end() call for each matching init[2]() call in the tree in all the places that rely on gzip internals. So that's a good practice on consistency ground, at least. For these reasons, applied that on HEAD. > v1-0002: pg_basebackup: add missing close() for incremental manifest > file This one does not matter. This resource is for a backup manifest and we are talking about a single one for a single invocation of the binary. -- Michael --813im3pBb72QsgIe Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmnAiegACgkQnvQgOdby QH0kXg//RKh/HyIHeIZsowtMBiSzwY9HhwUUjgu1t9qA34+u3GcvYANotuBHIntJ eF6HiTWt4dR1DrPDaHuDSI4WlcmXxfM4D86tpUiLXPIin8xSfgCSEP4c1cGrVsrU zuAupwjwPV2b4XVotljQSYsoA8B1IbMGsaVJzZRWXyIb6NvXstOBM7KZYiCMcGiS pf2IgKKDKBfK+8QigRxgN7jkFUlfEXqb9cSuMla/79l/KNlEiqE6pHA9ocND0Cbn v17Qgoe11dpW8gGx53mbp0Gv1zkPVLo1Z99xpSoe1wHUCZSTnn0M1XrQ2fRkzqMo aC3A69W49hxaHnRtT+Ikg/HyR0jpn/TqfgdNcMXkyNBwwuz6i3azq3nFC65fn9BO XAXKFLsGr0N6nGYbDbdE8xsfX/sz2tqz1hh7QNSl85ma7LK3wCvkgO3MYswk0R0D MirtMGxXN8kSOjRI1kvdfuF468meZo4oKoto/Bu5rgyepugRNabu0jShrr3gmsEL QQ+cYxNSpG+sldnULcSzF3FIR47nPkRCZB61H0oBwVUNisnjirdl8Xv8ByVGOl3H NXcVtN00OGRuwr63o3X9d+x+KHW6nATWTlDJfUxFM2OQmvm9hd6RBKH+SPINLAGS CW8KXKp7l3eBEJgMy5RwlJvxINb26pvinxCcntJvMM46xVXjQbA= =MMzp -----END PGP SIGNATURE----- --813im3pBb72QsgIe--