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

[BUG] epicli apply fails when rerun for cluster on which 'repmgr standby switchover' was performed #1846

Closed
to-bar opened this issue Nov 12, 2020 · 3 comments

Comments

@to-bar
Copy link
Contributor

to-bar commented Nov 12, 2020

Describe the bug
Epiphany assumes and requires for PostgreSQL cluster that the first inventory host is always primary node and the second standby. If roles are switched, it fails with error:

TASK [postgresql : Register primary with repmgr]
skipping: [ec2-54-208-80-28.compute-1.amazonaws.com]
fatal: [ec2-54-172-24-132.compute-1.amazonaws.com]: FAILED! => {"changed": true, "cmd": "/usr/bin/repmgr primary register -f /etc/postgresql/10/main/repmgr.conf --force --superuser=epi_repmgr_admin", "delta": "0:00:00.047723", "end": "2020-11-12 14:20:29.793961", "msg": "non-zero return code", "rc": 1, "start": "2020-11-12 14:20:29.746238", "stderr": "ERROR: server is in standby mode and cannot be registered as a primary", "stderr_lines": ["ERROR: server is in standby mode and cannot be registered as a primary"], "stdout": "", "stdout_lines": []} 

To Reproduce
Steps to reproduce the behavior:

  1. Create cluster with PostgreSQL replication enabled.
  2. Switchover database nodes, see how-to doc.
  3. Run epicli apply again (the same config as in step 1).

Expected behavior
epicli apply should not fail and allow to have switched roles.

Config files
n/a

OS (please complete the following information):

  • Found on Ubuntu

Cloud Environment (please complete the following information):

  • All

Additional context
n/a

@mkyc
Copy link
Contributor

mkyc commented Jul 16, 2021

Linked with #2074

@to-bar
Copy link
Contributor Author

to-bar commented Aug 4, 2021

This issue has been solved in PostgreSQL upgrade related feature branch but we should re-test after merging code to develop branch.

@przemyslavic przemyslavic self-assigned this Sep 9, 2021
@przemyslavic
Copy link
Collaborator

✔️ Fixed.
Successfully deployed a 3-node cluster, performed a switchover and executed epicli apply again.

@mkyc mkyc closed this as completed Sep 10, 2021
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

3 participants