Subject: Issues with PG15beta3

From: Didier Michel <[email-masked]>
Date: Fri, 12 Aug 2022 16:52:36 +0200

Hello,

I am integrating new pg_basebackup zstd compression functionality in Barman
for compressed backup.

I do encounter two main issues when using zstd compression algorithm:

On ubuntu 18.04 :
- command exemple:  /usr/bin/pg_basebackup --dbname=dbname=replication
host=db options=-cdatestyle=iso port=5432 replication=true
user=barman_streaming
application_name=barman_streaming_backup -v --no-password
--pgdata=/var/lib/barman/main/base/20220811T162557/data --no-slot
--wal-method=none
--checkpoint=fast
 --format=tar
--compress=zstd:level=5
Interesting part is "--compress=zstd:level=5"
- pg_basebackup response:

pg_basebackup: checkpoint completed
pg_basebackup: error: this build does not support zstd compression

On Ubuntu 20.04 and 22.04:
The same command works. But When I try to introduce workers option (ie
"--compress=zstd:level=5,workers=2") it fails with following error:

pg_basebackup: checkpoint completed
pg_basebackup: error: could not set compression worker count to 2:
Unsupported parameter

Unless I have misused pg_basebackup (which is completely possible), I am
wondering if there could be an issue with PG packaging  or compilation
(especially for workers that triggers threads)

Hoping this can help deliver PG15.
Regards.

Didier Michel

---

From: Christoph Berg <[email-masked]>
Date: Fri, 12 Aug 2022 19:38:15 +0200

Re: Didier Michel
> pg_basebackup: error: this build does not support zstd compression

Hi Didier,

bionic's zstd is too old, PG requires at least 1.4.0.

libzstd-dev | 1.3.3+dfsg-2ubuntu1   | bionic          | amd64, arm64, armhf, i386, ppc64el, s390x

Christoph

---

From: Didier Michel <[email-masked]>
Date: Sat, 13 Aug 2022 13:26:23 +0200

Ho thank you Christoph I only checked pg_basebackup version

Didier

---

From: Didier Michel <[email-masked]>
Date: Mon, 22 Aug 2022 20:05:46 +0200

Do you have any ideas regarding ubuntu focal and Jammy ?

Didier

Focal?

---

From: Christoph Berg <[email-masked]>
Date: Tue, 23 Aug 2022 10:10:57 +0200

Re: Didier Michel
> Do you have any ideas regarding ubuntu focal and Jammy ?

What ideas?

Christoph

---

From: Didier Michel <[email-masked]>
Date: Tue, 23 Aug 2022 11:01:35 +0200

Sorry, I did not include previous message:
With focal and Jammy, pg_basebackup returns another error when I try to use
several workers (ie "--compress=zstd:level=5,workers=2")

I checked zstd version and it is higher then 1.4.0 (1.4.4). So I am
wondering if there is something else I should check.

Regards

---

From: Christoph Berg <[email-masked]>
Date: Tue, 23 Aug 2022 11:06:29 +0200

Re: Didier Michel
> pg_basebackup: error: could not set compression worker count to 2:

Try without the workers part? I guess that needs a yet newer zstd
version.

Christoph

---

From: Didier Michel <[email-masked]>
Date: Wed, 24 Aug 2022 10:10:18 +0200

Thank you for your feedback.

I found this on zstd code that also help a lot:
On older versions of libzstd, this option does not exist, and
trying to set it will fail. Similarly for newer versions if they
are compiled without threading support

So I will check (not sure yet how ) if zstd packaged in ubuntu Jammy is
compiled with threading support.

Thank you again for your help and time.
Didier