Thread

  1. repmgr(d) versions 5.5 vs 5.4 from apt.postgresql.org

    Matthias Leisi <matthias@leisi.net> — 2024-12-24T09:28:36Z

    I installed Postgres 16/17 from apt.postgresql.org <http://apt.postgresql.org/> (with the intent of using version 17) on Debian 12/Bookworm. Both have the same version of repmgr:
    
    postgres@dev-pgcl01:~$ /usr/lib/postgresql/17/bin/repmgr  --version
    repmgr 5.5.0
    postgres@dev-pgcl01:~$ /usr/lib/postgresql/16/bin/repmgr  --version
    repmgr 5.5.0
    
    root@dev-pgcl01:~# apt-cache show postgresql-17-repmgr | grep "Filename"
    Filename: pool/main/r/repmgr/postgresql-17-repmgr_5.5.0-2.pgdg120+1_arm64.deb
    
    In postgresql.conf, I explicitly load the version 17 .so (just to be sure it’s not loading something potentially different):
    
    shared_preload_libraries = '/usr/lib/postgresql/17/lib/repmgr.so'
    
    repmgr.conf is minimalistic:
    
    node_id=1
    node_name=node1
    conninfo='host=10.20.70.26 user=repmgr dbname=repmgr connect_timeout=2'
    data_directory='/var/lib/postgresql/17/'
    failover=automatic
    use_replication_slots=true
    promote_command='/usr/bin/repmgr standby promote -f /etc/postgresql/17/main/repmgr.conf --log-to-file'
    follow_command='/usr/bin/repmgr standby follow -f /etc/postgresql/17/main/repmgr.conf --log-to-file --upstream-node-id=%n‘
    
    (plus a few configs about the logs)
    
    I created the cluster with
    
    /usr/lib/postgresql/17/bin/repmgr -f /etc/postgresql/17/main/repmgr.conf primary register
    
    And it shows what I would expect:
    
    postgres@dev-pgcl01:~$ /usr/lib/postgresql/17/bin/repmgr -f /etc/postgresql/17/main/repmgr.conf cluster show
    DEBUG: connecting to: "user=repmgr connect_timeout=2 dbname=repmgr host=10.20.70.26 fallback_application_name=repmgr options=-csearch_path="
    DEBUG: connecting to: "user=repmgr connect_timeout=2 dbname=repmgr host=10.20.70.26 fallback_application_name=repmgr options=-csearch_path="
     ID | Name  | Role    | Status    | Upstream | Location | Priority | Timeline | Connection string
    ----+-------+---------+-----------+----------+----------+----------+----------+----------------------------------------------------------------------------------------
     1  | node1 | primary | * running |          | default  | 100      | 1        | host=10.20.70.26 user=repmgr dbname=repmgr connect_timeout=2
    
    
    I attempt to start repmgrd with
    
    postgres@dev-pgcl01:~$ /usr/lib/postgresql/17/bin/repmgrd -v -f /etc/postgresql/17/main/repmgr.conf --verbose
    
    Which gives the following log output:
    
    [2024-12-24 09:21:25] [NOTICE] repmgrd (repmgrd 5.5.0) starting up
    [2024-12-24 09:21:25] [INFO] connecting to database "host=10.20.70.26 user=repmgr dbname=repmgr connect_timeout=2"
    [2024-12-24 09:21:25] [DEBUG] connecting to: "user=repmgr connect_timeout=2 dbname=repmgr host=10.20.70.26 fallback_application_name=repmgr options=-csearch_path="
    [2024-12-24 09:21:25] [DEBUG] set_config():
      SET synchronous_commit TO 'local'
    [2024-12-24 09:21:25] [DEBUG] expected extension version: 50500; extension version: 50400
    [2024-12-24 09:21:25] [ERROR] this "repmgr" version is newer than the installed "repmgr" extension version
    [2024-12-24 09:21:25] [DETAIL] "repmgr" version 5.5.0 providing extension version 5.5.0 is installed but extension is version 5.4
    [2024-12-24 09:21:25] [HINT] update the installed extension version by executing "ALTER EXTENSION repmgr UPDATE" in the repmgr database
    
    
    SELECT * FROM pg_catalog.pg_extension WHERE extname = 'repmgr'
    
    shows version 5.4
    
    The suggested ALTER EXTENSION from the log hint does not do anything I could see.
    
    The same effect if I try the same using version 16.
    
    How to continue from here? What am I missing?
    
    Thanks for your help,
    — Matthias
    
    -- 
    Matthias Leisi
    Katzenrütistrasse 68, 8153 Rümlang
    Mobile +41 79 377 04 43
    matthias@leisi.net
    
    
    
    
  2. Re: repmgr(d) versions 5.5 vs 5.4 from apt.postgresql.org

    Ron <ronljohnsonjr@gmail.com> — 2024-12-24T13:29:40Z

    On Tue, Dec 24, 2024 at 4:28 AM Matthias Leisi <matthias@leisi.net> wrote:
    
    > I installed Postgres 16/17 from apt.postgresql.org (with the intent of
    > using version 17) on Debian 12/Bookworm. Both have the same version of
    > repmgr:
    >
    > postgres@dev-pgcl01:~$ /usr/lib/postgresql/17/bin/repmgr  --version
    > repmgr 5.5.0
    > postgres@dev-pgcl01:~$ /usr/lib/postgresql/16/bin/repmgr  --version
    > repmgr 5.5.0
    >
    > root@dev-pgcl01:~# apt-cache show postgresql-17-repmgr | grep "Filename"
    > Filename:
    > pool/main/r/repmgr/postgresql-17-repmgr_5.5.0-2.pgdg120+1_arm64.deb
    >
    > In postgresql.conf, I explicitly load the version 17 .so (just to be sure
    > it’s not loading something potentially different):
    >
    > shared_preload_libraries = '/usr/lib/postgresql/17/lib/repmgr.so'
    >
    > repmgr.conf is minimalistic:
    >
    > node_id=1
    > node_name=node1
    > conninfo='host=10.20.70.26 user=repmgr dbname=repmgr connect_timeout=2'
    > data_directory='/var/lib/postgresql/17/'
    > failover=automatic
    > use_replication_slots=true
    > promote_command='/usr/bin/repmgr standby promote -f
    > /etc/postgresql/17/main/repmgr.conf --log-to-file'
    > follow_command='/usr/bin/repmgr standby follow -f
    > /etc/postgresql/17/main/repmgr.conf --log-to-file --upstream-node-id=%n‘
    >
    > (plus a few configs about the logs)
    >
    > I created the cluster with
    >
    > /usr/lib/postgresql/17/bin/repmgr -f /etc/postgresql/17/main/repmgr.conf
    > primary register
    >
    > And it shows what I would expect:
    >
    > postgres@dev-pgcl01:~$ /usr/lib/postgresql/17/bin/repmgr -f
    > /etc/postgresql/17/main/repmgr.conf cluster show
    > DEBUG: connecting to: "user=repmgr connect_timeout=2 dbname=repmgr
    > host=10.20.70.26 fallback_application_name=repmgr options=-csearch_path="
    > DEBUG: connecting to: "user=repmgr connect_timeout=2 dbname=repmgr
    > host=10.20.70.26 fallback_application_name=repmgr options=-csearch_path="
    >  ID | Name  | Role    | Status    | Upstream | Location | Priority |
    > Timeline | Connection string
    >
    > ----+-------+---------+-----------+----------+----------+----------+----------+----------------------------------------------------------------------------------------
    >  1  | node1 | primary | * running |          | default  | 100      | 1
    >    | host=10.20.70.26 user=repmgr dbname=repmgr connect_timeout=2
    >
    >
    > I attempt to start repmgrd with
    >
    > postgres@dev-pgcl01:~$ /usr/lib/postgresql/17/bin/repmgrd -v -f
    > /etc/postgresql/17/main/repmgr.conf --verbose
    >
    > Which gives the following log output:
    >
    > [2024-12-24 09:21:25] [NOTICE] repmgrd (repmgrd 5.5.0) starting up
    > [2024-12-24 09:21:25] [INFO] connecting to database "host=10.20.70.26
    > user=repmgr dbname=repmgr connect_timeout=2"
    > [2024-12-24 09:21:25] [DEBUG] connecting to: "user=repmgr
    > connect_timeout=2 dbname=repmgr host=10.20.70.26
    > fallback_application_name=repmgr options=-csearch_path="
    > [2024-12-24 09:21:25] [DEBUG] set_config():
    >   SET synchronous_commit TO 'local'
    > [2024-12-24 09:21:25] [DEBUG] expected extension version: 50500; extension
    > version: 50400
    > [2024-12-24 09:21:25] [ERROR] this "repmgr" version is newer than the
    > installed "repmgr" extension version
    > [2024-12-24 09:21:25] [DETAIL] "repmgr" version 5.5.0 providing extension
    > version 5.5.0 is installed but extension is version 5.4
    > [2024-12-24 09:21:25] [HINT] update the installed extension version by
    > executing "ALTER EXTENSION repmgr UPDATE" in the repmgr database
    >
    >
    > SELECT * FROM pg_catalog.pg_extension WHERE extname = 'repmgr'
    >
    > shows version 5.4
    >
    > The suggested ALTER EXTENSION from the log hint does not do anything I
    > could see.
    >
    > The same effect if I try the same using version 16.
    >
    > How to continue from here? What am I missing?
    >
    
    This [HINT] says that YOU are supposed to run the ALTER EXTENSION command:
    [quote]
    update the installed extension version by executing "ALTER EXTENSION repmgr
    UPDATE"
    [/quote]
    
    -- 
    Death to <Redacted>, and butter sauce.
    Don't boil me, I'm still alive.
    <Redacted> lobster!
    
  3. Re: repmgr(d) versions 5.5 vs 5.4 from apt.postgresql.org

    Matthias Leisi <matthias@leisi.net> — 2024-12-24T14:04:25Z

    > 
    > This [HINT] says that YOU are supposed to run the ALTER EXTENSION command:
    > [quote]
    > update the installed extension version by executing "ALTER EXTENSION repmgr UPDATE"
    > [/quote]
    
    I did run that, but it seemed to have no effect. How should the update work, what should it do?
    
    — Matthias
    
    
    
  4. Re: repmgr(d) versions 5.5 vs 5.4 from apt.postgresql.org

    Tom Lane <tgl@sss.pgh.pa.us> — 2024-12-24T16:12:02Z

    Matthias Leisi <matthias@leisi.net> writes:
    >> This [HINT] says that YOU are supposed to run the ALTER EXTENSION command:
    
    > I did run that, but it seemed to have no effect. How should the update work, what should it do?
    
    What this suggests is that you have a repmgr executable (.so file)
    that is newer than the extension's SQL files
    (.../share/extension/repmgr.control etc).
    You need to straighten out that version mismatch.
    
    			regards, tom lane
    
    
    
    
  5. Re: repmgr(d) versions 5.5 vs 5.4 from apt.postgresql.org

    Adrian Klaver <adrian.klaver@aklaver.com> — 2024-12-24T16:49:07Z

    On 12/24/24 01:28, Matthias Leisi wrote:
    > I installed Postgres 16/17 from apt.postgresql.org 
    > <http://apt.postgresql.org> (with the intent of using version 17) on 
    > Debian 12/Bookworm. Both have the same version of repmgr:
    > 
    > postgres@dev-pgcl01:~$ /usr/lib/postgresql/17/bin/repmgr  --version
    > repmgr 5.5.0
    > postgres@dev-pgcl01:~$ /usr/lib/postgresql/16/bin/repmgr  --version
    > repmgr 5.5.0
    > 
    > root@dev-pgcl01:~# apt-cache show postgresql-17-repmgr | grep "Filename"
    > Filename: 
    > pool/main/r/repmgr/postgresql-17-repmgr_5.5.0-2.pgdg120+1_arm64.deb
    > 
    > In postgresql.conf, I explicitly load the version 17 .so (just to be 
    > sure it’s not loading something potentially different):
    > 
    > shared_preload_libraries = '/usr/lib/postgresql/17/lib/repmgr.so'
    > 
    > repmgr.conf is minimalistic:
    > 
    > node_id=1
    > node_name=node1
    > conninfo='host=10.20.70.26 user=repmgr dbname=repmgr connect_timeout=2'
    > data_directory='/var/lib/postgresql/17/'
    > failover=automatic
    > use_replication_slots=true
    > promote_command='/usr/bin/repmgr standby promote -f 
    > /etc/postgresql/17/main/repmgr.conf --log-to-file'
    > follow_command='/usr/bin/repmgr standby follow -f 
    > /etc/postgresql/17/main/repmgr.conf --log-to-file --upstream-node-id=%n‘
    > 
    > (plus a few configs about the logs)
    > 
    
    > 
    > The suggested ALTER EXTENSION from the log hint does not do anything I 
    > could see.
    > 
    > The same effect if I try the same using version 16.
    > 
    > How to continue from here? What am I missing?
    
    Maybe as shown here:
    
    https://www.repmgr.org/docs/current/configuration-file-optional-settings.html
    
    "
    pg_bindir (string)
    
         Path to the PostgreSQL binary directory (location of pg_ctl, 
    pg_basebackup etc.). Only required if these are not in the system PATH.
    
    [...]
    
      Debian/Ubuntu users: you will probably need to set this to the 
    directory where pg_ctl is located, e.g. /usr/lib/postgresql/9.6/bin/.
    "
    
    Also looks to me like there is version 5.4 installed somewhere else that 
    is being picked up. I would do a find to locate out all the repmgr 
    instances installed.
    
    
    > 
    > Thanks for your help,
    > — Matthias
    > 
    > -- 
    > Matthias Leisi
    > Katzenrütistrasse 68, 8153 Rümlang
    > Mobile +41 79 377 04 43
    > matthias@leisi.net
    > 
    > 
    > 
    
    -- 
    Adrian Klaver
    adrian.klaver@aklaver.com