public inbox for [email protected]  
help / color / mirror / Atom feed
[PATCH 06/10] Default to LZ4..
7+ messages / 4 participants
[nested] [flat]

* [PATCH 06/10] Default to LZ4..
@ 2021-03-12 21:35  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 7+ messages in thread

From: Justin Pryzby @ 2021-03-12 21:35 UTC (permalink / raw)

this is meant to exercise in the CIs, and not meant to be merged
---
 configure                         | 6 ++++--
 configure.ac                      | 4 ++--
 src/backend/access/transam/xlog.c | 2 +-
 src/backend/utils/misc/guc.c      | 2 +-
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/configure b/configure
index fed440adcf..8d76be00c1 100755
--- a/configure
+++ b/configure
@@ -1575,7 +1575,7 @@ Optional Packages:
   --with-system-tzdata=DIR
                           use system time zone data in DIR
   --without-zlib          do not use Zlib
-  --with-lz4              build with LZ4 support
+  --without-lz4           build without LZ4 support
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
   --with-ssl=LIB          use LIB for SSL/TLS support (openssl)
   --with-openssl          obsolete spelling of --with-ssl=openssl
@@ -8598,7 +8598,9 @@ $as_echo "#define USE_LZ4 1" >>confdefs.h
   esac
 
 else
-  with_lz4=no
+  with_lz4=yes
+
+$as_echo "#define USE_LZ4 1" >>confdefs.h
 
 fi
 
diff --git a/configure.ac b/configure.ac
index 8c454128bb..bfcdc88be0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -990,8 +990,8 @@ AC_SUBST(with_zlib)
 # LZ4
 #
 AC_MSG_CHECKING([whether to build with LZ4 support])
-PGAC_ARG_BOOL(with, lz4, no, [build with LZ4 support],
-              [AC_DEFINE([USE_LZ4], 1, [Define to 1 to build with LZ4 support. (--with-lz4)])])
+PGAC_ARG_BOOL(with, lz4, yes, [build without LZ4 support],
+              [AC_DEFINE([USE_LZ4], 1, [Define to 1 to build without LZ4 support. (--without-lz4)])])
 AC_MSG_RESULT([$with_lz4])
 AC_SUBST(with_lz4)
 
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 984ce39cc7..3657f74de9 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -99,7 +99,7 @@ bool		EnableHotStandby = false;
 bool		fullPageWrites = true;
 bool		wal_log_hints = false;
 bool		wal_compression = false;
-int			wal_compression_method = WAL_COMPRESSION_ZLIB;
+int			wal_compression_method = WAL_COMPRESSION_LZ4;
 char	   *wal_consistency_checking_string = NULL;
 bool	   *wal_consistency_checking = NULL;
 bool		wal_init_zero = true;
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index c37a8313d3..52f9cd0242 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -4728,7 +4728,7 @@ static struct config_enum ConfigureNamesEnum[] =
 			NULL
 		},
 		&wal_compression_method,
-		WAL_COMPRESSION_ZLIB, wal_compression_options,
+		WAL_COMPRESSION_LZ4, wal_compression_options,
 		NULL, NULL, NULL
 	},
 
-- 
2.17.0


--jozmn01XJZjDjM3N
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="0007-add-wal_compression_method-zstd.patch"



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: pg_upgrade: Preserve default char signedness value from old clus
@ 2025-02-21 18:20  Masahiko Sawada <[email protected]>
  0 siblings, 1 reply; 7+ messages in thread

From: Masahiko Sawada @ 2025-02-21 18:20 UTC (permalink / raw)
  To: [email protected]

pg_upgrade: Preserve default char signedness value from old cluster.

Commit 44fe30fdab6 introduced the 'default_char_signedness' field in
controlfile. Newly created database clusters always set this field to
'signed'.

This change ensures that pg_upgrade updates the
'default_char_signedness' to 'unsigned' if the source database cluster
has signedness=false. For source clusters from v17 or earlier, which
lack the 'default_char_signedness' information, pg_upgrade assumes the
source cluster was initialized on the same platform where pg_upgrade
is running. It then sets the 'default_char_signedness' value according
to the current platform's default character signedness.

Reviewed-by: Noah Misch <[email protected]>
Discussion: https://postgr.es/m/CB11ADBC-0C3F-4FE0-A678-666EE80CBB07%40amazon.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/a8238f87f980848c2d69c105555c4383e20e7670

Modified Files
--------------
src/bin/pg_upgrade/controldata.c            | 44 ++++++++++++++++++-
src/bin/pg_upgrade/pg_upgrade.c             | 28 +++++++++++++
src/bin/pg_upgrade/pg_upgrade.h             |  6 +++
src/bin/pg_upgrade/t/005_char_signedness.pl | 65 +++++++++++++++++++++++++++++
4 files changed, 142 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pgsql: pg_upgrade: Preserve default char signedness value from old clus
@ 2025-03-17 17:20  Robert Haas <[email protected]>
  parent: Masahiko Sawada <[email protected]>
  0 siblings, 1 reply; 7+ messages in thread

From: Robert Haas @ 2025-03-17 17:20 UTC (permalink / raw)
  To: Masahiko Sawada <[email protected]>; +Cc: PostgreSQL Hackers <[email protected]>

On Fri, Feb 21, 2025 at 1:20 PM Masahiko Sawada <[email protected]> wrote:
> pg_upgrade: Preserve default char signedness value from old cluster.

Hi,

I noticed that after running 'meson test --suite setup --suite
pg_upgrade', the file delete_old_cluster.sh is left behind in the
source directory, which should not happen. Everything created for the
tests should be created in the meson directories. I traced the problem
down to 005_char_signedness.pl. I believe the problem is likely that
other pg_upgrade TAP tests include this locution, whereas
005_char_signedness.pl does not:

# In a VPATH build, we'll be started in the source directory, but we want
# to run pg_upgrade in the build directory so that any files generated finish
# in it, like delete_old_cluster.{sh,bat}.
chdir ${PostgreSQL::Test::Utils::tmp_check};

Regards,

-- 
Robert Haas
EDB: http://www.enterprisedb.com





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pgsql: pg_upgrade: Preserve default char signedness value from old clus
@ 2025-03-17 22:01  Masahiko Sawada <[email protected]>
  parent: Robert Haas <[email protected]>
  0 siblings, 1 reply; 7+ messages in thread

From: Masahiko Sawada @ 2025-03-17 22:01 UTC (permalink / raw)
  To: Robert Haas <[email protected]>; +Cc: Masahiko Sawada <[email protected]>; PostgreSQL Hackers <[email protected]>

On Mon, Mar 17, 2025 at 10:20 AM Robert Haas <[email protected]> wrote:
>
> On Fri, Feb 21, 2025 at 1:20 PM Masahiko Sawada <[email protected]> wrote:
> > pg_upgrade: Preserve default char signedness value from old cluster.
>
> Hi,
>
> I noticed that after running 'meson test --suite setup --suite
> pg_upgrade', the file delete_old_cluster.sh is left behind in the
> source directory, which should not happen. Everything created for the
> tests should be created in the meson directories. I traced the problem
> down to 005_char_signedness.pl. I believe the problem is likely that
> other pg_upgrade TAP tests include this locution, whereas
> 005_char_signedness.pl does not:
>
> # In a VPATH build, we'll be started in the source directory, but we want
> # to run pg_upgrade in the build directory so that any files generated finish
> # in it, like delete_old_cluster.{sh,bat}.
> chdir ${PostgreSQL::Test::Utils::tmp_check};

Thank you for the report.

I've confirmed the issue and attached a patch to fix it.

Regards,

-- 
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com


Attachments:

  [application/octet-stream] 0001-Fix-the-test-005_char_signedness.patch (1.4K, ../../CAD21AoCB3CORap1fYVHUiAAuK7t9LGGoYqr1hm-2-LP3DR63uw@mail.gmail.com/2-0001-Fix-the-test-005_char_signedness.patch)
  download | inline diff:
From 6fe1578bcbf7f579869684a71dd463bb2939d82c Mon Sep 17 00:00:00 2001
From: Masahiko Sawada <[email protected]>
Date: Mon, 17 Mar 2025 14:52:13 -0700
Subject: [PATCH] Fix the test 005_char_signedness.

pg_upgrade test 003_char_signedness was leaving files like
delete_old_cluster.sh in the source directory for VPATH and meson
builds. The fix is to change the directory to tmp_check before running
the test.

Reported-by: Robert Haas <[email protected]>
Reviewed-by:
Discussion: http://postgr.es/m/CA+TgmoYg5e4oznn0XGoJ3+mceG1qe_JJt34rF2JLwvGS5T1hgQ@mail.gmail.com
---
 src/bin/pg_upgrade/t/005_char_signedness.pl | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/bin/pg_upgrade/t/005_char_signedness.pl b/src/bin/pg_upgrade/t/005_char_signedness.pl
index 0190747758c..17fa0d48b15 100644
--- a/src/bin/pg_upgrade/t/005_char_signedness.pl
+++ b/src/bin/pg_upgrade/t/005_char_signedness.pl
@@ -45,6 +45,11 @@ command_like(
 	qr/Default char data signedness:\s+unsigned/,
 	'updated default char signedness is unsigned in control file');
 
+# In a VPATH build, we'll be started in the source directory, but we want
+# to run pg_upgrade in the build directory so that any files generated finish
+# in it, like delete_old_cluster.{sh,bat}.
+chdir ${PostgreSQL::Test::Utils::tmp_check};
+
 # Cannot use --set-char-signedness option for upgrading from v18+
 command_checks_all(
 	[
-- 
2.43.5



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pgsql: pg_upgrade: Preserve default char signedness value from old clus
@ 2025-03-18 03:02  Robert Haas <[email protected]>
  parent: Masahiko Sawada <[email protected]>
  0 siblings, 1 reply; 7+ messages in thread

From: Robert Haas @ 2025-03-18 03:02 UTC (permalink / raw)
  To: Masahiko Sawada <[email protected]>; +Cc: Masahiko Sawada <[email protected]>; PostgreSQL Hackers <[email protected]>

On Mon, Mar 17, 2025 at 6:02 PM Masahiko Sawada <[email protected]> wrote:
> I've confirmed the issue and attached a patch to fix it.

Cool. The commit message refers to 003_char_signedness, but the test
name is 005, not 003.

-- 
Robert Haas
EDB: http://www.enterprisedb.com





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pgsql: pg_upgrade: Preserve default char signedness value from old clus
@ 2025-03-18 04:35  Masahiko Sawada <[email protected]>
  parent: Robert Haas <[email protected]>
  0 siblings, 1 reply; 7+ messages in thread

From: Masahiko Sawada @ 2025-03-18 04:35 UTC (permalink / raw)
  To: Robert Haas <[email protected]>; +Cc: Masahiko Sawada <[email protected]>; PostgreSQL Hackers <[email protected]>

On Mon, Mar 17, 2025 at 8:02 PM Robert Haas <[email protected]> wrote:
>
> On Mon, Mar 17, 2025 at 6:02 PM Masahiko Sawada <[email protected]> wrote:
> > I've confirmed the issue and attached a patch to fix it.
>
> Cool. The commit message refers to 003_char_signedness, but the test
> name is 005, not 003.

Thank you for reviewing the patch. I've pushed the patch after fixing it.


Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pgsql: pg_upgrade: Preserve default char signedness value from old clus
@ 2025-03-18 12:28  Robert Haas <[email protected]>
  parent: Masahiko Sawada <[email protected]>
  0 siblings, 0 replies; 7+ messages in thread

From: Robert Haas @ 2025-03-18 12:28 UTC (permalink / raw)
  To: Masahiko Sawada <[email protected]>; +Cc: Masahiko Sawada <[email protected]>; PostgreSQL Hackers <[email protected]>

On Tue, Mar 18, 2025 at 12:36 AM Masahiko Sawada <[email protected]> wrote:
> > Cool. The commit message refers to 003_char_signedness, but the test
> > name is 005, not 003.
>
> Thank you for reviewing the patch. I've pushed the patch after fixing it.

Thanks for taking care of it (and so quickly!).

-- 
Robert Haas
EDB: http://www.enterprisedb.com





^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2025-03-18 12:28 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-03-12 21:35 [PATCH 06/10] Default to LZ4.. Justin Pryzby <[email protected]>
2025-02-21 18:20 pgsql: pg_upgrade: Preserve default char signedness value from old clus Masahiko Sawada <[email protected]>
2025-03-17 17:20 ` Re: pgsql: pg_upgrade: Preserve default char signedness value from old clus Robert Haas <[email protected]>
2025-03-17 22:01   ` Re: pgsql: pg_upgrade: Preserve default char signedness value from old clus Masahiko Sawada <[email protected]>
2025-03-18 03:02     ` Re: pgsql: pg_upgrade: Preserve default char signedness value from old clus Robert Haas <[email protected]>
2025-03-18 04:35       ` Re: pgsql: pg_upgrade: Preserve default char signedness value from old clus Masahiko Sawada <[email protected]>
2025-03-18 12:28         ` Re: pgsql: pg_upgrade: Preserve default char signedness value from old clus Robert Haas <[email protected]>

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