pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: pgsql: Add suport for server-side LZ4 base backup compression.
Date: Sun, 13 Feb 2022 12:28:31 +0900
Message-ID: <Ygh63xlK4p+mFB8T@paquier.xyz> (raw)
In-Reply-To: <2460218.1644704163@sss.pgh.pa.us>
References: <E1nIWNg-0005L1-2v@gemulon.postgresql.org>
	<Ygc51WVAFGocSu4h@paquier.xyz>
	<CA+TgmoZWEjAPK3SHxGzvEPF9CAPTLUMvkZvU_jou8sNUx_gRNA@mail.gmail.com>
	<20220212220913.wnhgd7ak32srcmzo@alap3.anarazel.de>
	<CA+Tgmobva6NRLtp=8z3V8EzmwryOdfZwBy+8NUf8aQH5B9p-1A@mail.gmail.com>
	<2460218.1644704163@sss.pgh.pa.us>

On Sat, Feb 12, 2022 at 05:16:03PM -0500, Tom Lane wrote:
> It looks to me like somebody figured it didn't need any more support
> than gzip/bzip2, which is wrong on a couple of grounds:
> * hardly any modern platforms lack those, unlike lz4
> * we don't invoke either one of them during testing, only when
>   you explicitly ask to make a compressed tarball
> 
> I think adding an explicit PGAC_PATH_PROGS would be worth the cycles.

Well, this somebody is I, and the buildfarm did not blow up on any of
that so that looked rather fine.  Adding a few cycles for this check
is fine by me.  What do you think of the attached?
--
Michael

Attachments:

lz4-configure.patch (text/x-diff, 3.3K) download diff --git a/src/bin/pg_basebackup/t/020_pg_receivewal.pl b/src/bin/pg_basebackup/t/020_pg_receivewal.pl index 0e6e685aa6..88dff2e673 100644 --- a/src/bin/pg_basebackup/t/020_pg_receivewal.pl +++ b/src/bin/pg_basebackup/t/020_pg_receivewal.pl @@ -130,8 +130,7 @@ SKIP: my $gzip = $ENV{GZIP_PROGRAM}; skip "program gzip is not found in your system", 1 if ( !defined $gzip - || $gzip eq '' - || system_log($gzip, '--version') != 0); + || $gzip eq '' ); my $gzip_is_valid = system_log($gzip, '--test', @zlib_wals); is($gzip_is_valid, 0, @@ -186,8 +185,7 @@ SKIP: my $lz4 = $ENV{LZ4}; skip "program lz4 is not found in your system", 1 if ( !defined $lz4 - || $lz4 eq '' - || system_log($lz4, '--version') != 0); + || $lz4 eq '' ); my $lz4_is_valid = system_log($lz4, '-t', @lz4_wals); is($lz4_is_valid, 0, diff --git a/configure b/configure index 0d52af5529..9305555658 100755 --- a/configure +++ b/configure @@ -650,6 +650,7 @@ CFLAGS_ARMV8_CRC32C CFLAGS_SSE42 have_win32_dbghelp LIBOBJS +LZ4 UUID_LIBS LDAP_LIBS_BE LDAP_LIBS_FE @@ -13832,6 +13833,60 @@ fi fi +if test -z "$LZ4"; then + for ac_prog in lz4 +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_LZ4+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $LZ4 in + [\\/]* | ?:[\\/]*) + ac_cv_path_LZ4="$LZ4" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_LZ4="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +LZ4=$ac_cv_path_LZ4 +if test -n "$LZ4"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LZ4" >&5 +$as_echo "$LZ4" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$LZ4" && break +done + +else + # Report the value of LZ4 in configure's output in all cases. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LZ4" >&5 +$as_echo_n "checking for LZ4... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LZ4" >&5 +$as_echo "$LZ4" >&6; } +fi + if test "$with_lz4" = yes; then for ac_header in lz4.h do : diff --git a/configure.ac b/configure.ac index 2afc822b12..16167329fc 100644 --- a/configure.ac +++ b/configure.ac @@ -1485,6 +1485,7 @@ failure. It is possible the compiler isn't looking in the proper directory. Use --without-zlib to disable zlib support.])]) fi +PGAC_PATH_PROGS(LZ4, lz4) if test "$with_lz4" = yes; then AC_CHECK_HEADERS(lz4.h, [], [AC_MSG_ERROR([lz4.h header file is required for LZ4])]) fi diff --git a/src/Makefile.global.in b/src/Makefile.global.in index 05c54b27de..9dcd54fcbd 100644 --- a/src/Makefile.global.in +++ b/src/Makefile.global.in @@ -350,7 +350,7 @@ XGETTEXT = @XGETTEXT@ GZIP = gzip BZIP2 = bzip2 -LZ4 = lz4 +LZ4 = @LZ4@ DOWNLOAD = wget -O $@ --no-use-server-timestamps #DOWNLOAD = curl -o $@
signature.asc (application/pgp-signature, 832B) download

view thread (13+ messages)  latest in thread

Message-ID: <Ygh63xlK4p+mFB8T@paquier.xyz>
Permalink:  ../Ygh63xlK4p+mFB8T@paquier.xyz/
Also on:    postgresql.org/message-id/Ygh63xlK4p+mFB8T@paquier.xyz

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, tgl@sss.pgh.pa.us, robertmhaas@gmail.com, andres@anarazel.de, pgsql-hackers@lists.postgresql.org
  Subject: Re: pgsql: Add suport for server-side LZ4 base backup compression.
  In-Reply-To: <Ygh63xlK4p+mFB8T@paquier.xyz>
  References: <E1nIWNg-0005L1-2v@gemulon.postgresql.org> <Ygc51WVAFGocSu4h@paquier.xyz> <CA+TgmoZWEjAPK3SHxGzvEPF9CAPTLUMvkZvU_jou8sNUx_gRNA@mail.gmail.com> <20220212220913.wnhgd7ak32srcmzo@alap3.anarazel.de> <CA+Tgmobva6NRLtp=8z3V8EzmwryOdfZwBy+8NUf8aQH5B9p-1A@mail.gmail.com> <2460218.1644704163@sss.pgh.pa.us> <Ygh63xlK4p+mFB8T@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox