Re: Teach pg_receivewal to use lz4 compression
Dilip Kumar <dilipbalaut@gmail.com>
From: Dilip Kumar <dilipbalaut@gmail.com>
To: gkokolatos@pm.me
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-06-30T06:33:55Z
Lists: pgsql-hackers
On Tue, Jun 29, 2021 at 8:15 PM <gkokolatos@pm.me> wrote:
>
> Hi,
>
> The program pg_receivewal can use gzip compression to store the received WAL.
> This patch teaches it to be able to use lz4 compression if the binary is build
> using the -llz4 flag.
+1 for the idea
Some comments/suggestions on the patch
1.
@@ -90,7 +91,8 @@ usage(void)
printf(_(" --synchronous flush write-ahead log immediately
after writing\n"));
printf(_(" -v, --verbose output verbose messages\n"));
printf(_(" -V, --version output version information, then exit\n"));
- printf(_(" -Z, --compress=0-9 compress logs with given
compression level\n"));
+ printf(_(" -I, --compress-program use this program for compression\n"));
Wouldn't it be better to call it compression method instead of
compression program?
2.
+ printf(_(" -Z, --compress=0-9 compress logs with given
compression level (available only with compress-program=zlib)\n"));
I think we can somehow use "acceleration" parameter of lz4 compression
to map on compression level, It is not direct mapping but
can't we create some internal mapping instead of completely ignoring
this option for lz4, or we can provide another option for lz4?
3. Should we also support LZ4 compression using dictionary?
--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com
Commits
-
Fix header inclusion order in pg_receivewal.c
- f512efb2d50a 15.0 landed
-
Remove useless LZ4 system call on failure when writing file header
- f79962d8264b 15.0 landed
-
Add support for LZ4 compression in pg_receivewal
- babbbb595d23 15.0 landed
-
Rework compression options of pg_receivewal
- d62bcc8b07f9 15.0 landed
-
Clarify some errors in pg_receivewal when closing WAL segments
- cddcf7842c31 15.0 landed