Re: Teach pg_receivewal to use lz4 compression

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Magnus Hagander <magnus@hagander.net>, Georgios Kokolatos <gkokolatos@pm.me>, Dilip Kumar <dilipbalaut@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-11-02T23:23:46Z
Lists: pgsql-hackers
On Tue, Nov 02, 2021 at 12:31:47PM -0400, Robert Haas wrote:
> On Tue, Nov 2, 2021 at 8:17 AM Magnus Hagander <magnus@hagander.net> wrote:
>> I think for the end user, it is strictly better to name it "gzip",
>> and given that the target of this option is the end user we should
>> do so. (It'd be different it we were talking about a build-time
>> parameter to configure). 
> 
> I agree. Also, I think there's actually a file format called "zlib"
> which is slightly different from the "gzip" format, and you have to be
> careful not to generate the wrong one.

Okay, fine by me.  It would be better to be also consistent in
WalCompressionMethods once we switch to this option value, then.
--
Michael

Commits

  1. Fix header inclusion order in pg_receivewal.c

  2. Remove useless LZ4 system call on failure when writing file header

  3. Add support for LZ4 compression in pg_receivewal

  4. Rework compression options of pg_receivewal

  5. Clarify some errors in pg_receivewal when closing WAL segments