Re: Introduce pg_receivewal gzip compression tests

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Georgios <gkokolatos(at)protonmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Introduce pg_receivewal gzip compression tests
Date: 2021-07-12 06:42:15
Message-ID: YOvkR0F6i4AmmmUe@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2021-07-12 06:55:42 Re: Speed up transaction completion faster after many relations are accessed in a transaction
Previous Message Alexander Lakhin 2021-07-12 06:40:00 Re: More time spending with "delete pending"