From 3b48d3ae99682b70fa8ad169faa628d983e2a04d Mon Sep 17 00:00:00 2001 From: Jacob Burroughs Date: Sun, 17 Dec 2023 16:09:23 -0600 Subject: [PATCH v3 5/5] DO NOT MERGE: enable compression for CI --- src/backend/libpq/compression.c | 2 +- src/backend/utils/misc/guc_tables.c | 2 +- src/backend/utils/misc/postgresql.conf.sample | 2 +- src/common/zpq_stream.c | 3 ++- src/interfaces/libpq/fe-connect.c | 4 +++- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/backend/libpq/compression.c b/src/backend/libpq/compression.c index bd0f97b32a..cd43c6dbe4 100644 --- a/src/backend/libpq/compression.c +++ b/src/backend/libpq/compression.c @@ -17,7 +17,7 @@ #include "utils/guc_hooks.h" /* GUC variable containing the allowed compression algorithms list (separated by semicolon) */ -char *libpq_compress_algorithms = "off"; +char *libpq_compress_algorithms = "on"; pg_compress_specification libpq_compressors[COMPRESSION_ALGORITHM_COUNT]; size_t libpq_n_compressors = 0; diff --git a/src/backend/utils/misc/guc_tables.c b/src/backend/utils/misc/guc_tables.c index a98f2ccd97..ee7d993a5d 100644 --- a/src/backend/utils/misc/guc_tables.c +++ b/src/backend/utils/misc/guc_tables.c @@ -4550,7 +4550,7 @@ struct config_string ConfigureNamesString[] = GUC_REPORT }, &libpq_compress_algorithms, - "off", + "on", check_libpq_compression, assign_libpq_compression, NULL }, diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample index 0411571c02..24a4d6e05a 100644 --- a/src/backend/utils/misc/postgresql.conf.sample +++ b/src/backend/utils/misc/postgresql.conf.sample @@ -74,7 +74,7 @@ # (change requires restart) #bonjour_name = '' # defaults to the computer name # (change requires restart) -#libpq_compression = off # on to allow all supported compression +#libpq_compression = on # on to allow all supported compression # methods; off to disable all compression; # semicolon separated list of algorithms to allow some diff --git a/src/common/zpq_stream.c b/src/common/zpq_stream.c index 03ca8b7415..7c15ae89cf 100644 --- a/src/common/zpq_stream.c +++ b/src/common/zpq_stream.c @@ -221,7 +221,8 @@ zpq_choose_algorithm(ZpqStream * zpq, char msg_type, uint32 msg_len) * has not yet been enabled) for message types that would most obviously * benefit from compression */ - if (msg_len >= ZPQ_COMPRESS_THRESHOLD && (msg_type == PqMsg_CopyData || msg_type == PqMsg_DataRow || msg_type == PqMsg_Query)) + /* force enable for testing */ + if (true || (msg_len >= ZPQ_COMPRESS_THRESHOLD && (msg_type == PqMsg_CopyData || msg_type == PqMsg_DataRow || msg_type == PqMsg_Query))) { return zpq->compress_algs[0]; } diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index 5e3e226457..5b2c29376f 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -399,7 +399,7 @@ static const internalPQconninfoOption PQconninfoOptions[] = { "Replication", "D", 5, offsetof(struct pg_conn, replication)}, - {"compression", "PGCOMPRESSION", "off", NULL, + {"compression", "PGCOMPRESSION", "on", NULL, "Libpq-compression", "", 16, offsetof(struct pg_conn, compression)}, @@ -1737,6 +1737,7 @@ connectOptions2(PGconn *conn) return false; } + /* Disable to allow SanityCheck to pass if (rc == 1 && n_compressors == 0) { conn->status = CONNECTION_BAD; @@ -1745,6 +1746,7 @@ connectOptions2(PGconn *conn) "compression", conn->compression); return false; } + */ } /* -- 2.42.0