Re: pg_basebackup's --gzip switch misbehaves
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers@lists.postgresql.org
Date: 2022-09-22T01:25:11Z
Lists: pgsql-hackers
Attachments
- zstd-minmax-level.patch (text/x-diff) patch
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. -- Michael
Commits
-
Make PG_TEST_NOCLEAN work for temporary directories in TAP tests
- 45cfa87e9c56 11.21 landed
- af36c13a7e92 12.16 landed
- b102e80ab822 13.12 landed
- c8987ea90cf2 14.9 landed
- 4b15868b698a 15.4 landed
- c24e9ef330ac 16.0 landed
- 8c12838001c2 17.0 landed
-
doc: document the TAP test environment variables
- c4421550fb57 16.0 landed
-
doc: update metacpan.org links to avoid redirects
- 5f80cd287c29 16.0 landed
-
Use min/max bounds defined by Zstd for compression level
- ade925e1693a 15.0 landed
- 18ac08f0b42d 16.0 landed
-
Fix incorrect value for "strategy" with deflateParams() in walmethods.c
- a9e99ff6b4ac 10.23 landed
- f01cc02259df 11.18 landed
- adb371c9cd95 12.13 landed
- a94576c377b7 13.9 landed
- 4b529f4697f3 14.6 landed
- b3c630cc9230 15.0 landed
- b447d6075db8 16.0 landed
-
Simplify handling of compression level with compression specifications
- 53332eacaff6 15.0 landed
- f352e2d08ac0 16.0 landed