Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Barman should automatically ignore primary_conninfo if running as primary #704

Closed
allanharry opened this issue Nov 14, 2022 · 3 comments
Closed

Comments

@allanharry
Copy link

Barman can identify if server is running as primary or standby - "barman status servername"
If running as primary then ignore primary_conninfo parameter when backup is taken on primary.
If running as standby use primary_conninfo to switch wal on primary when finalizing backup on standby.

Then you dont have to adjust conf files each time cluster doing a fail-over

Running Barman version 3.2.0

@r-chauhan16
Copy link

r-chauhan16 commented Jan 6, 2023

Hi

After the switchover to standby via repmgr. BARMAN complains about the below error. How do I overcome this?? Ideally as per the enhancement, after switchover when conninfo is pointing to primary, it should ignore primary_conninfo parameter.

BARMAN version 3.3
Error:
PostgreSQL server is standby: FAILED (conninfo should point to a standby server if primary_conninfo is set)
Primary server is not a standby: FAILED (primary_conninfo should point to a primary server, not a standby)
Primary and standby have same system ID: OK

Barman configuration
[ams]
description = "ams server config"
ssh_command = ssh postgres@host1 -q
conninfo = host=host2 user=barman port=5438 dbname=plw_ams password=*****
backup_options = concurrent_backup
backup_method = postgres
#archiver = on

streaming_archiver = on
slot_name = barman
create_slot = auto
streaming_conninfo = host=host1 user=streamuser port=5438 dbname=plw_ams password=******
path_prefix=/usr/pgsql-14/bin
primary_conninfo = host=host1 user=barman port=5438 dbname=plw_ams password=****

Thanks

@martinmarques
Copy link
Contributor

This will be alleviated in the next release

andremagui pushed a commit that referenced this issue Nov 21, 2024
When backing up a standby server, Barman performs some checks to assert
that `conninfo` is really pointing to a standby (in recovery mode) and
that `primary_conninfo` is pointing to a primary (not in recovery).

The problem, as reported in the issues #704 and #744, is that when a
failover occurs, the `conninfo` will now be pointing to a primary
instead and the checks will start failing, requiring the user to change
Barman configs manually whenever a failover occurs.

This commit fixes the issue by making such checks non-critical, which
means they will still fail but Barman will keep operating regardless.
Essentially, Barman will ignore `primary_conninfo` if `conninfo` does
not point to a standby. Warnings about this misconfiguration will also
be emited whenever running any Barman command so the user can be aware.

References: BAR-348

Signed-off-by: Gustavo William <gustavo.oliveira@enterprisedb.com>
Signed-off-by: Giulio Calacoci <giulio.calacoci@enterprisedb.com>
andremagui pushed a commit that referenced this issue Nov 21, 2024
When backing up a standby server, Barman performs some checks to assert
that `conninfo` is really pointing to a standby (in recovery mode) and
that `primary_conninfo` is pointing to a primary (not in recovery).

The problem, as reported in the issues #704 and #744, is that when a
failover occurs, the `conninfo` will now be pointing to a primary
instead and the checks will start failing, requiring the user to change
Barman configs manually whenever a failover occurs.

This commit fixes the issue by making such checks non-critical, which
means they will still fail but Barman will keep operating regardless.
Essentially, Barman will ignore `primary_conninfo` if `conninfo` does
not point to a standby. Warnings about this misconfiguration will also
be emited whenever running any Barman command so the user can be aware.

References: BAR-348

Signed-off-by: Gustavo William <gustavo.oliveira@enterprisedb.com>
Signed-off-by: Giulio Calacoci <giulio.calacoci@enterprisedb.com>
@martinmarques
Copy link
Contributor

This has been alleviated in the Barman 3.12 release that went out yesterday

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants