Re: Introduce pg_receivewal gzip compression tests
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Georgios <gkokolatos@protonmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-07-12T06:42:15Z
Lists: pgsql-hackers
On Fri, Jul 09, 2021 at 11:26:58AM +0000, Georgios wrote:
> As suggested on a different thread [1], pg_receivewal can increase it's test
> coverage. There exists a non trivial amount of code that handles gzip
> compression. The current patch introduces tests that cover creation of gzip
> compressed WAL files and the handling of gzip partial segments. Finally the
> integrity of the compressed files is verified.
+ # Verify compressed file's integrity
+ my $gzip_is_valid = system_log('gzip', '--test', $gzip_wals[0]);
+ is($gzip_is_valid, 0, "program gzip verified file's integrity");
libz and gzip are usually split across different packages, hence there
is no guarantee that this command is always available (same comment as
for LZ4 from a couple of days ago).
+ [
+ 'pg_receivewal', '-D', $stream_dir, '--verbose',
+ '--endpos', $nextlsn, '-Z', '5'
+ ],
I would keep the compression level to a minimum here, to limit CPU
usage but still compress something faster.
+ # Verify compressed file's integrity
+ my $gzip_is_valid = system_log('gzip', '--test', $gzip_wals[0]);
+ is($gzip_is_valid, 0, "program gzip verified file's integrity");
Shouldn't this be coded as a loop going through @gzip_wals?
--
Michael
Commits
-
Re-enable TAP tests of pg_receivewal for ZLIB on Windows
- 91d395f47aa9 15.0 landed
-
Fix some issues with WAL segment opening for pg_receivewal --compress
- 11dbad74c104 10.18 landed
- 795a9166e2e1 11.13 landed
- b9a0de15eb29 12.8 landed
- fb2b86015a9f 13.4 landed
- 3a0d2d0cbaf3 14.0 landed
- 7fbe0c8c4d4f 15.0 landed
-
Disable tests involving ZLIB on Windows for pg_receivewal
- 6cea447e6a10 15.0 landed
-
Fix portability issue with gzip in TAP test of pg_receivewal
- 0da3c1bc3f72 15.0 landed
-
Add TAP tests for ZLIB compression for pg_receivewal
- ffc9ddaea33f 15.0 landed