timescale / timescaledb

An open-source time-series SQL database optimized for fast ingest and complex queries. Packaged as a PostgreSQL extension.
https://www.timescale.com/
Other
17.81k stars 885 forks source link

[Bug]: failed upgrade postgresql 13 to 14 #7267

Open empereira opened 1 month ago

empereira commented 1 month ago

What type of bug is this?

Incorrect result

What subsystems and features are affected?

Other

What happened?

New cluster database "postgres" is not empty: found relation "_timescaledb_catalog.hypertable" Failure, exiting

TimescaleDB version affected

2.15.3

PostgreSQL version used

13, 14

What operating system did you use?

Ubuntu 22 x64

What installation method did you use?

Deb/Apt

What platform did you run on?

On prem/Self-hosted

Relevant log output and stack trace

Performing Consistency Checks
-----------------------------
Checking cluster versions                                   ok
Checking database user is the install user                  ok
Checking database connection settings                       ok
Checking for prepared transactions                          ok
Checking for system-defined composite types in user tables  ok
Checking for reg* data types in user tables                 ok
Checking for contrib/isn with bigint-passing mismatch       ok
Checking for user-defined encoding conversions              ok
Checking for user-defined postfix operators                 ok
Checking for incompatible polymorphic functions             ok
Creating dump of global objects                             ok
Creating dump of database schemas
  postgres
  template1
  zabbix
                                                            ok

New cluster database "postgres" is not empty: found relation "_timescaledb_catalog.hypertable"
Failure, exiting

How can we reproduce the bug?

/usr/lib/postgresql/14/bin/pg_upgrade -d /etc/postgresql/13/data -D /etc/postgresql/14/data -b /usr/lib/postgresql/13/bin -B /usr/lib/postgresql/14/bin
svenklemm commented 1 month ago

Do you have some timescaledb leftovers in the template database?

jflambert commented 3 weeks ago

I went through major upgrade hell a few months ago and I think I've got it under control. Please: make sure all extensions are the same version in the "old" database! If you are using pg14-ts2.15.3 as a "NEW" DB, then also make sure all extensions in the "OLD" DB are all 2.15.3.