EnterpriseDB/repmgr

RepMgr standby promote issue after OS Updates

Closed this issue · 1 comments

When running the promote command we get the following error message:

/usr/pgsql-12/bin/repmgr -f /etc/repmgr/12/repmgr.conf standby promote

ERROR: get_replication_info(): unable to execute query
DETAIL:
ERROR: could not find function "get_upstream_last_seen" in file "/usr/pgsql-12/lib/repmgr.so"

DETAIL: query text is:
SELECT ts, in_recovery, last_wal_receive_lsn, last_wal_replay_lsn, last_xact_replay_timestamp, CASE WHEN (last_wal_receive_lsn = last_wal_replay_lsn) THEN 0::INT ELSE CASE WHEN last_xact_replay_timestamp IS NULL THEN 0::INT ELSE EXTRACT(epoch FROM (pg_catalog.clock_timestamp() - last_xact_replay_timestamp))::INT END END AS replication_lag_time, last_wal_receive_lsn >= last_wal_replay_lsn AS receiving_streamed_wal, wal_replay_paused, upstream_last_seen, upstream_node_id FROM ( SELECT CURRENT_TIMESTAMP AS ts, pg_catalog.pg_is_in_recovery() AS in_recovery, pg_catalog.pg_last_xact_replay_timestamp() AS last_xact_replay_timestamp, COALESCE(pg_catalog.pg_last_wal_receive_lsn(), '0/0'::PG_LSN) AS last_wal_receive_lsn, COALESCE(pg_catalog.pg_last_wal_replay_lsn(), '0/0'::PG_LSN) AS last_wal_replay_lsn, CASE WHEN pg_catalog.pg_is_in_recovery() IS FALSE THEN FALSE ELSE pg_catalog.pg_is_wal_replay_paused() END AS wal_replay_paused, CASE WHEN pg_catalog.pg_is_in_recovery() IS FALSE THEN -1 ELSE repmgr.get_upstream_last_seen() END AS upstream_last_seen, CASE WHEN pg_catalog.pg_is_in_recovery() IS FALSE THEN -1 ELSE repmgr.get_upstream_node_id() END AS upstream_node_id ) q
ERROR: unable to retrieve replication information from local node

rpm -qa | egrep "postgres|repmgr"
postgresql12-devel-12.8-1PGDG.rhel8.x86_64
repmgr_12-5.3.0-1.rhel8.x86_64
postgresql12-libs-12.8-1PGDG.rhel8.x86_64
postgresql12-12.8-1PGDG.rhel8.x86_64
postgresql12-contrib-12.8-1PGDG.rhel8.x86_64
postgresql12-server-12.8-1PGDG.rhel8.x86_64

This is fixed by running the ALTER EXTENSION repmgr UPDATE on the repmgr database.

Good case of RTFM here. Thanks!