From bd912e5bf55c28abcf57f4b340650a53d083ad39 Mon Sep 17 00:00:00 2001 From: wuyuechuan Date: Tue, 4 Jul 2023 17:04:39 +0800 Subject: [PATCH] gs_probackup: Multithread backup supports pglz compression --- src/bin/pg_probackup/pg_lzcompress.cpp | 4 ++-- src/bin/pg_probackup/pg_probackup.cpp | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/bin/pg_probackup/pg_lzcompress.cpp b/src/bin/pg_probackup/pg_lzcompress.cpp index 32d01f5b79..bd3571a57c 100644 --- a/src/bin/pg_probackup/pg_lzcompress.cpp +++ b/src/bin/pg_probackup/pg_lzcompress.cpp @@ -252,8 +252,8 @@ const PGLZ_Strategy *const PGLZ_strategy_always = &strategy_always_data; * Statically allocated work arrays for history * ---------- */ -static int16 hist_start[PGLZ_MAX_HISTORY_LISTS]; -static PGLZ_HistEntry hist_entries[PGLZ_HISTORY_SIZE + 1]; +static THR_LOCAL int16 hist_start[PGLZ_MAX_HISTORY_LISTS]; +static THR_LOCAL PGLZ_HistEntry hist_entries[PGLZ_HISTORY_SIZE + 1]; /* * Element 0 in hist_entries is unused, and means 'invalid'. Likewise, diff --git a/src/bin/pg_probackup/pg_probackup.cpp b/src/bin/pg_probackup/pg_probackup.cpp index f0275344cf..64da319438 100644 --- a/src/bin/pg_probackup/pg_probackup.cpp +++ b/src/bin/pg_probackup/pg_probackup.cpp @@ -923,10 +923,7 @@ compress_init(void) #ifndef HAVE_LIBZ if (instance_config.compress_alg == ZLIB_COMPRESS) elog(ERROR, "This build does not support zlib compression"); - else #endif - if (instance_config.compress_alg == PGLZ_COMPRESS && num_threads > 1) - elog(ERROR, "Multithread backup does not support pglz compression"); } } -- Gitee