Upgrade Timescale version on replica server

After upgrading the minor version of Timescale on the primary server from 2.12 to 2.13 I get the following error on the read-only replica server:

´´´
# \dt
ERROR: could not access file “$libdir/timescaledb-2.13.0”: No such file or directory
´´´

Some details on the environment:

  • Operating system: Rocky Linux 9.3
  • Postgres version: 15.4 (primary) 15.5 (replica)
  • Data is ingested on the primary server then transferred to a hot-standby (read only) via streaming replication

First upgraded Timeascaledb on the primary from 2.12.x to 2.13.0 as per the instructions for minor version upgrades in the manual, no problems encountered here.
On the hot standby server I then noticed the error message ‘could not access file “$libdir/timescaledb-2.13.0”: No such file or directory’ whenever I tried to do a query in psql (queries from our applications still work as before). I then upgraded the Timescaledb package to v2.13.0 on the hot standby server, the error still persisted. Next I tried running ´ALTER EXTENSION timescaledb UPDATE;´ on the standby server but since the server is read-only this failed with ´cannot execute ALTER EXTENSION in a read-only transaction´.

  • Is there a recommended procedure for upgrading Timescaledb when you have replica servers?
  • Could the problem be due to different minor Postgres versions on the servers?
  • How to recover from this, do I have to re-initialize the hot standby server?

Thanks in advance for any help on this.

-Jan Vidar

SOLVED!

Shortly after posting about the problem I spotted that there was actually a difference in the sub-minor version numbers of Timescale between the primary and hot-standby servers. Primary had 2.13.0 and standby was 2.13.1.
Turns out that the version in the repository happened to be upgraded in the few hours between updating the primary and the standby. Unfortunately I failed to notice this.
Fixed by upgrading the primary server to 2.13.1.

Lesson learnt: Always install the package on the standby server(s) first and make sure to install the same version on all servers.

Will leave this thread here since it may help others that happen to do the same mistake.

-jv