Postgresql repmgr warning does not disappear

164 views Asked by At

I've upgraded the ubuntu from 20 to 22 but now i have a problem with my repmgr

postgres@prod-sql-01:~$ repmgr cluster show
WARNING:  database "repmgr" has a collation version mismatch
DETAIL:  The database was created using collation version 2.31, but the operating system provides version 2.35.
HINT:  Rebuild all objects in this database that use the default collation and run ALTER DATABASE repmgr REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.
 ID | Name  | Role    | Status    | Upstream | Location | Priority | Timeline | Connection string
----+-------+---------+-----------+----------+----------+----------+----------+----------------------------------------------
 1  | node1 | primary | * running |          | default  | 100      | 1        | host=x.x.x.x user=repmgr dbname=repmgr
 2  | node2 | standby |   running | node1    | default  | 50       | 1        | host=y.y.y.y user=repmgr dbname=repmgr
 3  | node3 | witness | * running | node1    | default  | 0        | n/a      | host=z.z.z.z user=repmgr dbname=repmgr

I've made the following command to fix it but the error persists:

psql

postgres=# \c repmgr

WARNING:  database "repmgr" has a collation version mismatch
DETAIL:  The database was created using collation version 2.31, but the operating system provides version 2.35.
HINT:  Rebuild all objects in this database that use the default collation and run ALTER DATABASE repmgr REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.
You are now connected to database "repmgr" as user "postgres".

repmgr=# REINDEX DATABASE repmgr; ALTER DATABASE repmgr REFRESH COLLATION VERSION;

REINDEX
NOTICE:  changing version from 2.31 to 2.35
ALTER DATABASE

The log shows the version was updated but the warning keeps appearing.

What can i do or what im doing wrong?

I made the recommended as showed above and i expect to have a cluster without warnings

1

There are 1 answers

0
Lajos Arpad On

The problem was that

REINDEX DATABASE repmgr; ALTER DATABASE repmgr REFRESH COLLATION VERSION;

was only executed for the primary node, but not the other nodes:

 ID | Name  | Role    | Status    | Upstream | Location | Priority | Timeline | Connection string
----+-------+---------+-----------+----------+----------+----------+----------+----------------------------------------------
 1  | node1 | primary | * running |          | default  | 100      | 1        | host=x.x.x.x user=repmgr dbname=repmgr
 2  | node2 | standby |   running | node1    | default  | 50       | 1        | host=y.y.y.y user=repmgr dbname=repmgr
 3  | node3 | witness | * running | node1    | default  | 0        | n/a      | host=z.z.z.z user=repmgr dbname=repmgr