Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1neeSD-0007RE-KC for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Apr 2022 14:58:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1neeSB-0001B0-Jm for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Apr 2022 14:58:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1neeSB-0001Ar-8M for pgsql-hackers@lists.postgresql.org; Wed, 13 Apr 2022 14:58:43 +0000 Received: from mail-40131.protonmail.ch ([185.70.40.131]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1neeS8-0001I1-90 for pgsql-hackers@lists.postgresql.org; Wed, 13 Apr 2022 14:58:42 +0000 Date: Wed, 13 Apr 2022 14:58:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail2; t=1649861916; bh=08dRyiT9CQzuW+hlrwNMoWcm7U5OMmZWWnnp7EdzWAk=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID; b=bHyDKpFnhgoaEklfv/wcfUwuBJon/yCUU8nEb+h0y3jGiDlRm65CM3I9rx8PsoV0W HT90olwvEqZ9+goP0bjrYAIrjZGcrg2ZLiTEzQdiiiPPwHcFXVJLjmETJj8UkNBDqs X9pbAPf6jzRYWGKuJRBLF058swI7nmKTI5kwD9ZcMIOzxsUtg32ZPEHY496wuPNeuk MBrfPtv+t0OXhEzV+vhwavxsZuI48ZSkj7cQB6EK8COY2yFlPPbuT40HD/XM3/slQs cjZpRPSsD2Xx/9OdGuZaTccg140hzE6kEAAGsxeateAboLmg/rhgcLoYISjlD4oNnX 8Lal8cyfi9BtQ== To: Michael Paquier From: gkokolatos@pm.me Cc: Postgres hackers , Robert Haas Reply-To: gkokolatos@pm.me Subject: Re: Fixes for compression options of pg_receivewal and refactoring of backup_compression.{c,h} Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------- Original Message ------- On Wednesday, April 13th, 2022 at 7:25 AM, Michael Paquier wrote: > > > On Tue, Apr 12, 2022 at 06:22:48PM +0900, Michael Paquier wrote: > > > On Mon, Apr 11, 2022 at 12:46:02PM +0000, gkokolatos@pm.me wrote: > > > > > It looks good. If you choose to discard the comment regarding the use= of > > > 'method' over 'algorithm' from above, can you please use the full wor= d in the > > > variable, e.g. 'wal_compress_algorithm' instead of 'wal_compress_algo= '. I can > > > not really explain it, the later reads a bit rude. Then again that ma= y be just > > > me. > > > > Thanks. I have been able to do an extra pass on 0001 and 0002, fixing > > those naming inconsistencies with "algo" vs "algorithm" that you and > > Robert have reported, and applied them. For 0003, I'll look at it > > later. Attached is a rebase with improvements about the variable > > names. > > This has been done with the proper renames. With that in place, I see > no reason now to not be able to set the compression level as it is > possible to pass it down with the options available. This requires > only a couple of lines, as of the attached. LZ4 has a dummy structure > called LZ4F_INIT_PREFERENCES to initialize LZ4F_preferences_t, that > holds the compression level before passing it down to > LZ4F_compressBegin(), but that's available only in v1.8.3. Using it > risks lowering down the minimal version of LZ4 we are able to use now, > but replacing that with a set of memset()s is also a way to set up > things as per its documentation. > > Thoughts? It's really not hard to add compression level. However we had briefly discussed it in the original thread [1] and decided against. That is why I did not write that code. If the community thinks differently now, let me know if you would like me to offer a patch for it. Cheers, //Georgios [1] https://www.postgresql.org/message-id/flat/CABUevEwuq7XXyd4fA0W3jY9MsJu= 9B2WRbHumAA%2B3WzHrGAQjsg%40mail.gmail.com#b6456fa2adc1cdb049a57bf3587666b9