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 1obD1h-0006e3-L3 for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Sep 2022 03:37:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1obD1g-0007dP-Fu for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Sep 2022 03:37:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1obD1f-0007dA-UC for pgsql-hackers@lists.postgresql.org; Thu, 22 Sep 2022 03:37:24 +0000 Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1obD1c-0004Zy-LD for pgsql-hackers@lists.postgresql.org; Thu, 22 Sep 2022 03:37:23 +0000 Received: by mail-io1-xd31.google.com with SMTP id g8so6785917iob.0 for ; Wed, 21 Sep 2022 20:37:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date; bh=++47cztdDb57YV0v+duB02Rqxw5dLqD553bWreJ3Xzc=; b=b1y/WKeuO22opdqtl24wrJ85etPASKkKn5fuRRl5PRrGvQESWkQ2ZZVWNhUNAgenzb WA5F7Mib03sMNchNhtqGym2NPH1vU8bHcybOVgz2nVTX0serfEBoB6d3hzJPllHJmVno 9wy2hnPVudFoQd6sQcxItXntDQDganfDeGNw9RkXdkB2x5EyLzKMlQxS+ZNhccV9Q/6M bFCM+vqK3Bgv6kx2XV5Bh6hWAkMWoDqOCHIF+FsH8N5Z9ZlYVZNrtlF+RRnJWkKyoUNt 0hNIWfVrCc8RXUZJH7xZe75vi+tFPEbsdlXjxpV7nfhguSorX12y6NbUul3BXYnhAw8s rkiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date; bh=++47cztdDb57YV0v+duB02Rqxw5dLqD553bWreJ3Xzc=; b=U8qu0nYT+KeNimM332W6cBLqxlI/POSM+Y+7uStgX7prs/9v2Y6PPLycPzPq0TnNy4 MjmnmBjsG03/3zZpt6xbKpxIoBbIz7lXsuu9AmmazQ2uVqe7ai2dt02SplSDFluP9Sgw FITrgTVchF/x+tG0y0IGpuSox0rTEtvHK2xagrPCB/wjPXXbnOCpn5obAcRDNDsmNTe+ 2KTQDH4soAfqD9KtRLVhdiPdn8FbM1pO7rvC/pLwdu3JyijRKe8PcslV8N4V43jxSag6 ehfFmnvkXPpHt/Dky2Kec3DPMSGbni20qqBaDyx4qBd/oZB9dfIgxUolb0t4bLrJznuE 7DsQ== X-Gm-Message-State: ACrzQf2quELox7VVJPuyPQF5jDfkhSIG/reqP8VDp+zdXfevO4VJcL9w zavULBc64n26lwFI7z0MvanGd/RDQHSe+Q== X-Google-Smtp-Source: AMsMyM5gQLksTPdabeISJijESzhVHHvYMopWGhbATFcAbg8slbu98r/hCuEjW8Dw8qSKrv97ySEehQ== X-Received: by 2002:a05:6638:d81:b0:35a:42b0:63b4 with SMTP id l1-20020a0566380d8100b0035a42b063b4mr781785jaj.51.1663817838106; Wed, 21 Sep 2022 20:37:18 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id l3-20020a026a03000000b0035a06313244sm1778270jac.26.2022.09.21.20.37.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Sep 2022 20:37:17 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 56E3A800CA7; Wed, 21 Sep 2022 22:37:16 -0500 (CDT) Date: Wed, 21 Sep 2022 22:37:16 -0500 From: Justin Pryzby To: Michael Paquier Cc: Tom Lane , pgsql-hackers@lists.postgresql.org Subject: Re: pg_basebackup's --gzip switch misbehaves Message-ID: <20220922033716.GL31833@telsasoft.com> References: <1400032.1662217889@sss.pgh.pa.us> <20220922003148.GK31833@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Sep 22, 2022 at 10:25:11AM +0900, Michael Paquier wrote: > On Wed, Sep 21, 2022 at 07:31:48PM -0500, Justin Pryzby wrote: > > I think at some point (maybe before releasing 1.3.4) the range was > > increased to very large(small), negative levels. It's possible to query > > the library about the lowest supported compression level, but then > > there's a complication regarding the client-side library version vs the > > server-side version. So it seems better to just use -7. > > Indeed. Contrary to the default level, there are no variables for the > minimum and maximum levels. As you are pointing out, a lookup at > zstd_compress.c shows that we have ZSTD_minCLevel() and > ZSTD_maxCLevel() that assign the bounds. Both are available since > 1.4.0. We still need a backend-side check as the level passed with a > BASE_BACKUP command would be only validated there. It seems to me > that this is going to be less of a headache in the long-term if we > just use those routines at runtime, as zstd wants to keep some freedom > with the min and max bounds for the compression level, at least that's > the flexibility that this gives the library. So I would tweak things > as the attached. Okay. Will that complicate tests at all? It looks like it's not an issue for the tests currently proposed in the CF APP. https://commitfest.postgresql.org/39/3835/ However the patch ends up, +0.75 to backpatch it to v15 rather than calling it a new feature in v16. -- Justin