ERROR: unrecognized configuration parameter "wal_keep_segments"

1,310 views
Skip to first unread message

Tong Zhang

unread,
Mar 26, 2021, 12:55:08 PM3/26/21
to Barman, Backup and Recovery Manager for PostgreSQL

It looks barman has some issues with PostgreSQL 13.

wal_keep_segments has been replaced with wal_keep_size, but barman still tries to read the old parameter.

 

2021-03-26 02:05:02 EDT [34636]: [3-1] user=barman,db=postgres ERROR:  unrecognized configuration parameter "wal_keep_segments"

2021-03-26 02:05:02 EDT [34636]: [4-1] user=barman,db=postgres STATEMENT:  SHOW "wal_keep_segments"

2021-03-26 02:05:02 EDT [34636]: [5-1] user=barman,db=postgres ERROR:  current transaction is aborted, commands ignored until end of transaction block

2021-03-26 02:05:02 EDT [34636]: [6-1] user=barman,db=postgres STATEMENT:  SELECT 1 

Any suggestions on this?


Thanks,

Tong

Luca Ferrari

unread,
Mar 27, 2021, 1:44:58 PM3/27/21
to Barman, Backup and Recovery Manager for PostgreSQL
On Fri, Mar 26, 2021 at 5:55 PM Tong Zhang <zt1...@gmail.com> wrote:
>
> It looks barman has some issues with PostgreSQL 13.
>
> wal_keep_segments has been replaced with wal_keep_size, but barman still tries to read the old parameter.

Barman 2.11 added support for PostgreSQL 13
(<https://sourceforge.net/projects/pgbarman/files/2.11/>).
What version are you using?

Luca

Tong Zhang

unread,
Mar 27, 2021, 9:53:55 PM3/27/21
to Barman, Backup and Recovery Manager for PostgreSQL
barman version: 2.12
pg server version: 13.2

I compared postgres.py in github with the source files downloaded from sourceforge (https://sourceforge.net/projects/pgbarman/files/)

$ diff postgres.py.github postgres.py.sourceforge.2.11
830,835c830
<                 # Retrieve wal_keep_segments from version 9.0 onwards, until
<                 # version 13.0, where it was renamed to wal_keep_size
<                 if self.server_version < 130000:
<                     pg_settings.append('wal_keep_segments')
<                 else:
<                     pg_settings.append('wal_keep_size')
---
>                 pg_settings.append('wal_keep_segments')
1587c1582
<         return function_name_map(server_version)
\ No newline at end of file
---
>         return function_name_map(server_version)

$ diff postgres.py.github postgres.py.sourceforge.2.12
830,835c830
<                 # Retrieve wal_keep_segments from version 9.0 onwards, until
<                 # version 13.0, where it was renamed to wal_keep_size
<                 if self.server_version < 130000:
<                     pg_settings.append('wal_keep_segments')
<                 else:
<                     pg_settings.append('wal_keep_size')
---
>                 pg_settings.append('wal_keep_segments')
1587c1582
<         return function_name_map(server_version)
\ No newline at end of file
---
>         return function_name_map(server_version)

It looks wal_keep_segments is still being used in both 2.11 and 2.12.

Thanks,
Tong

Luca Ferrari

unread,
Mar 29, 2021, 3:04:46 AM3/29/21
to Barman, Backup and Recovery Manager for PostgreSQL
On Sun, Mar 28, 2021 at 3:53 AM Tong Zhang <zt1...@gmail.com> wrote:
> It looks wal_keep_segments is still being used in both 2.11 and 2.12.

And it is, of course, if postgresql version is less than 13, that is
not your case.
Any chance you can try with a checked out version from the gtihub repository?
Sounds to me like you have different versions installed and you are
using the wrn one, could it be?

Luca

Tong Zhang

unread,
Mar 29, 2021, 4:55:41 AM3/29/21
to Barman, Backup and Recovery Manager for PostgreSQL
I don't think I'm using a wrong version.
Could you please download 2.11 and 2.12 from https://sourceforge.net/projects/pgbarman/files/ and take a look at postgres.py?
As I mentioned in my previous email, you will find both versions are using wal_keep_segments against 13.

In postgres.py downloaded from https://sourceforge.net/projects/pgbarman/files/ (2.11 or 2.12):
===============================================================================
 line 830:
                pg_settings.append('wal_keep_segments')

In postgres.py from github repo:
==========================
line 830 - 835:
                 # Retrieve wal_keep_segments from version 9.0 onwards, until
                 # version 13.0, where it was renamed to wal_keep_size
                 if self.server_version < 130000:
                     pg_settings.append('wal_keep_segments')
                 else:
                     pg_settings.append('wal_keep_size')

Thanks,
Tong

Abhijit Menon-Sen

unread,
Mar 29, 2021, 5:28:34 AM3/29/21
to pgba...@googlegroups.com
On Mon, Mar 29, 2021 at 2:25 PM Tong Zhang <zt1...@gmail.com> wrote:
>
> I don't think I'm using a wrong version.

You're not doing anything wrong. It's a bug (but a harmless one)
that's fixed in Github, and the fix will be included in 2.13, when
that is released (still WIP).

-- Abhijit

Luca Ferrari

unread,
Mar 29, 2021, 5:33:23 AM3/29/21
to Barman, Backup and Recovery Manager for PostgreSQL
This is the commit
<https://github.com/EnterpriseDB/barman/commit/45ccd9d2f315ec208eee778eba1333c0aa4a4460>.
I suggest to shut down the sourceforge repository, since I still have
a pgbarman repo and spent a few minutes in trying to understand why I
was not able to find such commit.

Luca
Reply all
Reply to author
Forward
0 new messages