From 6a8b31f866308362b76287da47473a13d279d4a6 Mon Sep 17 00:00:00 2001 From: Pallavi Sontakke Date: Tue, 28 May 2024 19:11:20 +0530 Subject: [PATCH] Release 2.15.1 (#6970) This release contains performance improvements and bug fixes since the 2.15.0 release. Best practice is to upgrade at the next available opportunity. **Migrating from self-hosted TimescaleDB v2.14.x and earlier** After you run `ALTER EXTENSION`, you must run [this SQL script](https://github.com/timescale/timescaledb-extras/blob/master/utils/2.15.X-fix_hypertable_foreign_keys.sql). For more details, see the following pull request [#6797](https://github.com/timescale/timescaledb/pull/6797). If you are migrating from TimescaleDB v2.15.0, no changes are required. **Bugfixes** * #6540: Segmentation fault when you backfill data using COPY into a compressed chunk. * #6858: `BEFORE UPDATE` trigger not working correctly. * #6908: Fix `time_bucket_gapfill()` with timezone behaviour around daylight savings time (DST) switches. * #6911: Fix dropped chunk metadata removal in the update script. * #6940: Fix `pg_upgrade` failure by removing `regprocedure` from the catalog table. * #6957: Fix the `segfault` in UNION queries that contain ordering on compressed chunks. **Thanks** * @DiAifU, @kiddhombre and @intermittentnrg for reporting the issues with gapfill and daylight saving time. * @edgarzamora for reporting the issue with update triggers. * @hongquan for reporting the issue with the update script. * @iliastsa and @SystemParadox for reporting the issue with COPY into a compressed chunk. --- .unreleased/fix_6858 | 2 - .unreleased/fix_6940 | 1 - .unreleased/fix_compressed_copy_segfault | 2 - .unreleased/pr_6908 | 2 - .unreleased/pr_6911 | 2 - .unreleased/pr_6957 | 1 - CHANGELOG.md | 30 ++++++++++++++- sql/CMakeLists.txt | 8 ++-- sql/updates/2.15.0--2.15.1.sql | 49 ++++++++++++++++++++++++ sql/updates/2.15.1--2.15.0.sql | 48 +++++++++++++++++++++++ sql/updates/latest-dev.sql | 49 ------------------------ sql/updates/reverse-dev.sql | 48 ----------------------- version.config | 6 +-- 13 files changed, 134 insertions(+), 114 deletions(-) delete mode 100644 .unreleased/fix_6858 delete mode 100644 .unreleased/fix_6940 delete mode 100644 .unreleased/fix_compressed_copy_segfault delete mode 100644 .unreleased/pr_6908 delete mode 100644 .unreleased/pr_6911 delete mode 100644 .unreleased/pr_6957 create mode 100644 sql/updates/2.15.0--2.15.1.sql create mode 100644 sql/updates/2.15.1--2.15.0.sql diff --git a/.unreleased/fix_6858 b/.unreleased/fix_6858 deleted file mode 100644 index df8794453d0..00000000000 --- a/.unreleased/fix_6858 +++ /dev/null @@ -1,2 +0,0 @@ -Fixes: #6858 Before update trigger not working correctly -Thanks: @edgarzamora for reporting issue with update triggers diff --git a/.unreleased/fix_6940 b/.unreleased/fix_6940 deleted file mode 100644 index 70f4bafe739..00000000000 --- a/.unreleased/fix_6940 +++ /dev/null @@ -1 +0,0 @@ -Fixes: #6940 Fix `pg_upgrade` failure by removing `regprocedure` from catalog table diff --git a/.unreleased/fix_compressed_copy_segfault b/.unreleased/fix_compressed_copy_segfault deleted file mode 100644 index 4146a20a6a3..00000000000 --- a/.unreleased/fix_compressed_copy_segfault +++ /dev/null @@ -1,2 +0,0 @@ -Fixes: #6540 Segmentation fault when backfilling data with COPY into a compressed chunk -Thanks: @iliastsa and @SystemParadox for reporting an issue with COPY into a compressed chunk diff --git a/.unreleased/pr_6908 b/.unreleased/pr_6908 deleted file mode 100644 index 812eafc9712..00000000000 --- a/.unreleased/pr_6908 +++ /dev/null @@ -1,2 +0,0 @@ -Fixes: #6908 Fix gapfill with timezone behaviour around dst switches -Thanks: @DiAifU, @kiddhombre and @intermittentnrg for reporting issues with gapfill and daylight saving time diff --git a/.unreleased/pr_6911 b/.unreleased/pr_6911 deleted file mode 100644 index 27cf979453f..00000000000 --- a/.unreleased/pr_6911 +++ /dev/null @@ -1,2 +0,0 @@ -Fixes: #6911 Fix dropped chunk metadata removal in update script -Thanks: @hongquan for reporting an issue with the update script diff --git a/.unreleased/pr_6957 b/.unreleased/pr_6957 deleted file mode 100644 index b213f137e2a..00000000000 --- a/.unreleased/pr_6957 +++ /dev/null @@ -1 +0,0 @@ -Fixes: #6957 Fix segfault in UNION queries with ordering on compressed chunks diff --git a/CHANGELOG.md b/CHANGELOG.md index 66792787420..5ad442cb81f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,32 @@ `psql` with the `-X` flag to prevent any `.psqlrc` commands from accidentally triggering the load of a previous DB version.** +## 2.15.1 (2024-05-28) + +This release contains performance improvements and bug fixes since +the 2.15.0 release. Best practice is to upgrade at the next +available opportunity. + +**Migrating from self-hosted TimescaleDB v2.14.x and earlier** + +After you run `ALTER EXTENSION`, you must run [this SQL script](https://github.com/timescale/timescaledb-extras/blob/master/utils/2.15.X-fix_hypertable_foreign_keys.sql). For more details, see the following pull request [#6797](https://github.com/timescale/timescaledb/pull/6797). + +If you are migrating from TimescaleDB v2.15.0, no changes are required. + +**Bugfixes** +* #6540: Segmentation fault when you backfill data using COPY into a compressed chunk. +* #6858: `BEFORE UPDATE` trigger not working correctly. +* #6908: Fix `time_bucket_gapfill()` with timezone behaviour around daylight savings time (DST) switches. +* #6911: Fix dropped chunk metadata removal in the update script. +* #6940: Fix `pg_upgrade` failure by removing `regprocedure` from the catalog table. +* #6957: Fix the `segfault` in UNION queries that contain ordering on compressed chunks. + +**Thanks** +* @DiAifU, @kiddhombre and @intermittentnrg for reporting the issues with gapfill and daylight saving time. +* @edgarzamora for reporting the issue with update triggers. +* @hongquan for reporting the issue with the update script. +* @iliastsa and @SystemParadox for reporting the issue with COPY into a compressed chunk. + ## 2.15.0 (2024-05-08) This release contains performance improvements and bug fixes since @@ -23,7 +49,9 @@ In addition, it includes these noteworthy features: * Recommend users to [migrate their old Continuous Aggregate format to the new one](https://docs.timescale.com/use-timescale/latest/continuous-aggregates/migrate/) because it support will be completely removed in next releases prevent them to migrate. * This is the last release supporting PostgreSQL 13. -**For on-premise users and this release only**, you will need to run [this SQL script](https://github.com/timescale/timescaledb-extras/blob/master/utils/2.15.X-fix_hypertable_foreign_keys.sql) after running `ALTER EXTENSION`. More details can be found in the pull request [#6786](https://github.com/timescale/timescaledb/pull/6797). +**Migrating from self-hosted TimescaleDB v2.14.x and earlier** + +After you run `ALTER EXTENSION`, you must run [this SQL script](https://github.com/timescale/timescaledb-extras/blob/master/utils/2.15.X-fix_hypertable_foreign_keys.sql). For more details, see the following pull request [#6797](https://github.com/timescale/timescaledb/pull/6797). **Features** * #6382 Support for time_bucket with origin and offset in CAggs diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index d7423d706d1..b9d9c2420e1 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -46,11 +46,12 @@ set(MOD_FILES updates/2.13.1--2.14.0.sql updates/2.14.0--2.14.1.sql updates/2.14.1--2.14.2.sql - updates/2.14.2--2.15.0.sql) + updates/2.14.2--2.15.0.sql + updates/2.15.0--2.15.1.sql) # The downgrade file to generate a downgrade script for the current version, as # specified in version.config -set(CURRENT_REV_FILE 2.15.0--2.14.2.sql) +set(CURRENT_REV_FILE 2.15.1--2.15.0.sql) # Files for generating old downgrade scripts. This should only include files for # downgrade from one version to its previous version since we do not support # skipping versions when downgrading. @@ -88,7 +89,8 @@ set(OLD_REV_FILES 2.14.0--2.13.1.sql 2.14.1--2.14.0.sql 2.14.2--2.14.1.sql - 2.15.0--2.14.2.sql) + 2.15.0--2.14.2.sql + 2.15.1--2.15.0.sql) set(MODULE_PATHNAME "$libdir/timescaledb-${PROJECT_VERSION_MOD}") set(LOADER_PATHNAME "$libdir/timescaledb") diff --git a/sql/updates/2.15.0--2.15.1.sql b/sql/updates/2.15.0--2.15.1.sql new file mode 100644 index 00000000000..8ea90a558a4 --- /dev/null +++ b/sql/updates/2.15.0--2.15.1.sql @@ -0,0 +1,49 @@ +CREATE TABLE _timescaledb_catalog._tmp_continuous_aggs_bucket_function AS + SELECT + mat_hypertable_id, + bucket_func::text AS bucket_func, + bucket_width, + bucket_origin, + bucket_offset, + bucket_timezone, + bucket_fixed_width + FROM + _timescaledb_catalog.continuous_aggs_bucket_function + ORDER BY + mat_hypertable_id; + +ALTER EXTENSION timescaledb + DROP TABLE _timescaledb_catalog.continuous_aggs_bucket_function; + +DROP TABLE _timescaledb_catalog.continuous_aggs_bucket_function; + +CREATE TABLE _timescaledb_catalog.continuous_aggs_bucket_function ( + mat_hypertable_id integer NOT NULL, + -- The bucket function + bucket_func text NOT NULL, + -- `bucket_width` argument of the function, e.g. "1 month" + bucket_width text NOT NULL, + -- optional `origin` argument of the function provided by the user + bucket_origin text, + -- optional `offset` argument of the function provided by the user + bucket_offset text, + -- optional `timezone` argument of the function provided by the user + bucket_timezone text, + -- fixed or variable sized bucket + bucket_fixed_width bool NOT NULL, + -- table constraints + CONSTRAINT continuous_aggs_bucket_function_pkey PRIMARY KEY (mat_hypertable_id), + CONSTRAINT continuous_aggs_bucket_function_mat_hypertable_id_fkey FOREIGN KEY (mat_hypertable_id) REFERENCES _timescaledb_catalog.hypertable (id) ON DELETE CASCADE, + CONSTRAINT continuous_aggs_bucket_function_func_check CHECK (pg_catalog.to_regprocedure(bucket_func) IS DISTINCT FROM 0) +); + +INSERT INTO _timescaledb_catalog.continuous_aggs_bucket_function + SELECT * FROM _timescaledb_catalog._tmp_continuous_aggs_bucket_function; + +DROP TABLE _timescaledb_catalog._tmp_continuous_aggs_bucket_function; + +SELECT pg_catalog.pg_extension_config_dump('_timescaledb_catalog.continuous_aggs_bucket_function', ''); + +GRANT SELECT ON TABLE _timescaledb_catalog.continuous_aggs_bucket_function TO PUBLIC; + +ANALYZE _timescaledb_catalog.continuous_aggs_bucket_function; diff --git a/sql/updates/2.15.1--2.15.0.sql b/sql/updates/2.15.1--2.15.0.sql new file mode 100644 index 00000000000..344a796df29 --- /dev/null +++ b/sql/updates/2.15.1--2.15.0.sql @@ -0,0 +1,48 @@ +CREATE TABLE _timescaledb_catalog._tmp_continuous_aggs_bucket_function AS + SELECT + mat_hypertable_id, + pg_catalog.to_regprocedure(bucket_func) AS bucket_func, + bucket_width, + bucket_origin, + bucket_offset, + bucket_timezone, + bucket_fixed_width + FROM + _timescaledb_catalog.continuous_aggs_bucket_function + ORDER BY + mat_hypertable_id; + +ALTER EXTENSION timescaledb + DROP TABLE _timescaledb_catalog.continuous_aggs_bucket_function; + +DROP TABLE _timescaledb_catalog.continuous_aggs_bucket_function; + +CREATE TABLE _timescaledb_catalog.continuous_aggs_bucket_function ( + mat_hypertable_id integer NOT NULL, + -- The bucket function + bucket_func regprocedure NOT NULL, + -- `bucket_width` argument of the function, e.g. "1 month" + bucket_width text NOT NULL, + -- optional `origin` argument of the function provided by the user + bucket_origin text, + -- optional `offset` argument of the function provided by the user + bucket_offset text, + -- optional `timezone` argument of the function provided by the user + bucket_timezone text, + -- fixed or variable sized bucket + bucket_fixed_width bool NOT NULL, + -- table constraints + CONSTRAINT continuous_aggs_bucket_function_pkey PRIMARY KEY (mat_hypertable_id), + CONSTRAINT continuous_aggs_bucket_function_mat_hypertable_id_fkey FOREIGN KEY (mat_hypertable_id) REFERENCES _timescaledb_catalog.hypertable (id) ON DELETE CASCADE +); + +INSERT INTO _timescaledb_catalog.continuous_aggs_bucket_function + SELECT * FROM _timescaledb_catalog._tmp_continuous_aggs_bucket_function; + +DROP TABLE _timescaledb_catalog._tmp_continuous_aggs_bucket_function; + +SELECT pg_catalog.pg_extension_config_dump('_timescaledb_catalog.continuous_aggs_bucket_function', ''); + +GRANT SELECT ON TABLE _timescaledb_catalog.continuous_aggs_bucket_function TO PUBLIC; + +ANALYZE _timescaledb_catalog.continuous_aggs_bucket_function; diff --git a/sql/updates/latest-dev.sql b/sql/updates/latest-dev.sql index 8ea90a558a4..e69de29bb2d 100644 --- a/sql/updates/latest-dev.sql +++ b/sql/updates/latest-dev.sql @@ -1,49 +0,0 @@ -CREATE TABLE _timescaledb_catalog._tmp_continuous_aggs_bucket_function AS - SELECT - mat_hypertable_id, - bucket_func::text AS bucket_func, - bucket_width, - bucket_origin, - bucket_offset, - bucket_timezone, - bucket_fixed_width - FROM - _timescaledb_catalog.continuous_aggs_bucket_function - ORDER BY - mat_hypertable_id; - -ALTER EXTENSION timescaledb - DROP TABLE _timescaledb_catalog.continuous_aggs_bucket_function; - -DROP TABLE _timescaledb_catalog.continuous_aggs_bucket_function; - -CREATE TABLE _timescaledb_catalog.continuous_aggs_bucket_function ( - mat_hypertable_id integer NOT NULL, - -- The bucket function - bucket_func text NOT NULL, - -- `bucket_width` argument of the function, e.g. "1 month" - bucket_width text NOT NULL, - -- optional `origin` argument of the function provided by the user - bucket_origin text, - -- optional `offset` argument of the function provided by the user - bucket_offset text, - -- optional `timezone` argument of the function provided by the user - bucket_timezone text, - -- fixed or variable sized bucket - bucket_fixed_width bool NOT NULL, - -- table constraints - CONSTRAINT continuous_aggs_bucket_function_pkey PRIMARY KEY (mat_hypertable_id), - CONSTRAINT continuous_aggs_bucket_function_mat_hypertable_id_fkey FOREIGN KEY (mat_hypertable_id) REFERENCES _timescaledb_catalog.hypertable (id) ON DELETE CASCADE, - CONSTRAINT continuous_aggs_bucket_function_func_check CHECK (pg_catalog.to_regprocedure(bucket_func) IS DISTINCT FROM 0) -); - -INSERT INTO _timescaledb_catalog.continuous_aggs_bucket_function - SELECT * FROM _timescaledb_catalog._tmp_continuous_aggs_bucket_function; - -DROP TABLE _timescaledb_catalog._tmp_continuous_aggs_bucket_function; - -SELECT pg_catalog.pg_extension_config_dump('_timescaledb_catalog.continuous_aggs_bucket_function', ''); - -GRANT SELECT ON TABLE _timescaledb_catalog.continuous_aggs_bucket_function TO PUBLIC; - -ANALYZE _timescaledb_catalog.continuous_aggs_bucket_function; diff --git a/sql/updates/reverse-dev.sql b/sql/updates/reverse-dev.sql index 344a796df29..e69de29bb2d 100644 --- a/sql/updates/reverse-dev.sql +++ b/sql/updates/reverse-dev.sql @@ -1,48 +0,0 @@ -CREATE TABLE _timescaledb_catalog._tmp_continuous_aggs_bucket_function AS - SELECT - mat_hypertable_id, - pg_catalog.to_regprocedure(bucket_func) AS bucket_func, - bucket_width, - bucket_origin, - bucket_offset, - bucket_timezone, - bucket_fixed_width - FROM - _timescaledb_catalog.continuous_aggs_bucket_function - ORDER BY - mat_hypertable_id; - -ALTER EXTENSION timescaledb - DROP TABLE _timescaledb_catalog.continuous_aggs_bucket_function; - -DROP TABLE _timescaledb_catalog.continuous_aggs_bucket_function; - -CREATE TABLE _timescaledb_catalog.continuous_aggs_bucket_function ( - mat_hypertable_id integer NOT NULL, - -- The bucket function - bucket_func regprocedure NOT NULL, - -- `bucket_width` argument of the function, e.g. "1 month" - bucket_width text NOT NULL, - -- optional `origin` argument of the function provided by the user - bucket_origin text, - -- optional `offset` argument of the function provided by the user - bucket_offset text, - -- optional `timezone` argument of the function provided by the user - bucket_timezone text, - -- fixed or variable sized bucket - bucket_fixed_width bool NOT NULL, - -- table constraints - CONSTRAINT continuous_aggs_bucket_function_pkey PRIMARY KEY (mat_hypertable_id), - CONSTRAINT continuous_aggs_bucket_function_mat_hypertable_id_fkey FOREIGN KEY (mat_hypertable_id) REFERENCES _timescaledb_catalog.hypertable (id) ON DELETE CASCADE -); - -INSERT INTO _timescaledb_catalog.continuous_aggs_bucket_function - SELECT * FROM _timescaledb_catalog._tmp_continuous_aggs_bucket_function; - -DROP TABLE _timescaledb_catalog._tmp_continuous_aggs_bucket_function; - -SELECT pg_catalog.pg_extension_config_dump('_timescaledb_catalog.continuous_aggs_bucket_function', ''); - -GRANT SELECT ON TABLE _timescaledb_catalog.continuous_aggs_bucket_function TO PUBLIC; - -ANALYZE _timescaledb_catalog.continuous_aggs_bucket_function; diff --git a/version.config b/version.config index b8cd6ca5842..bb6485dcd9b 100644 --- a/version.config +++ b/version.config @@ -1,3 +1,3 @@ -version = 2.15.0 -update_from_version = 2.14.2 -downgrade_to_version = 2.14.2 +version = 2.15.1 +update_from_version = 2.15.0 +downgrade_to_version = 2.15.0