Files
run-llama--llama_index/docs/examples/data/csv/commit_history.csv
T
wehub-resource-sync a0c8464e58
Build Package / build (ubuntu-latest) (push) Failing after 1s
CodeQL / Analyze (python) (push) Failing after 1s
Core Typecheck / core-typecheck (push) Failing after 1s
Linting / lint (push) Failing after 1s
llama-dev tests / test-llama-dev (push) Failing after 1s
Publish Sub-Package to PyPI if Needed / publish_subpackage_if_needed (push) Has been skipped
Sync Docs to Developer Hub / sync-docs (push) Failing after 0s
Build Package / build (windows-latest) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:26:52 +08:00

1.7 MiB

1commitauthordatechange summarychange details
244e41c12ab25e36c202f58e068ced262eadc8d16Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Tue Sep 5 21:03:21 2023 +0530Fix segfault in set_integer_now_funcWhen an invalid function oid is passed to set_integer_now_func, it finds out that the function oid is invalid but before throwing the error, it calls ReleaseSysCache on an invalid tuple causing a segfault. Fixed that by removing the invalid call to ReleaseSysCache. Fixes #6037
3e66a40038e3c84fb1a68da67ad71caf75c64a027Bharathy<satish.8483@gmail.com>Sat Sep 2 09:24:31 2023 +0530Fix server crash on UPDATE of compressed chunkUPDATE query with system attributes in WHERE clause causes server to crash. This patch fixes this issue by checking for system attributes and handle cases only for segmentby attributes in fill_predicate_context(). Fixes #6024
4c6a930897e9f9e9878db031cc7fb6ea79d721a74Jan Nidzwetzki<jan@timescale.com>Tue Aug 29 21:13:51 2023 +0200Use Debian Bookworm for 32-bit testsSo far, we have used Debian Buster (10) for our 32-bit tests. This distribution is EOL in ~1 year and contains an old LLVM version (7.0). LLVM 7 contains a few bugs that break the JIT functionality of PostgreSQL (missing mixed-sign 64-bit operands on 32-bit architectures / failed to resolve name __mulodi4). This patch changes the used Distribution for 32-bit tests to Debian Bookworm (12 / LLVM 14). Since the PostgreSQL download server no longer offers 32-bit Debian packages, PostgreSQL is built from source.
58e941b80ae1b0e0b6affe5431454cdc637628d99Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Mon Aug 28 23:19:22 2023 +0530Fix incorrect row count in EXPLAIN ANALYZE INSERT .. ON CONFLICT outputINSERT ... ON CONFLICT statements record few metrics in the ModifyTable node's instrument but they get overwritten by hypertable_modify_explain causing wrong output in EXPLAIN ANALYZE statments. Fix it by saving the metrics into HypertableModify node before replacing them. Fixes #6014
6caada43454e25d3098744fa6b675ac7d07390550Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Tue May 30 20:32:29 2023 +0530PG16: Fix concurrent update issues with MERGE.PG16 commit postgres/postgres@9321c79c fixes an issue with concurrent update issues in MERGE. This patch adapts that fix into the MERGE support for hypertables as well. postgres/postgres@9321c79c
7e4facda540286b0affba47ccc63959fefe2a7b26Sven Klemm<sven@timescale.com>Tue Aug 29 18:13:24 2023 +0200Add compatibility layer for _timescaledb_internal functionsWith timescaledb 2.12 all the functions present in _timescaledb_internal were moved into the _timescaledb_functions schema to improve schema security. This patch adds a compatibility layer so external callers of these internal functions will not break and allow for more flexibility when migrating.
877dc6ed42c6d0b65dd971566c2184e9bd7008e68Jan Nidzwetzki<jan@timescale.com>Thu Aug 31 09:56:38 2023 +0200Fix non-deterministic cagg_insert isolation testOne permutation of the cagg_insert isolation test contains an assumption about the execution order of three processes after a lock is released. However, this behavior is non-deterministic. This PR makes the assumption explicit and adds proper markers to the isolation test to make the output deterministic.
908231c8aacd17152f315ad36d95c031fb46073aaJan Nidzwetzki<jan@timescale.com>Tue Aug 29 14:47:57 2023 +0200Export is_decompress_chunk_path / is_gapfill_pathThis patch adds the 'ts_' prefix to the function names of is_decompress_chunk_path and is_gapfill_path and makes them available for use by other parts of TimescaleDB.
10fa04a067e0dce3a09b229cf2e6c127984cb9896fJan Nidzwetzki<jan@timescale.com>Wed Aug 30 23:49:34 2023 +0200Fix an invalid SPI result use after freeThis PR fixes the invalid use of an SPI result after SPI_finish is called and the result is freed.
11e3437786ad7e3b5f152167ce0081e546178b8a12Sven Klemm<sven@timescale.com>Wed Aug 30 09:15:34 2023 +0200Make multinode tests conditionalSince multinode tests take a long time to run we dont want to run them in CI on individual PRs but only on nightly runs.
123b6dc7dc013572f91db181ccbbe4854f596714ddSven Klemm<sven@timescale.com>Tue Aug 29 12:52:06 2023 +0200Move partialize functions to _timescaledb_functions schemaTo increase schema security we do not want to mix our own internal objects with user objects. Since chunks are created in the _timescaledb_internal schema our internal functions should live in a different dedicated schema. This patch make the necessary adjustments for the following functions: - finalize_agg_ffunc(internal,text,name,name,name[],bytea,anyelement) - finalize_agg_sfunc(internal,text,name,name,name[],bytea,anyelement) - partialize_agg(anyelement) - finalize_agg(text,name,name,name[][],bytea,anyelement)
13623381ce99978b7f05f32ec1f5c117345ef6cd8eAlexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Tue Aug 29 12:39:17 2023 +0200Reread the catalog data after locking the chunkThe compression status can change, and this is prevented by locking, so to keep our data consistent, we should reread the chunk metadata after we have locked it. Currently we have some code in place that masks this inconsistency by rereading the metadata in another place. This code is removed.
14a9751ccd5eb030026d7b975d22753f5964972389Sven Klemm<sven@timescale.com>Tue Aug 29 10:49:47 2023 +0200Move partitioning functions to _timescaledb_functions schemaTo increase schema security we do not want to mix our own internal objects with user objects. Since chunks are created in the _timescaledb_internal schema our internal functions should live in a different dedicated schema. This patch make the necessary adjustments for the following functions: - get_partition_for_key(val anyelement) - get_partition_hash(val anyelement)
15b2a91494a11d8b82849b6f11f9ea6dc26ef8a8cbSven Klemm<sven@timescale.com>Mon Aug 28 23:26:23 2023 +0200Move ddl_internal functions to _timescaledb_functions schemaTo increase schema security we do not want to mix our own internal objects with user objects. Since chunks are created in the _timescaledb_internal schema our internal functions should live in a different dedicated schema. This patch make the necessary adjustments for the following functions: - chunk_constraint_add_table_constraint(_timescaledb_catalog.chunk_constraint) - chunk_drop_replica(regclass,name) - chunk_index_clone(oid) - chunk_index_replace(oid,oid) - create_chunk_replica_table(regclass,name) - drop_stale_chunks(name,integer[]) - health() - hypertable_constraint_add_table_fk_constraint(name,name,name,integer) - process_ddl_event() - wait_subscription_sync(name,name,integer,numeric)
164516df285c962f801722019868fc0a982ed43a57Jan Nidzwetzki<jan@timescale.com>Tue Aug 29 08:02:48 2023 +0200Make up/downgrade test deterministicTwo queries in post.continuous_aggs.v3.sql had no ORDER BY specification. Therefore, the query output was not deterministic. This patch adds the missing ORDER BY.
176576d969b319dac8e7fd08a9cf4cfc8197b34d1dSven Klemm<sven@timescale.com>Mon Aug 28 15:32:54 2023 +0200Move log invalidation functions to _timescaledb_functions schemaTo increase schema security we do not want to mix our own internal objects with user objects. Since chunks are created in the _timescaledb_internal schema our internal functions should live in a different dedicated schema. This patch make the necessary adjustments for the following functions: - cagg_watermark(integer) - cagg_watermark_materialized(integer) - hypertable_invalidation_log_delete(integer) - invalidation_cagg_log_add_entry(integer,bigint,bigint) - invalidation_hyper_log_add_entry(integer,bigint,bigint) - invalidation_process_cagg_log(integer,integer,regtype,bigint,bigint,integer[],bigint[],bigint[]) - invalidation_process_cagg_log(integer,integer,regtype,bigint,bigint,integer[],bigint[],bigint[],text[]) - invalidation_process_hypertable_log(integer,integer,regtype,integer[],bigint[],bigint[]) - invalidation_process_hypertable_log(integer,integer,regtype,integer[],bigint[],bigint[],text[]) - materialization_invalidation_log_delete(integer)
1828c7457faf9b909ea89b26b61cfa5a8428e2c23cSven Klemm<sven@timescale.com>Mon Aug 28 08:38:26 2023 +0200Move scheduler functions to _timescaledb_functions schemaTo increase schema security we do not want to mix our own internal objects with user objects. Since chunks are created in the _timescaledb_internal schema our internal functions should live in a different dedicated schema. This patch make the necessary adjustments for the following functions: - restart_background_workers() - stop_background_workers() - start_background_workers() - alter_job_set_hypertable_id(integer,regclass)
1901e480d5d668f7fbfc81800d4aad6c5ee61ba227James Guthrie<jguthrie@timescale.com>Thu Aug 10 13:23:01 2023 +0200Account for uncompressed rows in 'create_compressed_chunk'`_timescaledb_internal.create_compressed_chunk` can be used to create a compressed chunk with existing compressed data. It did not account for the fact that the chunk can contain uncompressed data, in which case the chunk status must be set to partial. Fixes #5946
20a323547e691f7ca9ad5d0b3924071a51b0a365cdFabrízio de Royes Mello<fabriziomello@gmail.com>Sun Aug 27 13:20:04 2023 +0200Move cagg_migrate functions to _timescaledb_functions schemaTo increase schema security we do not want to mix our own internal objects with user objects. Since chunks are created in the _timescaledb_internal schema our internal functions should live in a different dedicated schema. This patch make the necessary adjustments for the following functions: - cagg_migrate_create_plan(_timescaledb_catalog.continuous_agg,text,boolean,boolean) - cagg_migrate_execute_copy_data(_timescaledb_catalog.continuous_agg,_timescaledb_catalog.continuous_agg_migrate_plan_step) - cagg_migrate_execute_copy_policies(_timescaledb_catalog.continuous_agg,_timescaledb_catalog.continuous_agg_migrate_plan_step) - cagg_migrate_execute_create_new_cagg(_timescaledb_catalog.continuous_agg,_timescaledb_catalog.continuous_agg_migrate_plan_step) - cagg_migrate_execute_disable_policies(_timescaledb_catalog.continuous_agg,_timescaledb_catalog.continuous_agg_migrate_plan_step) - cagg_migrate_execute_drop_old_cagg(_timescaledb_catalog.continuous_agg,_timescaledb_catalog.continuous_agg_migrate_plan_step) - cagg_migrate_execute_enable_policies(_timescaledb_catalog.continuous_agg,_timescaledb_catalog.continuous_agg_migrate_plan_step) - cagg_migrate_execute_override_cagg(_timescaledb_catalog.continuous_agg,_timescaledb_catalog.continuous_agg_migrate_plan_step) - cagg_migrate_execute_plan(_timescaledb_catalog.continuous_agg) - cagg_migrate_execute_refresh_new_cagg(_timescaledb_catalog.continuous_agg,_timescaledb_catalog.continuous_agg_migrate_plan_step) - cagg_migrate_plan_exists(integer) - cagg_migrate_pre_validation(text,text,text) Co-authored-by: Fabrízio de Royes Mello <fabriziomello@gmail.com Co-authored-by: Sven Klemm <sven@timescale.com>
21e02b1f348eb4c48def00b7d5227238b4d9d41a4aSven Klemm<sven@timescale.com>Sun Aug 27 13:20:04 2023 +0200Simplify schema move update scriptUse dynamic sql to create the ALTER FUNCTION statements for those functions that may not exist in previous versions.
22184e8398182fb3972137b4faaa64d3a08836dfd9Sven Klemm<sven@timescale.com>Wed Aug 23 20:59:47 2023 +0200Move policy functions to _timescaledb_functions schemaTo increase schema security we do not want to mix our own internal objects with user objects. Since chunks are created in the _timescaledb_internal schema our internal functions should live in a different dedicated schema. This patch make the necessary adjustments for the following functions: - policy_compression_check(jsonb) - policy_compression_execute(integer,integer,anyelement,integer,boolean,boolean) - policy_compression(integer,jsonb) - policy_job_error_retention_check(jsonb) - policy_job_error_retention(integer,jsonb) - policy_recompression(integer,jsonb) - policy_refresh_continuous_aggregate_check(jsonb) - policy_refresh_continuous_aggregate(integer,jsonb) - policy_reorder_check(jsonb) - policy_reorder(integer,jsonb) - policy_retention_check(jsonb) - policy_retention(integer,jsonb)
236fb3c3f3f43fe70b7c5034ddfb11451df802890cLakshmi Narayanan Sreethar<lakshmi@timescale.com>Wed Jul 5 23:49:07 2023 +0530PG16: Handle updates to make_restrictinfo functionWhile fixing a bug in filtering of "cloned" outer-join quals, PG16 adds 3 new parameters to the make_restrictinfo function. Updated the compat function to handle this change. This patch also cleans up the variants of make_restrictinfo from other versions to make it clear which args are passed. postgres/postgres@991a3df227
249425402264624f78fd052c700f53f7a736230007Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Thu May 18 17:05:21 2023 +0530PG16: Handle removed EquivalenceClass membersPG16 removes the outerjoin_delayed mechanism and RestrictInfo.nullable_relids. postgres/postgres@b448f1c8 postgres/postgres@3bef56e1
253a493a47d1b5cc1a148c0040d531bf132f567e80Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Thu Aug 24 20:11:44 2023 +0530Remove unused functionsRemoved the unused functions ts_make_pathkey_from_sortop and ts_make_pathkey_from_sortinfo.
26040d45510430d13a9e1eda0ecb02981dfa1be39cLakshmi Narayanan Sreethar<lakshmi@timescale.com>Sat May 13 12:20:42 2023 +0530PG16: Datum macros are now inline functionsPG16 converted the *GetDatum() and DatumGet*() macros to inline functions. This doesn't affect most of our code but a few places like struct object initialisations cannot use inline functions. This commit updates all the places affected by this change. postgres/postgres@c8b2ef05
270da18a93b5bd00c6b25ff3c485b2228d371b3326Sven Klemm<sven@timescale.com>Tue Aug 22 14:15:13 2023 +0200Move chunk functions to _timescaledb_functions schemaTo increase schema security we do not want to mix our own internal objects with user objects. Since chunks are created in the _timescaledb_internal schema our internal functions should live in a different dedicated schema. This patch make the necessary adjustments for the following functions: - calculate_chunk_interval(int, bigint, bigint) - chunk_status(regclass) - chunks_in(record, integer[]) - chunk_id_from_relid(oid) - show_chunk(regclass) - create_chunk(regclass, jsonb, name, name, regclass) - set_chunk_default_data_node(regclass, name) - get_chunk_relstats(regclass) - get_chunk_colstats(regclass) - create_chunk_table(regclass, jsonb, name, name) - freeze_chunk(regclass) - unfreeze_chunk(regclass) - drop_chunk(regclass) - attach_osm_table_chunk(regclass, regclass)
285bba74a2ec083728f8e93e09d03d102568fd72b5Fabrízio de Royes Mello<fabriziomello@gmail.com>Mon Aug 7 19:49:47 2023 -0300Relax strong table lock when refreshing a CAGGWhen refreshing a Continuous Aggregate we take a table lock on _timescaledb_catalog.continuous_aggs_invalidation_threshold when processing the invalidation logs (the first transaction of the refresh Continuous Aggregate procedure). It means that even two different Continuous Aggregates over two different hypertables will wait each other in the first phase of the refreshing procedure. Also it lead to problems when a pg_dump is running because it take an AccessShareLock on tables so Continuous Aggregate refresh execution will wait until the pg_dump finish. Improved it by relaxing the strong table-level lock to a row-level lock so now the Continuous Aggregate refresh procedure can be executed in multiple sessions with less locks. Fix #3554
290f3d39574bf696e6627471ee16b5c26a12fb436cSven Klemm<sven@timescale.com>Wed Aug 23 13:06:49 2023 +0200Remove _timescaledb_internal.get_time_typeThis function was used in an old version of a cagg informational view that was removed but the function itself was left in.
303373d43143ab8b17c49fdffd34fd35d551d33185Alexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Wed Aug 16 12:12:42 2023 +0200Don't look up entire Chunk struct for compressed chunksIt's not needed. Also add them to baserel cache.
31373c55662ca5f8a2993abf9b2aa7f5f4006b3229Konstantina Skovola<konstantina@timescale.com>Mon Aug 7 16:36:17 2023 +0300Fix ordered append for partially compressed chunksIn the exclusive presence of partially compressed chunks, this optimization was not applied because no pathkeys were supplied. Additionally, this patch makes sure that if applicable, the `enable_decompression_sorted_merge` optimization is chosen for the path, since it is more beneficial due to the ability to push down the sort below DecompressChunk.
32d1246ee2f30c171491c3f5b9efe0626314c37c13Erik Nordström<erik@timescale.com>Wed Aug 23 10:18:48 2023 +0200Exclude PRs from bugs project boardAn `issue_comment` event is triggered by comments on both issues and PRs. However, the bugs project workflow did not filter out pull requests when the `issue_comment` event happened, so pull requests were also added to the bugs project board. Add a conditional that filters out pull requests so that only issues are added to the board.
33e47832b51ac7b18e7441de3a1eeffe579057d8e2Sven Klemm<sven@timescale.com>Wed Aug 23 09:07:14 2023 +0200Bump pgspot version to 0.6.0pgspot 0.6.0 has a bugfix for function signature tracking to no longer consider default values as part of the function signature.
34cf04496e4b4237440274eb25e4e02472fc4e06fcSven Klemm<sven@timescale.com>Tue Aug 22 12:01:19 2023 +0200Move utility functions to _timescaledb_functions schemaTo increase schema security we do not want to mix our own internal objects with user objects. Since chunks are created in the _timescaledb_internal schema our internal functions should live in a different dedicated schema. This patch make the necessary adjustments for the following functions: - generate_uuid() - get_git_commit() - get_os_info() - tsl_loaded()
35183362e17baf71ae4f663709a9cb412a986aa4d8Sven Klemm<sven@timescale.com>Tue Aug 22 09:37:40 2023 +0200Move size_util functions to _timescaledb_functions schemaTo increase schema security we do not want to mix our own internal objects with user objects. Since chunks are created in the _timescaledb_internal schema our internal functions should live in a different dedicated schema. This patch make the necessary adjustments for the following functions: - relation_size(regclass) - data_node_hypertable_info(name, name, name) - data_node_chunk_info(name, name, name) - hypertable_local_size(name, name) - hypertable_remote_size(name, name) - chunks_local_size(name, name) - chunks_remote_size(name, name) - range_value_to_pretty(bigint, regtype) - get_approx_row_count(regclass) - data_node_compressed_chunk_stats(name, name, name) - compressed_chunk_local_stats(name, name) - compressed_chunk_remote_stats(name, name) - indexes_local_size(name, name) - data_node_index_size(name, name, name) - indexes_remote_size(name, name, name)
363db692296028ea3c7407150a76aaa1feed6c5b4eMats Kindahl<mats@timescale.com>Mon Aug 21 17:35:19 2023 +0200Call eq_func correctly in time_bucket_gapfillThe equality comparison function is called using `DirectFunctionCall2Coll`, which do not set the `fcinfo->flinfo` when calling the PostgreSQL function. Since `array_eq` uses `fcinfo->flinfo->fn_extra` for caching, and `flinfo` is null, this causes a crash. Fix this issue by using `FunctionCall2Coll` instead, which sets `fcinfo->flinfo` before calling the PostgreSQL function. Fixes #5981
374256009e4cfe3daebe199540ab8c32af34836e01Sven Klemm<sven@timescale.com>Mon Aug 21 18:55:35 2023 +0200Move dist_internal functions to _timescaledb_functions schemaTo increase schema security we do not want to mix our own internal objects with user objects. Since chunks are created in the _timescaledb_internal schema our internal functions should live in a different dedicated schema. This patch make the necessary adjustments for the following functions: - set_dist_id(uuid) - set_peer_dist_id(uuid) - validate_as_data_node() - show_connection_cache() - ping_data_node(name, interval) - remote_txn_heal_data_node(oid)
38e99832727ac3f8aebd146015158490b28754ac1aJan Nidzwetzki<jan@timescale.com>Mon Aug 21 14:49:35 2023 +0200Place data in first/last function in correct mctxSo far, the ts_bookend_deserializefunc() function has allocated the deserialized data in the current memory context. This data could be removed before the aggregation is finished. This patch moves the data into the aggregation memory context.
3909dd20d7f73938473881b0c0d1fe2e1bb4659161Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Fri Jun 2 19:36:26 2023 +0530PG16: Align GUC variables initial value with boot valuesAny value hardcoded to a GUC variable will be overwritten by the boot_value when the GUC mechanism starts up. PG16 makes this more clear by checking that if a hardcoded value exists, it is same as the boot_value. The server asserts in debug builds if values are not equal. Commit 09636092 already fixes most of our code to align the hardcoded and boot_values for various GUC variables. This patch updates only the ts_guc_max_cached_chunks_per_hypertable initialisation which had an initial value different from the boot_value. postgres/postgres@a73952b79
40ba06c6eb2aac3be5ec1145b899cb747c82cca02aLakshmi Narayanan Sreethar<lakshmi@timescale.com>Fri Jun 2 19:02:35 2023 +0530PG16: Include guc header to use GetConfigOptionByNamepostgres/postgres@0a20ff54f5
41cf0f9b5bd8def79c346bf5462abe733bfeb4e192Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Thu Jun 1 23:29:18 2023 +0530PG16: Replace float8in_internal_opt_error with float8in_internalPG16 updated float8in_internal_opt_error() function to use soft error reporting and renamed it to float8in_internal(). Updated the code to use the new mechanism. postgres/postgres@ccff2d20e
420a66bdb8d36a1879246bd652e4c28500c4b951abSven Klemm<sven@timescale.com>Sun Aug 20 22:47:10 2023 +0200Move functions to _timescaledb_functions schemaTo increase schema security we do not want to mix our own internal objects with user objects. Since chunks are created in the _timescaledb_internal schema our internal functions should live in a different dedicated schema. This patch make the necessary adjustments for the following functions: - to_unix_microseconds(timestamptz) - to_timestamp(bigint) - to_timestamp_without_timezone(bigint) - to_date(bigint) - to_interval(bigint) - interval_to_usec(interval) - time_to_internal(anyelement) - subtract_integer_from_now(regclass, bigint)
43a640d7ddf16f289c9472c2699952df1122642cd1Sven Klemm<sven@timescale.com>Mon Aug 21 10:10:53 2023 +0200Fix psql \if expressionThe expression part of the psql \if cannot contain actual SQL expression and is instead much more limited. A valid value is any unambiguous case-insensitive match for one of: true, false, 1, 0, on, off, yes, no. See https://www.postgresql.org/docs/current/app-psql.html
440dd06e919f7cee9d7f7672b5244e7122d0c66436Sven Klemm<sven@timescale.com>Thu Aug 17 09:59:25 2023 +0200Move get_create_command into _timescaledb_functions schemaTo increase schema security we do not want to mix our own internal objects with user objects. Since chunks are created in the _timescaledb_internal schema our internal functions should live in a different dedicated schema. This patch make the necessary adjustments for the get_create_command function.
4556ea8b4de93cefc38e002202d8ac96947dcbaa77Sven Klemm<sven@timescale.com>Thu Apr 13 13:16:14 2023 +0200Move trigger functions to _timescaledb_functions schemaTo increase schema security we do not want to mix our own internal objects with user objects. Since chunks are created in the _timescaledb_internal schema our internal functions should live in a different dedicated schema. This patch make the necessary adjustments for our trigger functions.
462080c3c0f0d1fd8b90e9fb57491eaf936131f03fKonstantina Skovola<konstantina@timescale.com>Thu Aug 17 14:15:21 2023 +0300Post-release fixes for 2.11.2Bumping the previous version and adding tests for 2.11.2
47beb3b39599940082a7b0f4bf0d1d76e4500e5ebbLakshmi Narayanan Sreethar<lakshmi@timescale.com>Thu Jun 1 23:01:46 2023 +0530PG16: vacuum_set_xid_limits is now vacuum_get_cutoffsPG16 refactors how VACUUM passes around its XID cutoffs. A new dedicated struct is now used by VACUUM to maintain the XID/MXID cutoffs such as FreezeLimit and OldestXmin. The vacuum_set_xid_limits() function is also now replaced with a a new vacuum_get_cutoffs() function that uses the new struct. postgres/postgres@4ce3afb8
48f92cab8c2a81e5e0d7643e6fbaeed1a371b7bf07Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Thu Jun 1 23:17:57 2023 +0530PG16: Rename append_pathkeys to append_pathkeys_customRenamed append_pathkeys() to ts_append_pathkeys to prevent conflict with upstream changes postgres/postgres@1349d279
493438636a05936f4d20f05b42ac6e6e20d8ca736fLakshmi Narayanan Sreethar<lakshmi@timescale.com>Wed Jul 5 22:46:44 2023 +0530PG16: Macro HeapKeyTest is now an inline functionpostgres/postgres@4eb3b112
508d2dc760b7738d772f4d43e7ed8b32f9c7ed11e8Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Thu Jun 1 23:13:56 2023 +0530PG16: When removing a relation from the query, drop its RelOptInfo.PG16 removes the notion of "dead relation" and instead recommends deleting the relation's RelOptInfo from the planner's data structures when it is no longer needed. postgres/postgres@e9a20e45
5182eeb6ec2a19f30d917ca8e51303e217d201b883Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Thu May 18 21:35:56 2023 +0530PG16: Node tags T_Join, T_Plan and T_Scan have been removedNode tags T_Join, T_Plan and T_Scan have been removed in PG16 as those nodes are of abstract type and never directly instantiated. postgres/postgres@251154be postgres/postgres@8c73c11a
52b7b9a9b3ef0d1541388617db9e9b9237423eb4f1Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Tue May 30 22:12:39 2023 +0530PG16: Rename ri_RootToPartitionMap to ri_RootToChildMappostgres/postgres@fb958b5d
53d088b3a5d906f18f554b3322ec6d5cd00987cb4cAlexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Tue Aug 15 23:18:13 2023 +0200Do not add broken compressed join clausesWe used to add join clauses that referenced a compressed column at the level of the compressed scan, and later remove them. This is wrong and useless, just don't add them.
5422a2f49a2f09ef6b5809bf75bd93d016434e48f6Alexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Fri Aug 11 13:22:30 2023 +0200Fix filtering of the redundant decompress chunk clausesWe just had a bad cast inside is_redundant_derived_clause before, because it doesn't work with IndexClauses. Filtering didn't work as a result.
553a27669c846dd641b5054281729a8a71c576257dAlexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Tue Aug 15 14:28:58 2023 +0200Simplify compressed pathkey lookupWhen looking up a pathkey for compressed scan, we used to do a lot of work, including a quadratic lookup through all the equivalence members, to always arrive at the same canonical pathkey we started from. Just remove this useless code for a significant planning speedup. This uncovers two bugs in parameterization of decompressed paths and generation of equivalence members for segmentby columns, fix them as well.
5604ce1bc498f8a2f7732a50bf673de175db97fd04Alexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Thu Aug 10 15:32:40 2023 +0200Use cached Chunk struct when considering compressed pathsFull catalog lookups for a Chunk are expensive, avoiding them speeds up the planning.
57fb617e415058473457e26ab8e42b6637f0f4cf74Sven Klemm<sven@timescale.com>Tue Aug 15 09:08:49 2023 +0200Bump Postgres versions used in CIBump postgres version used to 13.12, 14.9 and 15.4
58154bbbb01a14046c639c1b978dd1b4e004a1f3ccJan Nidzwetzki<jan@timescale.com>Tue Jul 4 15:46:53 2023 +0200Perform startup chunk exclusion in parallel leaderThe parallel version of the ChunkAppend node uses shared memory to coordinate the plan selection for the parallel workers. If the workers perform the startup exclusion individually, it may choose different subplans for each worker (e.g., due to a "constant" function that claims to be constant but returns different results). In that case, we have a disagreement about the plans between the workers. This would lead to hard-to-debug problems and out-of-bounds reads when pstate->next_plan is used for subplan selection. With this patch, startup exclusion is only performed in the parallel leader. The leader stores this information in shared memory. The parallel workers read the information from shared memory and don't perform startup exclusion.
591102d34f42daf24a6fdbbbcae2c6e46feb50ca8cMats Kindahl<mats@timescale.com>Thu Aug 10 13:53:57 2023 +0200Remove telemetry isolation testThe telemetry isolation test `telemetry_iso` does not test anything and does not seem to work, so it is removed. The debug waitpoint was taken in the same session, so the waitpoint was not waited on.
6071b0168ab72b15fee539ecef3886a17d09e7d042Mats Kindahl<mats@timescale.com>Wed Mar 22 14:45:21 2023 +0100Add debug utilities to debug buildsThis will move the definitions of `debug_waitpoint_enable`, `debug_waitpoint_disable`, and `debug_waitpoint_id` to always be defined for debug builds and modify existing tests accordingly. This means that it is no longer necessary to generate isolation test files from templates (in most cases), and it will be straightforward to use these functions in debug builds. The debug utilities can be disabled by setting the option `ENABLE_DEBUG_UTILS` to `OFF`.
614bd704f3fcc1093641a8e772fe53bb0d633020ecLakshmi Narayanan Sreethar<lakshmi@timescale.com>Fri Jul 28 07:52:10 2023 +0530Further code cleanup after PG12 removalRemoved PG12 specific code guarded by the PG13_LT and PG13_GE macros.
622cb42a62f91b0aa81e9411f44936a63f6ad9c8aaKonstantina Skovola<konstantina@timescale.com>Thu Aug 10 15:50:13 2023 +0300Remove test_status calls from telemetry testDue to the postman-echo endpoint redirecting http requests to https, we get an unexpected 301 response in the tests, leading to repeated test failures. This commit removes these function calls.
639a2dfbfb83efdd94340c87d90a7893c7e53bd2daJan Nidzwetzki<jan@timescale.com>Wed Jul 12 22:29:25 2023 +0200Improved parallel DecompressChunk worker selectionThis PR improves the way the number of parallel workers for the DecompressChunk node are calculated. Since 1a93c2d482b50a43c105427ad99e6ecb58fcac7f, no partial paths for small relations are generated, which could cause a fallback to a sequential plan and a performance regression. This patch ensures that for all relations, a partial path is created again.
6444eab9cf9bef34274c88efd37a750eaa74cd8044Konstantina Skovola<konstantina@timescale.com>Wed Aug 9 15:26:03 2023 +0300Release 2.11.2This release contains bug fixes since the 2.11.1 release. We recommend that you upgrade at the next available opportunity. **Features** * #5923 Feature flags for TimescaleDB features **Bugfixes** * #5680 Fix DISTINCT query with JOIN on multiple segmentby columns * #5774 Fixed two bugs in decompression sorted merge code * #5786 Ensure pg_config --cppflags are passed * #5906 Fix quoting owners in sql scripts. * #5912 Fix crash in 1-step integer policy creation **Thanks** * @mrksngl for submitting a PR to fix extension upgrade scripts * @ericdevries for reporting an issue with DISTINCT queries using segmentby columns of compressed hypertable
65b96d1709219a9ba6b502970437d42e5dcd70643cLakshmi Narayanan Sreethar<lakshmi@timescale.com>Wed Aug 9 10:54:29 2023 +0100Revert "PG16: Use new function to check vacuum permission"This reverts commit 8b0ab4164 as the commit that introduced the new function has been reverted upstream. postgres/postgres@95744599
66b5b46a3e581b222f679c2d4aa15944646d8190d9noctarius aka Christoph Engelbert<me@noctarius.com>Wed Aug 9 13:28:54 2023 +0200Make logrepl markers for (partial) decompressions (#5805)Added logical replication messages (PG14+) as markers for (partial) decompression events (mutual compression), which makes it possible to differentiate inserts happening as part of the decompression vs actual inserts by the user, and filter the former out of the event stream. While some tools may be interested in all events, synching the pure "state" (without internal behavior) is required for others. As of now this PR is missing tests. I wonder if anyone has a good idea how to create an automatic test for it.
67a9505b40951ff6eaac330df61767dbf4ca01e84cLakshmi Narayanan Sreethar<lakshmi@timescale.com>Thu Jul 20 16:24:43 2023 +0300PG16: Replace pg_class_ownercheck() with object_ownercheckPG16 replaces pg_foo_ownercheck() functions with a common object_ownercheck() function. Added a new compat function for pg_class_ownercheck() function affected by this change and replaced all its callers. postgres/postgres@afbfc029
6822ea5771ad1a7928439b74f6cf3cd53872163c02Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Thu Jul 20 16:24:32 2023 +0300PG16: Make aclcheck function calls compatible with PG16PG16 replaced most of the aclcheck functions with a common object_aclcheck function. Updated the various aclcheck calls in the code to use the new function when compiled with PG16. postgres/postgres@c727f511
69b2b3acf6ac1f580c0c6737386f6360b912eb6c8fLakshmi Narayanan Sreethar<lakshmi@timescale.com>Mon May 22 21:22:27 2023 +0530PG16: No need to pass create_new_ph flag to find_placeholder_infoPG16 also optimized the PlaceFolderInfo lookups to perform in constant time, so there is no need to do an additional cheap/quick test using bms_overlap to see if the PHV might be evaluated in the outer rels. postgres/postgres@6569ca439 postgres/postgres@b3ff6c742
708abe14807229e691f5b75d37a6e465a58c3de886Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Wed Aug 2 20:36:38 2023 +0100PG16: stringToQualifiedNameList requires escontext parameterpostgres/postgres@858e776c84f
71592da23633e49dd3ad97922d64cdcfc22d219d90Nikhil Sontakke<nikhil@timescale.com>Fri Aug 4 14:08:03 2023 +0530Fix assert in debug wait pointsNeed to ensure that we should try to take a lock only if a valid transaction is around. Otherwise assert is hit due to an error within an error. Fixes #5917
722eb0a3883b47529dbf182475f6b81e8180d33114Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Thu Jul 20 17:20:38 2023 +0300PG16: Handle DefineIndex's new parameterPG16 adds a new parameter to DefineIndex, total_parts, that takes in the total number of direct and indirect partitions of the relation. Updated all the callers to pass either the actual number if it is known or -1 if it is unknown at that point. postgres/postgres@27f5c712
733af0d282ea71d9a8f27159a6171e9516e62ec9cbLakshmi Narayanan Sreethar<lakshmi@timescale.com>Wed Aug 2 20:24:14 2023 +0100PG16: ExecInsertIndexTuples requires additional parameterPG16 adds a new boolean parameter to the ExecInsertIndexTuples function to denote if the index is a BRIN index, which is then used to determine if the index update can be skipped. The fix also removes the INDEX_ATTR_BITMAP_ALL enum value. Adapt these changes by updating the compat function to accomodate the new parameter added to the ExecInsertIndexTuples function and using an alternative for the removed INDEX_ATTR_BITMAP_ALL enum value. postgres/postgres@19d8e23
748a2b6a03e0a7da92e5cdfc0f6802f93c7cc80820Mats Kindahl<mats@timescale.com>Mon Aug 7 09:28:09 2023 +0200Add weird user names to update testSince we want to be able to handle update of weird user names we add some to the update tests and create policies on them. This will create jobs with the strange name as owner.
7507762ea4cedefc88497f0d1f8712d1515cdc5b6eSven Klemm<sven@timescale.com>Mon Aug 7 18:31:40 2023 +0200Test timescaledb debian 12 packages in CI
767aeed663b9c0f337b530fd6cad47704a51a9b2ecDmitry Simonenko<dmitry@timescale.com>Thu Aug 3 14:30:23 2023 +0300Feature flags for TimescaleDB featuresThis PR adds several GUCs which allow to enable/disable major timescaledb features: - enable_hypertable_create - enable_hypertable_compression - enable_cagg_create - enable_policy_create
775cf354e2469ee7e43248bed382a4b49fc7ccfecdMarkus Engel<engel@sero-systems.de>Mon Jul 31 11:28:25 2023 +0200Fix quoting owners in sql scripts.When referring to a role from a string type, it must be properly quoted using pg_catalog.quote_ident before it can be casted to regrole. Fixed this, especially in update scripts.
782863daf3df83c63ee36c0cf7b66c522da5b4e127Dmitry Simonenko<dmitry@timescale.com>Thu Aug 3 14:36:39 2023 +0300Support CREATE INDEX ONLY ON main tableThis PR adds support for CREATE INDEX ONLY ON clause which allows to create index only on the main table excluding chunks. Fix #5908
7952ed394d4d2c13e693ff280c658c56f3eeb46f74Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Thu Jul 20 17:28:59 2023 +0300PG16: Remove recursion-marker values in enum AlterTableTypePG16 removed the recursion-marker values used to handle certain subcommands during an ALTER TABLE execution and provides an alternative flag. Removed the references to the recursion-marker values from timescaledb code. postgres/postgres@840ff5f4
8028612ebc3cbb6e2eeb995b25203b12974ef88127Konstantina Skovola<konstantina@timescale.com>Tue Aug 1 14:59:07 2023 +0300Fix crash in 1-step integer policy creationPreviously when a retention policy existed on the underlying hypertable, we would get a segmentation fault when trying to add a Cagg refresh policy, due to passing a bool instead of pointer to bool argument to function `ts_jsonb_get_int64_field` in a particular code path. Fixed by passing the expected pointer type. Fixes #5907
81b2773aa344c6f8fe8600830bfac417364676582dNikhil Sontakke<nikhil@timescale.com>Tue Aug 1 18:33:02 2023 +0530Fix crash in COPY from program returning errorReset the errcallback appropriately so that the ereport in case of a PROGRAM returning error can work correctly.
820d127f6dcc8827e28528854991cc0c22ee204141Alexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Tue Aug 1 10:04:10 2023 +0200Clean up compressed batch handling in DecompressChunk node* Remove unneeded data from batch states to use less memory * keep only the compressed column data because only for them we have to do something per row, other columns don't change * Adjust batch memory context size so that the bulk decompression results fit into it. * Determine whether we're going to use bulk decompression for each column at planning time, not at execution time. * Introduce "batch queue" to unify control flow for normal and batch sorted merge decompression * In batch sorted merge, compare batches on scan slot, not on projected slot. This avoids keeping the second slot in batches, and projection can be performed after we find the top batch. * this requires some custom code to build sort infos relative to scan tuple, not to targetlist. * Return a reference for the current top batch scan tuple as a result of DecompressChunk exec, don't copy it out. It is guaranteed to live until the next exec, which is the usual lifetime guarantee. This is needed to prepare for vectorized filters.
83d5268c36fbd23fa2a93c0371998286e8688247bbAlexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Fri Jul 28 13:35:05 2023 +0200Fix SQLSmith workflowThe build was failing because it was picking up the wrong version of Postgres. Remove it.
84ee2ddf889e07ac20cff55013e2bf7020f99e65e1Mats Kindahl<mats@timescale.com>Tue Jul 25 16:32:06 2023 +0200Check unique indexes when enabling compressionWhen enabling compression on a table, there is a check of unique and primary key *constraints*, but no check if there is just a unique index. This means that it is possible to create a compressed table without getting a warning that you should include the columns in the index into the segmentby field, which can lead to suboptimal query times. This commit adds a check for the unique index as well and ensure that a similar warning is printed as for a unique constraint. Fixes #5892
8561c288ec5eb966a9b4d8ed90cd026ffc5e3543c9Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Tue Jul 25 16:11:35 2023 +0530Fix broken CI after PG12 removalThe commit cdea343cc updated the gh_matrix_builder.py script but failed to import PG_LATEST variable into the script thus breaking the CI. Import that variable to fix the CI tests.
86e5691bee11e4f41e4beef1eae5782912b83b2c94Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Fri Jul 7 21:50:14 2023 +0530Cleanup PG12 specific code from source and test filesRemoved the PG12 specific macros and all the now, dead code. Also updated the testcases which had workarounds in place to make them compatible with PG12.
87ac33d04aa8f792e9076cdbb1162a5a367e713bf1Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Fri Jul 7 14:53:01 2023 +0530Remove update files for PG12Removed the update files that were used only for PG12.
88c3a9f90fdd972b41ad63c97a2dba352a27073361Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Fri Jul 7 14:14:43 2023 +0530Merge PG12 specific testfilesMerged testfiles that were split out due to their output differing only in PG12.
897936e8015bdd3fda9071b11939d6fece108a65fbLakshmi Narayanan Sreethar<lakshmi@timescale.com>Fri Jul 7 01:02:34 2023 +0530Remove PG12 specific test output files
9081b520d3b5132cb483128837a0e5dc89b98ff308Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Thu Jul 6 22:37:44 2023 +0530Remove support for PG12Remove support for compiling TimescaleDB code against PG12. PG12 specific macros and testfiles will be removed in a followup patch.
91cdea343cc9b8c3547791028ae1c228d3fdaaed10Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Thu Jul 6 21:49:23 2023 +0530Remove PG12 support from github workflows
92906bd38573a4752f6f3ec94e925683b5444f924cMats Kindahl<mats@timescale.com>Thu Jul 13 14:32:55 2023 +0200Add job exit status and runtime to logWhen a job finishes execution, either because of an error or a success, this commit will print out the execution time of the job in the log together with a message about what job that finished. For continuous aggregate refreshes, the number of rows deleted from and inserted into the materialization table will be printed.
9336e71000132cf3a5430849c11ff99e910ef81207Jan Nidzwetzki<jan@timescale.com>Wed Jul 12 22:29:25 2023 +0200Fix duplicates on partially compressed chunk readsWhen the uncompressed part of a partially compressed chunk is read by a non-partial path and the compressed part by a partial path, the append node on top could process the uncompressed part multiple times because the path was declared as a partial path and the append node assumed it could be executed in all workers in parallel without producing duplicates. This PR fixes the declaration of the path.
941bd527375d0dbe3735cc6efb297d09ff57824fe0Rafia Sabih<rafia.sabih@gmail.com>Wed Jul 5 14:33:20 2023 +0200Rectify interval calculationFor continuous aggregates with variable bucket size, the interval was wrongly manipulated in the process. Now it is corrected by creating a copy of interval structure for validation purposes and keeping the original structure untouched. Fixes #5734
954c3d64aa988ad667ff737f20a807058d6fb754ccnoctarius aka Christoph Engelbert<me@noctarius.com>Wed Jul 12 20:22:14 2023 +0200Support CAGG names in chunk_detailed_size (#5839)This patch adds support to pass continuous aggregate names to `chunk_detailed_size` to align it to the behavior of other functions such as `show_chunks`, `drop_chunks`, `hypertable_size`.
96963d4eefbff3c4eedb851efd5a51418f14ce1820noctarius aka Christoph Engelbert<me@noctarius.com>Wed Jul 12 20:21:27 2023 +0200Make `set_chunk_time_interval` CAGGs aware (#5852)This patch adds support to pass continuous aggregate names to the `set_chunk_time_interval` function to align it with functions, such as `show_chunks`, `drop_chunks`, and others. It reuses the previously existing function to find a hypertable or resolve a continuous aggregate to its underlying hypertable found in chunk.c. It, however, moves the function to hypertable.c and exports it from here. There is some discussion if this functionality should stay in chunk.c, though, it feels wrong in that file now that it is exported.
9788aaf23ae37fe7f47252b87325eb570aa417c607noctarius aka Christoph Engelbert<me@noctarius.com>Wed Jul 12 14:53:40 2023 +0200Allow Replica Identity (Alter Table) on CAGGs (#5868)This commit is a follow up of #5515, which added support for ALTER TABLE ... REPLICA IDENTITY (FULL | INDEX) on hypertables. This commit allows the execution against materialized hypertables to enable update / delete operations on continuous aggregates when logical replication in enabled for them.
98eaa1206b7f01672b95ea45486bcb7602499ffd25Alexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Thu Jul 6 18:14:08 2023 +0200Improvements for bulk decompression* Restore default batch context size to fix a performance regression on sorted batch merge plans. * Support reverse direction. * Improve gorilla decompression by computing prefix sums of tag bitmaps during decompression.
997657efe019bb020af095cd9ef3d577cb7bddd7d0Alexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Thu Jul 6 15:56:28 2023 +0200Cache the libfuzzer corpus between CI runsThis might help us find something interesting. Also add deltadelta/int8 fuzzing and make other minor improvements.
100490bc916afac6182a0537dba6dcf8c07b2735ff1Jan Nidzwetzki<jan@timescale.com>Tue Jul 4 15:50:17 2023 +0200Warn if result of ts_set_flags_32 is not usedThe ts_set_flags_32 function takes a bitmap and flags and returns an updated bitmap. However, if the returned value is not used, the function call has no effect. An unused result may indicate the improper use of this function. This patch adds the qualifier pg_nodiscard to the function which triggers a warning if the returned value is not used.
10106d20b1829e7a1afe392e50db17f92370ab0a9f8Konstantina Skovola<konstantina@timescale.com>Wed Jun 7 15:13:09 2023 +0300Enable altering job schedule type through `alter_job`In #4664 we introduced fixed schedules for jobs. This was done by introducing additional parameters fixed_schedule, initial_start and timezone for our add_job and add_policy APIs. These fields were not updatable by alter_job so it was not possible to switch from one type of schedule to another without dropping and recreating existing jobs and policies. This patch adds the missing parameters to alter_job to enable switching from one type of schedule to another. Fixes #5681
102b9a58dd5c49da409669caa47da3db8edbcbcea44Jan Nidzwetzki<jan@timescale.com>Fri Jun 30 10:31:03 2023 +0200Exclude workflow changes from being backportedThe backport script for the PRs does not have the permission to backport PRs which include workflow changes. So, these PRs are excluded from being automatically backported. Failed CI run: https://github.com/timescale/timescaledb/actions/runs/5387338161/ jobs/9780701395 > refusing to allow a GitHub App to create or update workflow > `.github/workflows/xxx.yaml` without `workflows` permission)
1039bbf5218890fc8c4435b8cd1cc06ca310b243da7Jan Nidzwetzki<jan@timescale.com>Fri Jun 30 09:45:42 2023 +0200Remove Ubuntu Kinetic check on ARM64We stopped to build packages for Ubuntu Kinetic on ARM64 due to the limited support of PostgreSQL versions and the EOL of Kinetic in a few weeks. This patch removes the check for up-to-date packages for this version.
104a7be1cc06a7f0324f5ac841d3898659352aaa96cJan Nidzwetzki<jan@timescale.com>Fri Jun 30 08:22:44 2023 +0200Fixed the ordering of merge_changelogs.sh scriptThe CHANGELOG.MD file contains the sections features, bugfixes, and thanks. This patch adjusts the script merge_changelogs.sh to produce the sections in the same order.
1058a581010957968cc569f5fea43fd6ab7dd3b80a6Jan Nidzwetzki<jan@timescale.com>Thu Jun 29 11:11:15 2023 +0200Post-release fixes for 2.11.1Bumping the previous version and adding tests for 2.11.1.
1068ae2da6260c7de68808db918371f8aacafce8332Jan Nidzwetzki<jan@timescale.com>Tue Jun 27 12:36:29 2023 +0200Release 2.11.1This release contains bug fixes since the 2.11.0 release. We recommend that you upgrade at the next available opportunity. **Features** * #5679 Teach loader to load OSM extension **Bugfixes** * #5705 Scheduler accidentally getting killed when calling `delete_job` * #5742 Fix Result node handling with ConstraintAwareAppend on compressed chunks * #5750 Ensure tlist is present in decompress chunk plan * #5754 Fixed handling of NULL values in bookend_sfunc * #5798 Fixed batch look ahead in compressed sorted merge * #5804 Mark cagg_watermark function as PARALLEL RESTRICTED * #5807 Copy job config JSONB structure into current MemoryContext * #5824 Improve continuous aggregate query chunk exclusion **Thanks** * @JamieD9 for reporting an issue with a wrong result ordering * @xvaara for reporting an issue with Result node handling in ConstraintAwareAppend
107118526e6aed1afa5e559ff43d16835807572e1ebSven Klemm<sven@timescale.com>Tue Jun 27 13:11:24 2023 +0200Improve continuous aggregate query chunk exclusionThis patch changes the time_bucket exclusion in cagg queries to distinguish between < and <=. Previously those were treated the same leading to failure to exclude chunks when the constraints where exactly at the bucket boundary.
108e2e7e5f286b2282d17440961a1efa043ba054824Erik Nordström<erik@timescale.com>Fri Mar 31 14:22:35 2023 +0200Make hypertables support replica identityAdd support for setting replica identity on hypertables via ALTER TABLE. The replica identity is used in logical replication to identify rows that have changed. Currently, replica identity can only be altered on hypertables via the root; changing it directly on chunks will raise an error.
10933a3e10f486e82df0db369c5ec2b80702576d9ecJan Nidzwetzki<jan@timescale.com>Fri Jun 16 22:50:17 2023 +0200Fixed batch look ahead in compressed sorted mergeIn decompress_sorted_merge_get_next_tuple it is determine how many batches need to be opened currently to perform a sorted merge. This is done by checking if the first tuple from the last opened batch is larger than the last returned tuple. If a filter removes the first tuple, the first into the heap inserted tuple from this batch can no longer be used to perform the check. This patch fixes the wrong batch look ahead. Fixes: #5797
110da20d071cf88699cafb03f732b3e851bdc286759Sven Klemm<sven@timescale.com>Thu Jun 22 10:19:05 2023 +0200Copy job config JSONB structure into current MemoryContextThe job config jsonb can be a nested structure of elements that all need to reside in the same memory context as the other job values. To ensure this we copy the structure on assignment.
111f1726790224e5444a2a2cb8c66155e4fb0b54e95Jan Nidzwetzki<jan@timescale.com>Sun Jun 25 21:55:24 2023 +0200Added perltidy make targetThis patch introduces the make target 'perltidy' to format Perl files with perltidy. In addition, calling perltidy is added to 'make format'.
112fb0df1ae4e65a815c61533380f2a5ebdfc5fe1caAnte Kresic<ante.kresic@gmail.com>Tue Jun 20 15:41:30 2023 +0200Insert into indexes during chunk compressionIf there any indexes on the compressed chunk, insert into them while inserting the heap data rather than reindexing the relation at the end. This reduces the amount of locking on the compressed chunk indexes which created issues when merging chunks and should help with the future updates of compressed data.
11381d4eb5cfb2c0e4949cbd109e7331539a41db152Zoltan Haindrich<zoltan@timescale.com>Fri May 19 12:04:25 2023 +0000Add Ensure-s to reduce crashes in unexpected casesIt could happen that the Chunk is dropped in the middle of processing another command. The test bgw_db_scheduler_fixed can crash due to that reason. By making sure that the system will error out instead of failing in an assertion could help avoid the situation in which postmaster drop out all clients in these cases.
11481e2f35d4b8d52ed3381cff846556611a8974cf9Jan Nidzwetzki<jan@timescale.com>Tue Jun 20 12:58:31 2023 +0200Mark cagg_watermark as PARALLEL RESTRICTEDThis patch marks the function cagg_watermark as PARALLEL RESTRICTED. It partially reverts the change of c0f2ed18095f21ac737f96fe93e4035dbfeeaf2c. The reason is as follows: for transaction isolation levels < REPEATABLE READ it can not be ensured that parallel worker reads the same watermark (e.g., using read committed isolation level: worker A reads the watermark, the CAGG is refreshed and the watermark changes, worker B reads the newer watermark). The different views on the CAGG can cause unexpected results and crashes (e.g., the chunk exclusion excludes different chunks in worker A and in worker B). In addition, a correct snapshot is used when the watermark is read from the CAGG and a TAP test is added, which detects inconsistent watermark reads. Co-authored-by: Fabrízio de Royes Mello <fabriziomello@gmail.com> Co-authored-by: Zoltan Haindrich <zoltan@timescale.com>
115a22e732c02474ce6b3ee29c4e81049c60daddc90Konstantina Skovola<konstantina@timescale.com>Fri Jun 23 15:35:15 2023 +0300Fix flaky test bgw_db_scheduler_fixedThe flakiness was due to two inserts falling into the same chunk instead of distinct ones, so inserted data further apart to ensure they fall in different chunks.
116d223000036db55bdc8ef5e576a906f334272de37Zoltan Haindrich<zoltan@timescale.com>Wed Jun 14 15:16:21 2023 +0000Chunk_create must add existing table or failEarlier this function have completed successfully if the requested range already existed - regardless an existing table was supplied or not.
117b2132f00a7b2b5a52af8f577d75fe54fab232443Zoltan Haindrich<zoltan@timescale.com>Tue Jun 13 12:10:07 2023 +0000Make validate_chunk_status accept Chunk as argumentThis makes the calls to this method more straightforward and could help to do better checks inside the method.
1188b0ab416437df5d6adf2ce58126dd2754c8ff48bLakshmi Narayanan Sreethar<lakshmi@timescale.com>Thu May 18 16:38:53 2023 +0530PG16: Use new function to check vacuum permissionpostgres/postgres@b5d63824
119d96e72af607f797b56fd3e0d8e51f6b229b9cebfLakshmi Narayanan Sreethar<lakshmi@timescale.com>Thu May 18 00:07:00 2023 +0530PG16: Rename RelFileNode references to RelFileNumber or RelFileLocatorpostgres/postgres@b0a55e4
120933285e64675febc5608add9cc1ad2d700518593Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Sat May 13 00:36:53 2023 +0530PG16: Remove MemoryContextContains usageRemove the usage of MemoryContextContains as it has been removed in PG16. postgres/postgres@9543eff
1211eb7e38d2df37da7674b2207155484838671d040Konstantina Skovola<konstantina@timescale.com>Thu Jun 1 12:30:34 2023 +0300Enable ChunkAppend for space partitioned partial chunksThis is a follow-up patch for timescale#5599 which handles space partitioned hypertables.
122c48f905f780025bf3c92de0d0dd161108a4116a1Bharathy<satish.8483@gmail.com>Thu Jun 15 19:02:23 2023 +0530Index scan support for UPDATE/DELETE.During UPDATE/DELETE on compressed hypertables, we do a sequential scan which can be improved by supporting index scans. In this patch for a given UPDATE/DELETE query, if there are any WHERE conditions specified using SEGMENT BY columns, we use index scan to fetch all matching rows. Fetched rows will be decompressed and moved to uncompressed chunk and a regular UPDATE/DELETE is performed on the uncompressed chunk.
12377318dced8a47aae4b2baddba71c829105e8319dJan Nidzwetzki<jan@timescale.com>Tue Jun 13 08:25:45 2023 +0200Fix broken download linksThe download links for several platforms are broken. This patch removes the links for the individual platforms and adds a link that points to the self-hosted install docs instead (as proposed by the docs team, see the discussion in #5762). Fixes: #5762
124f05b7f8105a6d7ef05abdfb0b21cb48824135c72Jan Nidzwetzki<jan@timescale.com>Thu Jun 15 12:44:53 2023 +0200Fixed the naming of the Windows GitHub actionThe ignored workflow for windows-build-and-test does not set the name of the actions properly. Therefore, these actions use the default naming. For example, 'Regression Windows / build (15, windows-2022, Debug)'. However, our CI expects names like 'PG15 Debug windows-2022' in the required checks. This PR corrects the name of the jobs.
1254273a27461fab3d23d19bc81b18209e83bb34662Valery Meleshkin<valeriy@timescale.com>Wed Jun 14 17:55:51 2023 +0200Ensure pg_config --cppflags are passedCMAKE_CPP_FLAGS is not a thing at all. Furthermore, CMAKE_CXX_FLAGS is not passed to a C compiler. pg_config uses CPPGLAGS for all includes, and needs to be passed into CMAKE_C_FLAGS as well.
12614d08576fb7d12b2d5edf4bfa3ea2722d79f7764Sotiris Stamokostas<sotiris@timescale.com>Wed Jun 14 17:57:32 2023 +0300Allow flaky-test labelWith this PR we allow issues with flaky-test label to be added to our bugs board.
127e302aa2ae97bbd682b1d5d1324e57a77131401d0Sven Klemm<sven@timescale.com>Fri Jun 2 09:26:39 2023 +0200Fix handling of Result nodes below Sort nodes in ConstraintAwareAppendWith PG 15 Result nodes can appear between Sort nodes and DecompressChunk when postgres tries to adjust the targetlist.
1289c7ae3e8a983ff1a19645c3d2dc0508ae8c69550Jan Nidzwetzki<jan@timescale.com>Mon Jun 12 15:52:06 2023 +0200Fixed two bugs in decompression sorted merge codeSQLSmith found two bugs in the compression sorted merge code. * The unused_batch_states are not initialized properly. Therefore, non-existing unused batch states can be part of the BMS. This patch fixes the initialization. * For performance reasons, We reuse the same TupleDesc across all TupleTableSlots. PostgreSQL sometimes uses TupleDesc data structures with active reference counting. The way we use the TupleDesc structures collides with the reference counting of PostgreSQL. This patch introduces a private TupleDesc copy without reference counting.
1294dce87a1c4a53d080676bfff042e24aa5b822cecLakshmi Narayanan Sreethar<lakshmi@timescale.com>Wed May 17 19:37:42 2023 +0530PG16: Refactor handling of PGDLLEXPORT macro definitionPG16 defines the PGDLLEXPORT macro as a proper visibility attribute. In the previous versions from PG12 to PG16, the PGDLLEXPORT was always defined as an empty macro. Considering all this, the code has been now updated to skip defining PGDLLEXPORT if it has been already defined properly. If not, the macro is redefined without any additional checks. postgres/postgres@089480c
1300f1fde8d31dd44180820409ea2ca334b9188a01eLakshmi Narayanan Sreethar<lakshmi@timescale.com>Wed May 17 21:49:00 2023 +0530Mark PG16 as a supported versionNote that this change in combination with -DEXPERIMENTAL=ON cmake flag will just allow us to compile timescaledb code with PG16 and this doesn't mean PG16 is supported by the extension.
1317df16ee560ec79fd0c4b1590189755bad25585f7Sotiris Stamokostas<sotiris@timescale.com>Mon Jun 12 11:50:21 2023 +0300Renamed need-more-info labelWe plan to rename the need-more-info label to waiting-for-author. This PR performs the needed adjustments in our GitHub actions.
1328b10a6795c4d696b6c59ab546d733decf2a68352Sotiris Stamokostas<sotiris@timescale.com>Fri Jun 9 15:26:18 2023 +0300Compression test changes for PG14.0We have changed the compression test by disabling parallel append in some test cases because the regression test was falling only in PG14.0 but not in PG14.8 or any other PostgreSQL version
133f26e656c0f9ad7eb27c5de2232fef0f9154d80d5Alexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Wed Jun 7 15:55:53 2023 +0200Bulk decompression of compressed batchesAdd a function to decompress a compressed batch entirely in one go, and use it in some query plans. As a result of decompression, produce ArrowArrays. They will be the base for the subsequent vectorized computation of aggregates. As a side effect, some heavy queries to compressed hypertables speed up by about 15
134. Point queries with LIMIT 1 can regress by up to 1 ms. If the absolute highest performace is desired for such queries, bulk decompression can be disabled by a GUC.
135c96870c91baf9a035f6c1308d2ab953d65ab73c2Alexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Wed Jun 7 15:54:48 2023 +0200Update gorilla and deltadelta fuzzing corpuses
136769646bdb61d74f5cb026b598de24072cc6c4d8cZoltan Haindrich<zoltan@timescale.com>Tue Jun 6 15:11:40 2023 +0000Fix issues with scripts/test_update_smoke.shThe test was failing on first run by leaving a database behind as a sideeffect. Between two steps the extension was dropped; without a proper cleanup. A non-existent sql function was called during cleanup. This patch also removes the "debug mode" and every execution will leave the logs/etc in the /tmp directory for further inspection.
137b8e674c137f54e293e868ce747f19983a72e0e60Jan Nidzwetzki<jan@timescale.com>Wed Jun 7 09:05:58 2023 +0200Fixed handling of NULL values in bookend_sfuncIn the function bookend_sfunc values are compared. If the first processed value is a NULL value, it was copied into the state of the sfunc. A following comparison between the NULL value of the state and a non-NULL value could lead to a crash. This patch improves the handling of NULL values in bookend_sfunc.
138f2eac72e2bb320a4866766f79b181fe78856c8a1Jan Nidzwetzki<jan@timescale.com>Tue Jun 6 11:59:39 2023 +0200Ensure tlist is present in decompress chunk planIn PostgreSQL < 15, CustomScan nodes are projection capable. The planner invokes create_plan_recurse with the flag CP_IGNORE_TLIST. So, the target list of a CustomScan node can be NIL. However, we rely on the target list to derive information for sorting. This patch ensures that the target list is always populated before the sort functions are called. Fixes: #5738
139ac7090653eb020c2392bc29b653339b581d56bcfZoltan Haindrich<zoltan@timescale.com>Thu Jun 1 10:56:34 2023 +0000Ensure PR number is referenced in the .unreleased filesAdds a simple check to ensure that the PR number is present at least once in the added changelog file. Also fixes an earlier PR which introduced a typo.
1404cef387f850df09fd060760ffe7437a2b9edf21eFabrízio de Royes Mello<fabriziomello@gmail.com>Wed May 31 14:49:38 2023 -0400Replace heap_endscan to table_endscan
1411a93c2d482b50a43c105427ad99e6ecb58fcac7fSotiris Stamokostas<sotiris@timescale.com>Wed May 3 22:20:44 2023 +0300Improve parallel workers for decompressionSo far, we have set the number of desired workers for decompression to 1. If a query touches only one chunk, we end up with one worker in a parallel plan. Only if the query touches multiple chunks PostgreSQL spins up multiple workers. These workers could then be used to process the data of one chunk. This patch removes our custom worker calculation and relies on PostgreSQL logic to calculate the desired parallelity. Co-authored-by: Jan Kristof Nidzwetzki <jan@timescale.com>
14210cab43e6c3348a1353a682a01bdf8a70173aca8Jan Nidzwetzki<jan@timescale.com>Thu Apr 6 13:12:13 2023 +0200Enable compressed merge append for partial chunksThis patch enables the compressed merge optimization (see #5530) also for partially compressed chunks.
143c507f31069fccd3755a4138b907cbe997d34d15fDipesh Pandit<70561403+pdipesh02@users.noreply.github.com>Thu Jun 1 19:34:47 2023 +0530Internal Server Error when loading Explorer tab (#5723) Internal Server Error when loading Explorer tab (SDC #995) This is with reference to a weird scenarios where chunk table entry exist in timescaledb catalog but it does not exist in PG catalog. The stale entry blocks executing hypertable_size function on the hypertable. The changes in this patch are related to improvements suggested for hypertable_size function which involves: 1. Locking the hypertable in ACCESS SHARE mode in function hypertable_size to avoid risk of chunks being dropped by another concurrent process. 2. Joining the hypertable and inherited chunk tables with "pg_class" to make sure that a stale table without an entry is pg_catalog is not included as part of hypertable size calculation. 3. An additional filter (schema_name) is required on pg_class to avoid calculating size of multiple hypertables with same in different schema. NOTE: With this change calling hypertable_size function will require select privilege on the table. Disable-check: force-changelog-file
144ecc1b7b11a2aa9d483b14e240128632047af1b46Konstantina Skovola<konstantina@timescale.com>Fri Apr 21 11:51:44 2023 +0300Enable ChunkAppend for partial chunksThis patch enables ChunkAppend optimization for partially compressed chunks on hypertables without space partitioning, allowing for more efficient processing of LIMIT order by queries. A follow-up patch is required to handle space partitioned hypertables.
145d6030a32d87b2b2a3caa8026faf007b8e6b532e5epgts<epg@timescale.com>Wed May 31 13:18:48 2023 -0500Teach loader to load OSM extension (#5679)
146b38c920266b33c5b83c85279c9b36f4131b9ea83Bharathy<satish.8483@gmail.com>Sat May 27 10:00:37 2023 +0530MERGE support on hypertablesThis patch does following: 1. Planner changes to create ChunkDispatch node when MERGE command has INSERT action. 2. Changes to map partition attributes from a tuple returned from child node of ChunkDispatch against physical targetlist, so that ChunkDispatch node can read the correct value from partition column. 3. Fixed issues with MERGE on compressed hypertable. 4. Added more testcases. 5. MERGE in distributed hypertables is not supported. 6. Since there is no Custom Scan (HypertableModify) node for MERGE with UPDATE/DELETE on compressed hypertables, we don't support this. Fixes #5139
147ab2cccb6e2b10008c2604af96be71ed8709ecb22Zoltan Haindrich<zoltan@timescale.com>Fri May 12 06:30:41 2023 +0000Post-release 2.11.0Adjust the upgrade/downgrade scripts and add the tests. (cherry picked from commit d5fea0a842cbd38d2d72db16e9e67f1c9b1ccf36)
14870d0704368226a1a5b604b49b7c21c4a4c9131aaRafia Sabih<rafia.sabih@gmail.com>Thu May 4 11:01:41 2023 +0200Refactor continuous aggregate code
14929154b29d11901ee4b98312ca6245e87216a5877Alexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Wed May 24 21:57:54 2023 +0200Ignore the telemetry test for the time beginIt's the fifths run and it still fails in some jobs.
1506589f43160980475c04fcc2a6e4e2b985a111357Alexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Wed May 24 10:55:35 2023 +0200Compression fuzzing in CIThis serves as a way to exercise the decompression fuzzing code, which will be useful when we need to change the decompression functions. Also this way we'll have a check in CI that uses libfuzzer, and it will be easier to apply it to other areas of code in the future.
15154d4c3de6bbb52421b15f6035db662f683059c86Fabrízio de Royes Mello<fabriziomello@gmail.com>Mon May 22 16:35:45 2023 -0300Introduce utility function ts_get_relation_relidIn several places of our code base we use a combination of `get_namespace_oid` and `get_relname_relid` to return the Oid of a schema qualified relation, so refactored the code to encapsulate this behavior in a single function.
152f2743648dff26f61f305aa8579bcac806e61a2a2Eric Gillespie<epg@timescale.com>Tue Mar 28 13:01:56 2023 -0500Update emacs configurationUse postgres for sql-mode, which makes it easier to connect to local postgresql with C-c C-z and also sets up postgresql extensions for font-lock. Copy the 4-space tab-width setting to diff-mode so that, for example, diffs of lines containing 18 TABs don't display with 144-space indent.
153f14ff40d6305f139aaabc3e22cbc2fb5fca55bf2Sven Klemm<sven@timescale.com>Tue May 23 10:55:52 2023 +0200Bump PG version used in CIUse PG 12.15, 13.11, 14.8 and 15.3 in CI.
154a31c9b9f8cdfe8643499b710dc983e5c5d6457e4Sven Klemm<sven@timescale.com>Mon May 22 11:34:06 2023 +0200Increase number of sqlsmith loops in nightly CITo improve coverage with sqlsmith we run it for longer in the scheduled nightly run.
155dd9f01ae9b5b7a4cf3f71ea2b78d69f511e58608Konstantina Skovola<konstantina@timescale.com>Mon May 22 11:03:01 2023 +0300Fix occasional scheduler quit with `delete_job`Previously it was possible to send pg_cancel to the scheduler instead of the background worker for the job. That was because we attempted to take an advisory lock on the job id, which was assumed to be held by the background worker for the job. However, it is possible either for the job's worker or for the scheduler to be the one holding the lock. The scheduler takes this lock after the job's worker has exited, to update the job's scheduled status. This patch adds a check to determine if the background worker holding the lock is the scheduler. If it's the scheduler, wait for the lock to be released without canceling the worker. Fixes #5711, #5224
156d9849325d0d0f81a13db1e41aa56f8b567945e72Rafia Sabih<rafia.sabih@gmail.com>Thu Apr 27 15:01:38 2023 +0200Improve test suiteAdd more regression tests for Continuous aggregates with joins.
15738ee7f49b0cddc5f7fe697321135b28680471ff7Maheedhar PV<mahi@timescale.com>Thu May 18 18:00:07 2023 +0530Every PR to have its own changelogThe changes in this commit 1. workflow action to check if the PR has its own changelog file in ".unreleased/" folder. 2. script to merge the individual changelog entries that can be copied into the CHANGELOG.md file. 3. script to check the format of the lines in the change log file. 4. script to delete the individual changelogs, post release.
1582bd18b8e44e6bc6d2ef57aebc2a3e22ba91059b3Mats Kindahl<mats@timescale.com>Wed May 17 13:07:02 2023 +0200Use environment variables for workflowsRemove GitHub variables from locations where they are expanded in place. See https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
159f58d8c20c2562a97ad8dec7dfc738fff29749138Zoltan Haindrich<zoltan@timescale.com>Fri May 12 06:30:41 2023 +0000Release 2.11.0
16019dd7bbd7a09de25af7c233a5923ac7eaef809deKonstantina Skovola<konstantina@timescale.com>Fri May 12 17:47:06 2023 +0300Fix DISTINCT query with JOIN on multiple segmentby columnsPreviously when adding equivalence class members for the compressed chunk's variables, we would only consider Vars. This led us to ignore cases where the Var was wrapped in a RelabelType, returning inaccurate results. Fixed the issue by accepting Vars with RelabelType for segmentby equivalence class. Fixes #5585
161fb65086b5542a871dc3d9757724e886dca904ef6Alexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Tue May 16 18:33:48 2023 +0200Add a ubsan suppression for overflow in histogram()It is in postgres code, and doesn't lead to bugs.
1628ff0648fd0768b9229853f933056855420ad82eeAlexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Tue May 16 14:43:18 2023 +0200Fix ubsan failure in gorilla decompressionAlso add more tests
163936d751037381cbbb3a59ac9da36cdaa0dd4904aAlexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Mon May 15 17:52:37 2023 +0200Add AddressSanitizer instrumentation for memory contextsUse manual poison/unpoison at the existing Valgrind hooks, so that AddressSanitizer sees palloc/pfree as well, not only the underlying mallocs which are called much less often. Fix some out-of-bound reads found with this instrumentation.
164f58500a32c5abc6bb3459310cb7990cca37c316bAlexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Tue May 16 14:47:17 2023 +0200Add clang-tidy changes to git blame ignore list
165030bfe867df02dffa4f5c0fc8a0909075def6f4aAlexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Mon May 15 17:28:35 2023 +0200Fix errors in decompression found by fuzzingFor deltadelta and gorilla codecs, add various length and consistency checks that prevent segfaults on incorrect data.
166a7321199a4184aaa39c9c5b56b412497d62da1dcAlexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Mon May 15 17:23:27 2023 +0200Enable branch-level code coverageHelps to check the test coverage for various complex conditions in the decompression code.
16762b6bc5f7fede92d6e1fa039ffa65e344eb325fbAlexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Mon May 15 17:23:01 2023 +0200Add deltadelta int8 fuzzing corpus
168451b982a74c9bfa6d2a5509811c2ea89a4d079caAlexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Mon May 15 17:22:32 2023 +0200Add gorilla-float8 fuzzing corpus
1693947c011244050878ebb091b560e19ea4c9d8378Mats Kindahl<mats@timescale.com>Fri Apr 28 10:38:43 2023 +0200Support sending telemetry event reportsAdd table `_timescaledb_catalog.telemetry_event` table containing events that should be sent out with telemetry reports. The table will be truncated after reporting being generated.
1702d71a5bca9a21490819d239aeee8b2758a54ec1dBharathy<satish.8483@gmail.com>Thu May 11 17:55:27 2023 +0530Fix leak during concurrent UPDATE/DELETEWhen updating and deleting the same tuple while both transactions are running at the same time, we end up with reference leak. This is because one of the query in a transaction fails and we take error path. However we fail to close the table. This patch fixes the above mentioned problem by closing the required tables. Fixes #5674
171656daf45f6596e5d663082a8673e705359c01534Mats Kindahl<mats@timescale.com>Tue May 9 18:58:12 2023 +0200Fix subtransaction resource ownerWhen executing a subtransaction using `BeginInternalSubTransaction` the memory context switches from the current context to `CurTransactionContext` and when the transaction is aborted or committed using `ReleaseCurrentSubTransaction` or `RollbackAndReleaseCurrentSubTransaction` respectively, it will not restore to the previous memory context or resource owner but rather use `TopTransactionContext`. Because of this, both the memory context and the resource owner will be wrong when executing `calculate_next_start_on_failure`, which causes `run_job` to generate an error when used with the telemetry job. This commit fixes this by saving both the resource owner and the memory context before starting the internal subtransaction and restoring it after finishing the internal subtransaction. Since the `ts_bgw_job_run_and_set_next_start` was incorrectly reading the wrong result from the telemetry job, this commit fixes this as well. Note that `ts_bgw_job_run_and_set_next_start` is only used when running the telemetry job, so it does not cause issues for other jobs.
172abb6762450fb90aae5536641fef85cfd3c75b510Erik Nordström<erik@timescale.com>Wed May 3 14:06:25 2023 +0200Reduce memory usage for distributed analyzeUse a per-tuple memory context when receiving chunk statistics from data nodes. Otherwise memory usage is proportional to the number of chunks and columns.
17396d2acea30e6cc27ab624e5a155f6b57767ac411Erik Nordström<erik@timescale.com>Wed May 3 14:05:47 2023 +0200Cleanup PGresults on transaction endFix a regression due to a previous change in c571d54c. That change unintentionally removed the cleanup of PGresults at the end of transactions. Add back this functionality in order to reduce memory usage.
174f250eaa631920c209673fd0babfe29af9b9778ddFabrízio de Royes Mello<fabriziomello@gmail.com>Fri May 5 12:14:04 2023 -0300Remove FK from continuous_agg_migrate_planDuring the `cagg_migrate` execution if the user set the `drop_old` parameter to `true` the routine will drop the old Continuous Aggregate leading to an inconsistent state because the catalog code don't handle this table as a normal catalog table so the records are not removed when dropping a Continuous Aggregate. The same problem will happen if you manually drop the old Continuous Aggregate after the migration. Fixed it by removing the useless Foreign Key and also adding another column named `user_view_definition` to the main plan table just to store the original user view definition for troubleshooting purposes. Fixed #5662
175ab224789922f0e3b88bf57f5b43f0a5c258243ccAnte Kresic<ante.kresic@gmail.com>Tue May 9 14:45:15 2023 +0200Fix DML decompression issues with bitmap heap scanBitmap heap scans are specific in that they store scan state during node initialization. This means they would not pick up on any data that might have been decompressed during a DML command from the compressed chunk. To avoid this, we update the snapshot on the node scan state and issue a rescan to update the internal state.
176bd36afe2f3a5bc437d58a88a85b19b2253c0a926shhnwz<mohammed@timescale.com>Wed May 10 11:17:38 2023 +0530Fixed Coverity Scan WarningsUnused Value reported during coverity scan link: https://scan4.scan.coverity.com/reports.htm#v56957/p12995
1778e69a9989f9e9893807e7ea2403ab1c267895396Ante Kresic<ante.kresic@gmail.com>Thu Apr 27 11:59:01 2023 +0200Ignore multinode tests from PR CI runsdist_move_chunk, dist_param, dist_insert and remote_txn create a lot of friction due to their flakiness. Ignoring them until we can fix them.
1783dc6824eb5c3384c4e8fda78a3e8288dcc3f8da0Fabrízio de Royes Mello<fabriziomello@gmail.com>Wed May 3 16:01:34 2023 -0300Add GUC to enable/disable DML decompression
1796782beb1504bc421f973269f029c9854e17c7650Ante Kresic<ante.kresic@gmail.com>Thu May 4 11:42:13 2023 +0200Fix index scan handling in DML decompressionWe need to use the correct qualifiers for index scans since the generic scan qualifiers are not populated in this case.
1808ca17e704c8f9320f360bab7eaf3622391d686bdDmitry Simonenko<dmitry@timescale.com>Thu May 4 14:54:27 2023 +0300Fix ALTER TABLE SET with normal tablesRunning ALTER TABLE SET with multiple SET clauses on a regular PostgreSQL table produces irrelevant error when timescaledb extension is installed. Fix #5641
1819259311275ded2e562e5222bc0853509dc2dd206Sven Klemm<sven@timescale.com>Wed May 3 09:42:38 2023 +0200Fix JOIN handling in UPDATE/DELETE on compressed chunksWhen JOINs were present during UPDATE/DELETE on compressed chunks the code would decompress other hypertables that were not the target of the UPDATE/DELETE operations and in the case of self-JOINs potentially decompress chunks not required to be decompressed.
182769f9fe609df950a82d6697a08f33675da5c8f28Bharathy<satish.8483@gmail.com>Wed May 3 22:37:08 2023 +0530Fix segfault when deleting from compressed chunkDuring UPDATE/DELETE on compressed hypertables, we iterate over plan tree to collect all scan nodes. For each scan nodes there can be filter conditions. Prior to this patch we collect only first filter condition and use for first chunk which may be wrong. In this patch as and when we encounter a target scan node, we immediatly process those chunks. Fixes #5640
18390f585ed7fbe51568749c96dc650f6666a4a20afFabrízio de Royes Mello<fabriziomello@gmail.com>Fri Apr 28 09:16:33 2023 -0300Fix CoverityScan deference after null checkDon't need to check NULL for `direct_query->jointree` because we don't allow queries without FROM clause in Continuous Aggregate definition. CoverityScan link: https://scan4.scan.coverity.com/reports.htm#v54116/p12995/fileInstanceId=131745632&defectInstanceId=14569562&mergedDefectId=384045
1846e65172cd821c5509da3b7f41904a5b2f1916d16Konstantina Skovola<konstantina@timescale.com>Fri Apr 21 15:29:13 2023 +0300Fix tablespace for compressed hypertable and corresponding toastIf a hypertable uses a non default tablespace, the compressed hypertable and its corresponding toast table and index is still created in the default tablespace. This PR fixes this unexpected behavior and creates the compressed hypertable and its toast table and index in the same tablespace as the hypertable. Fixes #5520
185df32ad4b7920970a75a2b83dd3587fdda07b8302Jan Nidzwetzki<jan@timescale.com>Thu Apr 6 13:12:13 2023 +0200Optimize compressed chunk resortingThis patch adds an optimization to the DecompressChunk node. If the query 'order by' and the compression 'order by' are compatible (query 'order by' is equal or a prefix of compression 'order by'), the compressed batches of the segments are decompressed in parallel and merged using a binary heep. This preserves the ordering and the sorting of the result can be prevented. Especially LIMIT queries benefit from this optimization because only the first tuples of some batches have to be decompressed. Previously, all segments were completely decompressed and sorted. Fixes: #4223 Co-authored-by: Sotiris Stamokostas <sotiris@timescale.com>
186cc9c3b343113fc9a43f095720c1d2f2596a23b03Fabrízio de Royes Mello<fabriziomello@gmail.com>Wed Apr 26 20:18:19 2023 -0300Post-release 2.10.3Adjust the upgrade/downgrade scripts and add the tests.
187ed8ca318c056ee8b01197a5740a25a358a034894Nikhil Sontakke<nikhil@timescale.com>Tue Apr 25 20:27:31 2023 +0530Quote username identifier appropriatelyNeed to use quote_ident() on the user roles. Otherwise the extension scripts will fail. Co-authored-by: Mats Kindahl <mats@timescale.com>
1882ce4bbc432e5af21c3a65971e1951db242e4520fBharathy<satish.8483@gmail.com>Fri Apr 28 07:22:32 2023 +0530Enable continuous_aggs tests on all PG version.
1891d092560f45bbec887a8cb098f338a789250196dZoltan Haindrich<zoltan@timescale.com>Fri Apr 14 14:24:42 2023 +0000Fix on-insert decompression after schema changesOn compressed hypertables 3 schema levels are in use simultaneously * main - hypertable level * chunk - inheritance level * compressed chunk In the build_scankeys method all of them appear - as slot have their fields represented as a for a row of the main hypertable. Accessing the slot by the attribut numbers of the chunks may lead to indexing mismatches if there are differences between the schemes. Fixes: #5577
190be2879438490d5f3c4aeafd446b6c60afcefd6a5Mats Kindahl<mats@timescale.com>Tue Apr 25 14:28:10 2023 +0200Enable run_job() for telemetry jobSince telemetry job has a special code path to be able to be used both from Apache code and from TSL code, trying to execute the telemetry job with run_job() will fail. This code will allow run_job() to be used with the telemetry job to trigger a send of telemetry data. You have to belong to the group that owns the telemetry job (or be the owner of the telemetry job) to be able to use it. Closes #5605
191d5a286174d93aff24af3e3a911b84420177912a6Fabrízio de Royes Mello<fabriziomello@gmail.com>Tue Apr 25 17:33:56 2023 -0300Changelog for 2.10.3
1928a95d1b9ee017bee2df3a2e57b0b949b50de1247Fabrízio de Royes Mello<fabriziomello@gmail.com>Wed Apr 26 18:05:05 2023 -0300Add missing matrix in ignored 32bits regression workflow
193e140cc702c35ecd810ed434ca81c18d008de31fcFabrízio de Royes Mello<fabriziomello@gmail.com>Wed Apr 26 16:18:05 2023 -0300Add missing matrix in ignored regression workflow
194002b6e879abaeecbde295775d7c46292bcb535bfFabrízio de Royes Mello<fabriziomello@gmail.com>Wed Apr 26 14:37:25 2023 -0300Fix CI ignored regression workflowsWe defined some paths to ignore regression test workflows when, for example, we change the CHANGELOG.md and others. But in fact it was not happening because we didn't define a proper name in the fake regression workflow that fake to the CI that some required status passed. Fixed it defining a proper regression name like we do for the regular regression workflow.
1953c8d7cef77d34d88ace3cd0a58fbb7640965d5c0Fabrízio de Royes Mello<fabriziomello@gmail.com>Wed Apr 26 09:02:57 2023 -0300Fix cagg_repair for the old CAgg formatIn commit 4a6650d1 we fixed the cagg_repair running for broken Continuous Aggregates with JOINs but we accidentally removed the code path for running against the old format (finalized=false) leading us to a dead code pointed out by CoverityScan: https://scan4.scan.coverity.com/reports.htm#v54116/p12995/fileInstanceId=131706317&defectInstanceId=14569420&mergedDefectId=384044 Fixed it by restoring the old code path for running the cagg_repair for Continuous Aggregates in the old format (finalized=false).
196d3730a4f6ac89612d749d10843def181f7830635Mats Kindahl<mats@timescale.com>Tue Apr 25 18:01:48 2023 +0200Add permission checks to run_job()There were no permission checks when calling run_job(), so it was possible to execute any job regardless of who owned it. This commit adds such checks.
1974a6650d170cc07dbec0afe01bb3685a2cf9d9a37Fabrízio de Royes Mello<fabriziomello@gmail.com>Fri Apr 21 16:34:49 2023 -0300Fix broken CAgg with JOIN repair functionThe internal `cagg_rebuild_view_definition` function was trying to cast a pointer to `RangeTblRef` but it actually is a `RangeTblEntry`. Fixed it by using the already existing `direct_query` data struct to check if there are JOINs in the CAgg to be repaired.
198910663d0be132aa05100233ebf7e97c66da7297fAnte Kresic<ante.kresic@gmail.com>Mon Apr 24 06:29:11 2023 +0200Reduce decompression during UPDATE/DELETEWhen updating or deleting tuples from a compressed chunk, we first need to decompress the matching tuples then proceed with the operation. This optimization reduces the amount of data decompressed by using compressed metadata to decompress only the affected segments.
1993bf58dac02c1804578eac6eae95aec849c7f72b8Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Mon Apr 24 20:35:08 2023 +0530Update windows package link in github action
20044dc042bb3784e5f6610504db7d8741f095be045Bharathy<satish.8483@gmail.com>Mon Apr 24 19:40:23 2023 +0530Fixed transparent decompress chunk test which seem to be flaky.
2012f194e6109d186a4c61352afaa40381db617e437Jan Nidzwetzki<jan@timescale.com>Mon Apr 24 12:26:28 2023 +0200Make compression metadata column names reusableMove the creation of metadata column names for min/max values to separate functions to make the code reusable.
202c54d8bd9464cd2cf410f37968edeb1c438950547Jan Nidzwetzki<jan@timescale.com>Fri Apr 21 15:00:10 2023 +0200Add missing order by to compression_ddl testsSome queries in compression_ddl had no order by. Therefore the output order was not defined, which led to flaky tests.
203583c36e91e115302431accb086eeb996f52411dbAnte Kresic<ante.kresic@gmail.com>Thu Apr 20 09:00:21 2023 +0200Refactor compression code to reduce duplication
204744b44cc52f1c2a3ae329657cdfdf29868df1015Sven Klemm<sven@timescale.com>Tue Apr 18 11:59:11 2023 +0200Fix parameterization in DecompressChunk path generationAll children of an append path are required to have the same parameterization so we have to reparameterize when the selected path does not have the right parameterization.
20523b3f8d7a6c6f9e5549fcf18cbf70937f02bcc57Ante Kresic<ante.kresic@gmail.com>Thu Apr 20 12:54:28 2023 +0200Block unique idx creation on compressed hypertableThis block was removed by accident, in order to support this we need to ensure the uniqueness in the compressed data which is something we should do in the future thus removing this block.
20612f3131f9e784a03136d046f9b2fd840145ee6f0Alexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Thu Apr 20 09:40:34 2023 +0400Post-release 2.10.2Adjust the upgrade/downgrade scripts and add the tests.
207a0df8c8e6df75b952fef9f371d689f2f064397e5Zoltan Haindrich<zoltan@timescale.com>Fri Apr 14 14:24:42 2023 +0000Fix on-insert decompression for unique constraintsInserting multiple rows into a compressed chunk could have bypassed constraint check in case the table had segment_by columns. Decompression is narrowed to only consider candidates by the actual segment_by value. Because of caching - decompression was skipped for follow-up rows of the same Chunk. Fixes #5553
208a49fdbcffba03e4af99d6f578e9f457c24aa8fadAnte Kresic<ante.kresic@gmail.com>Tue Apr 18 14:52:33 2023 +0200Reduce decompression during constraint checkingWhen inserting into a compressed chunk with constraints present, we need to decompress relevant tuples in order to do speculative inserting. Usually we used segment by column values to limit the amount of compressed segments to decompress. This change expands on that by also using segment metadata to further filter compressed rows that need to be decompressed.
20928d9db1af95f6a1ee9302edab79cb730d32099d2Alexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Fri Apr 14 13:52:23 2023 +0400Changelog for 2.10.2## 2.10.2 (2023-04-20) **Bugfixes** * #5410 Fix file trailer handling in the COPY fetcher * #5446 Add checks for malloc failure in libpq calls * #5233 Out of on_proc_exit slots on guc license change * #5428 Use consistent snapshots when scanning metadata * #5499 Do not segfault on large histogram() parameters * #5470 Ensure superuser perms during copy/move chunk * #5500 Fix when no FROM clause in continuous aggregate definition * #5433 Fix join rte in CAggs with joins * #5556 Fix duplicated entries on timescaledb_experimental.policies view * #5462 Fix segfault after column drop on compressed table * #5543 Copy scheduled_jobs list before sorting it * #5497 Allow named time_bucket arguments in Cagg definition * #5544 Fix refresh from beginning of Continuous Aggregate with variable time bucket * #5558 Use regrole for job owner * #5542 Enable indexscan on uncompressed part of partially compressed chunks **Thanks** * @nikolaps for reporting an issue with the COPY fetcher * @S-imo-n for reporting the issue on Background Worker Scheduler crash * @geezhu for reporting issue on segfault in historgram() * @mwahlhuetter for reporting the issue with joins in CAggs * @mwahlhuetter for reporting issue with duplicated entries on timescaledb_experimental.policies view * @H25E for reporting error refreshing from beginning of a Continuous Aggregate with variable time bucket
2105633960f8b0e4675e342b1721bde954fdbe938e7Konstantina Skovola<konstantina@timescale.com>Tue Apr 11 12:33:11 2023 +0300Enable indexscan on uncompressed part of partially compressed chunksThis was previously disabled as no data resided on the uncompressed chunk once it was compressed, but this is not the case anymore with partially compressed chunks, so we enable indexscan for the uncompressed chunk again. Fixes #5432 Co-authored-by: Ante Kresic <ante.kresic@gmail.com>
211ca472ebb0d3e290d029bd9beeda1647547302920shhnwz<mohammed@timescale.com>Wed Apr 12 10:59:26 2023 +0530Fixed transparent decompress chunkTransparent decompress chunk was added into to ignore list due to the side effect of #5118. This issue is to fix the flaky nature of the test.
2129a64385f34db737cc174be5ee8ed560bd82b1663Mats Kindahl<mats@timescale.com>Thu Apr 13 13:28:25 2023 +0200Use regrole for job ownerInstead of using a user name to register the owner of a job, we use regrole. This allows renames to work properly since the underlying OID does not change when the owner name changes. We add a check when calling `DROP ROLE` that there is no job with that owner and generate an error if there is.
21320db884bd72b1798844176d34bb106b211f4e30eAlexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Mon Apr 17 19:23:02 2023 +0400Increase remote tuple and startup costsOur cost model should be self-consistent, and the relative values for the remote tuple and startup costs should reflect their real cost, relative to costs of other operations like CPU tuple cost. For example, now remote costs are set even lower than the parallel tuple and startup cost. Contrary to that, their real world cost is going to be an order of magnitude higher or more, because parallel tuples are sent through shared memory, and remote tuples are sent over the network. Increasing these costs leads to query plan improvements, e.g. we start to favor the GROUP BY pushdown in some cases.
214b16bf3b100c5a9ce693ef5fe49208421445e78c5Fabrízio de Royes Mello<fabriziomello@gmail.com>Mon Apr 17 11:57:40 2023 -0300Fix post repair testsCommit 3f9cb3c2 introduced new repair tests for broken Continuous Aggregates with JOIN clause but in the post.repair.sql we not properly calling the post.repair.cagg_joins.sql because a wrong usage of psql `if` statement.
215d32224a914877f8f9342cca63859ca1d76d9bddbAlexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Fri Apr 14 13:18:15 2023 +0400Add labels to backported PRsMakes it easier to check what was done when looking at the release milestone.
21690e54def8a55e833f7e6bd5408d585ce244c8bd0Sven Klemm<sven@timescale.com>Fri Apr 14 12:22:54 2023 +0200Improve interpolate error message on datatype mismatchInclude information about the expected and the returned datatype in the error details of interpolate.
217a3d778f7a0313fca4ad86f64f9f32158011c8a0eFabrízio de Royes Mello<fabriziomello@gmail.com>Tue Apr 4 15:39:38 2023 -0300Add CI check for missing gitignore entriesWhenever we create a template sql file (*.sql.in) we should add the respective .gitignore entry for the generated test files. So added a CI check to check for missing gitignore entries for generated test files.
218a383c8dd4ff6cc932dfafe00b7a1a44d9efb6740Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Tue Apr 11 16:44:13 2023 +0530Copy scheduled_jobs list before sorting itThe start_scheduled_jobs function mistakenly sorts the scheduled_jobs list in-place. As a result, when the ts_update_scheduled_jobs_list function compares the updated list of scheduled jobs with the existing scheduled jobs list, it is comparing a list that is sorted by job_id to one that is sorted by next_start time. Fix that by properly copying the scheduled_jobs list into a new list and use that for sorting. Fixes #5537
219b10139ba4899d88053c98130881b8fe84cc7ccf6Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Thu Apr 13 20:20:34 2023 +0530Update bgw_custom testcaseAdded a few cleanup steps and updated a test logic to make the testcase runs more stable.
220b136bb554baf08bfc7f648a9d5f8ec59402230a3Maheedhar PV<mahi@timescale.com>Thu Apr 13 21:52:20 2023 +0530Run dist_move_chunk as a solo test in PG15.2Running the test dist_move_chunk in parallel can cause a timeouts(deadlock) in other tests running in parallel on PG15.2. Force the test to run solo.
221ca240c33ca2d6f445984f4f43c38d571c1bfac83Maheedhar PV<mahi@timescale.com>Wed Apr 12 20:26:48 2023 +0530Build failure on windowsThe cmake call to "find_package(OpenSSL)" on windows may set the variable OPENSSL_LIBRARIES to a non-standard list which might include non path items such as "debug", "optimized". These non-standard elements in the list would cause the link failure with error "LNK1104". Fix: Check and retain only valid paths in OPENSSL_LIBRARIES list. closes#407
222464d20fb4103ea99ac048c116f0b386594dff143Ante Kresic<ante.kresic@gmail.com>Thu Mar 30 12:46:44 2023 +0200Propagate vacuum/analyze to compressed chunksWith recent changes, we enabled analyze on uncompressed chunk tables for compressed chunks. This change includes analyzing the compressed chunks table when analyzing the hypertable and its chunks, enabling us to remove the generating stats when compressing chunks.
2233f9cb3c27ac828901842c70e17451beec754bbb8Rafia Sabih<rafia.sabih@gmail.com>Tue Mar 14 16:37:02 2023 +0100Pass join related structs to the cagg rteIn case of joins in the continuous aggregates, pass the required structs to the new rte created. These values are required by the planner to finally query the materialized view. Fixes #5433
22409565acae497274dd48ef8231eda2845aabab1e7Fabrízio de Royes Mello<fabriziomello@gmail.com>Wed Apr 12 12:17:41 2023 -0300Fix timescaledb_experimental.policies duplicatesCommit 16fdb6ca5e introduced `timescaledb_experimental.policies` view to expose the Continuous Aggregate policies but the current JOINS over our catalog are not accurate. Fixed it by properly JOIN the underlying catalog tables to expose the correct information without duplicates about the Continuous Aggregate policies. Fixes #5492
225f6c8468ee630bdad03cdb433ddb6be8daa1709c0Fabrízio de Royes Mello<fabriziomello@gmail.com>Tue Apr 11 16:58:13 2023 -0300Fix timestamp out of range refreshing CAggWhen refreshing from the beginning (window_start=NULL) of a Continuous Aggregate with variable time bucket we were getting a `timestamp out of range` error. Fixed it by setting `-Infinity` when passing `window_start=NULL` when refreshing a Continuous Aggregate with variable time bucket. Fixes #5474, #5534
2263cc8a4ca34ec76f4de66349af3194851acb7c228Mats Kindahl<mats@timescale.com>Wed Apr 12 12:52:41 2023 +0200Fix error message for continuous aggregatesSeveral error messages for continuous aggregates are not following the error message style guidelines at https://www.postgresql.org/docs/current/error-style-guide.html In particular, they do not write the hints and detailed messages as full sentences.
227f0623a8c3891f5a2c28c5da8d3abfa545e5f59d1Sven Klemm<sven@timescale.com>Wed Apr 12 10:56:35 2023 +0200Skip Ordered Append when only 1 child node is presentThis is mostly a cosmetic change. When only 1 child is present there is no need for ordered append. In this situation we might still benefit from a ChunkAppend node here due to runtime chunk exclusion when we have non-immutable constraints, so we still add the ChunkAppend node in that situation even with only 1 child.
2280595ff0888f2ffb8d313acb0bda9642578a9ade3Sven Klemm<sven@timescale.com>Tue Apr 11 22:01:14 2023 +0200Move type support functions into _timescaledb_functions schema
2292d7eb18f249e898e63fc90bf02012af9ce2ccdedSven Klemm<sven@timescale.com>Thu Apr 6 14:50:27 2023 +0200Drop unused SQL functionsThis patch drops the following internal SQL functions which were unused: _timescaledb_internal.is_main_table(regclass); _timescaledb_internal.is_main_table(text, text); _timescaledb_internal.hypertable_from_main_table(regclass); _timescaledb_internal.main_table_from_hypertable(integer); _timescaledb_internal.time_literal_sql(bigint, regtype);
23084b6783a199c37bff6b36a3c0940915e5ca569ceAnte Kresic<ante.kresic@gmail.com>Thu Apr 6 14:00:49 2023 +0200Fix chunk status when inserting into chunksWhile executing compression operations in parallel with inserting into chunks (both operations which can potentially change the chunk status), we could get into situations where the chunk status would end up inconsistent. This change re-reads the chunk status after locking the chunk to make sure it can decompress data when handling ON CONFLICT inserts correctly.
23154074f1fd4ab7acb3e4d2e2becd82b844b570e67Ante Kresic<ante.kresic@gmail.com>Fri Mar 31 11:36:17 2023 +0200Add more compression DML isolation testsVerify that insertion into compressed chunks does not block each other if the chunks is already partially compressed. Also check that using the RETURNING clause works the same.
232dc5bf3b32ee39e121ca9a8888124460b8f1eee1eAnte Kresic<ante.kresic@gmail.com>Tue Mar 14 12:44:44 2023 +0100Test compression DML with physical layout changesThese tests try to verify that changing physical layout of chunks (either compressed or uncompressed) should yield consistent results. They also verify index mapping on compressed chunks is handled correctly.
2339a466ca185ba3df611cbdb460b7b4aa906fcdf2fFabrízio de Royes Mello<fabriziomello@gmail.com>Mon Apr 10 14:33:48 2023 -0300Silence WARNING after extension updateCommit 8afdddc2da added the first step for deprecating the old format of Continuous Aggregate but just for PostgreSQL 15 and later versions. During the extension update we emit a message about the deprecation but this has being emited even if the user is using PostgreSQL versions before 15. Fixed it by emiting the WARNING just when PostgreSQL version is greater or equal to 15.
23404f43335dea11e9c467ee558ad8edfc00c1a45edSven Klemm<sven@timescale.com>Thu Apr 6 13:00:00 2023 +0200Move aggregate support function into _timescaledb_functionsThis patch moves the support functions for histogram, first and last into the _timescaledb_functions schema. Since we alter the schema of the existing functions in upgrade scripts and do not change the aggregates this should work completely transparently for any user objects using those aggregates.
2353814a3f351a0691681e3123631a99e3e5b45aae6Konstantina Skovola<konstantina@timescale.com>Thu Apr 6 09:00:55 2023 +0300Properly format license error hintCommit 57fde383b3dddd0b52263218e65a0135981c2d34 changed the messaging but did not format the error hint correctly. This patch fixes the error hint. Fixes #5490
2368c77be6c68b3f53143eb0faa8b49bbf15674e284Alexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Thu Apr 6 18:10:15 2023 +0400Look up compressed column metadata only at planning timeNow we look them up again at execution time, which adds up for tables with a large number of chunks. This gives about 15
237 speedup (100 mcs) on a small query on a table from tests with 50 chunks: `select id, ts, value from metric_compressed order by id, ts limit 100;`
238df70f3e050e817460e8a089a3a8fc90828d5d6c5Konstantina Skovola<konstantina@timescale.com>Tue Apr 4 17:25:19 2023 +0300Remove unused variable in tsl_get_compressed_chunk_index_for_recompressionCommit 72c0f5b25e569015aacb98cc1be3169a1720116d introduced an unused variable. This patch removes it.
239975e9ca1662ac4dd050b6fb296e51d507a64a773Zoltan Haindrich<zoltan@timescale.com>Fri Mar 17 16:32:33 2023 +0000Fix segfault after column drop on compressed tableDecompression produces records which have all the decompressed data set, but it also retains the fields which are used internally during decompression. These didn't cause any problem - unless an operation is being done with the whole row - in which case all the fields which have ended up being non-null can be a potential segfault source. Fixes #5458 #5411
240feef9206facc5c5f506661de4a81d96ef059b095Sven Klemm<sven@timescale.com>Fri Mar 31 08:22:57 2023 +0200Add _timescaledb_functions schemaCurrently internal user objects like chunks and our functions live in the same schema making locking down that schema hard. This patch adds a new schema _timescaledb_functions that is meant to be the schema used for timescaledb internal functions to allow separation of code and chunks or other user objects.
2416440bb3477eef183459272cb90f6ffa8bf30b682Fabrízio de Royes Mello<fabriziomello@gmail.com>Tue Apr 4 17:31:33 2023 -0300Remove unused functionRemove unused function `invalidation_threshold_htid_found`.
2421fb058b1992bd89b6d69e910b42d5cae5ee46212Bharathy<satish.8483@gmail.com>Wed Apr 5 16:47:52 2023 +0530Support UPDATE/DELETE on compressed hypertables.This patch does following: 1. Executor changes to parse qual ExprState to check if SEGMENTBY column is specified in WHERE clause. 2. Based on step 1, we build scan keys. 3. Executor changes to do heapscan on compressed chunk based on scan keys and move only those rows which match the WHERE clause to staging area aka uncompressed chunk. 4. Mark affected chunk as partially compressed. 5. Perform regular UPDATE/DELETE operations on staging area. 6. Since there is no Custom Scan (HypertableModify) node for UPDATE/DELETE operations on PG versions < 14, we don't support this feature on PG12 and PG13.
243c2941a3f9a95417c77b15db900b61bffc89cf36cSven Klemm<sven@timescale.com>Mon Apr 3 13:09:06 2023 +0200Fix windows package testUse the windows packages from the github release for package testing.
2442e6c6b5c58c5e139f8a34a0de30dd2590908f654Erik Nordström<erik@timescale.com>Wed Mar 8 16:58:05 2023 +0100Refactor and optimize distributed COPYRefactor the code path that handles remote distributed COPY. The main changes include: * Use a hash table to lookup data node connections instead of a list. * Refactor the per-data node buffer code that accumulates rows into bigger CopyData messages. * Reduce the default number of rows in a CopyData message to 100. This seems to improve throughput, probably striking a better balance between message overhead and latency. * The number of rows to send in each CopyData message can now be changed via a new foreign data wrapper option.
245c6b9f5097886d0d33bb88f2aee1d427b0c69b969Ildar Musin<zildermann@gmail.com>Mon Apr 3 16:08:15 2023 +0200Fix OSM chunks exclusion from append pathsOSM chunks have their own fdw_private which conflicts with checks in the MergeAppend code path causing segfaults. This commit fixes this by returning early when there is an OSM chunk in the MergeAppendPath.
246517dee9f6bf9c1a94b7dd05f1ea0057e4f27f5b6Nikhil Sontakke<nikhil@timescale.com>Mon Mar 27 13:40:52 2023 +0530Add test for superuser chunk copy/moveAdd isolation test case to check that the chunk object created during chunk copy/move operation on the destination datanode always has superuser credentials till the end of the operation.
247ff5959f8f9c1d40dfe8b36a18cbd28d78ac77dcaRafia Sabih<rafia.sabih@gmail.com>Tue Mar 28 12:17:06 2023 +0200Handle when FROM clause is missing in continuous aggregate definitionIt now errors out for such a case. Fixes #5500
248cb81c331ae4a9fa233106439ef5f73c02b702065Konstantina Skovola<konstantina@timescale.com>Tue Mar 28 16:27:00 2023 +0300Allow named time_bucket arguments in Cagg definitionFixes #5450
24998218c1d079231a9aa469b37ddd0ed39e77c2adbRafia Sabih<rafia.sabih@gmail.com>Wed Feb 8 11:54:28 2023 +0100Enable joins for heirarchical continuous aggregatesThe joins could be between a continuous aggregate and hypertable, continuous aggregate and a regular Postgres table, and continuous aggregate and a regular Postgres view.
250777c599a345242e69e0e9d505897992c73bf98fcMats Kindahl<mats@timescale.com>Tue Mar 28 09:27:52 2023 +0200Do not segfault on large histogram() parametersThere is a bug in `width_bucket()` causing an overflow and subsequent NaN value as a result of dividing with `+inf`. The NaN value is interpreted as an integer and hence generates an index out of range for the buckets. This commit fixes this by generating an error rather than segfaulting for bucket indexes that are out of range.
25122841abdf0d2c7b853386d8594d2a317df5f1e07Konstantina Skovola<konstantina@timescale.com>Mon Mar 27 11:19:40 2023 +0300Update community license related errorsUpdate the error message printed when attempting to use a community license feature with apache license installed. Fixes #5438
252a51d21efbe3ec0a16c986d2e349c7a29e06b2b0cErik Nordström<erik@timescale.com>Thu Mar 16 16:45:28 2023 +0100Fix issue creating dimensional constraintsDuring chunk creation, the chunk's dimensional CHECK constraints are created via an "upcall" to PL/pgSQL code. However, creating dimensional constraints in PL/pgSQL code sometimes fails, especially during high-concurrency inserts, because PL/pgSQL code scans metadata using a snapshot that might not see the same metadata as the C code. As a result, chunk creation sometimes fail during constraint creation. To fix this issue, implement dimensional CHECK-constraint creation in C code. Other constraints (FK, PK, etc.) are still created via an upcall, but should probably also be rewritten in C. However, since these constraints don't depend on recently updated metadata, this is left to a future change. Fixes #5456
25372c0f5b25e569015aacb98cc1be3169a1720116dKonstantina Skovola<konstantina@timescale.com>Mon Feb 13 13:02:51 2023 +0200Rewrite recompress_chunk in C for segmentwise processingThis patch introduces a C-function to perform the recompression at a finer granularity instead of decompressing and subsequently compressing the entire chunk. This improves performance for the following reasons: - it needs to sort less data at a time and - it avoids recreating the decompressed chunk and the heap inserts associated with that by decompressing each segment into a tuplesort instead. If no segmentby is specified when enabling compression or if an index does not exist on the compressed chunk then the operation is performed as before, decompressing and subsequently compressing the entire chunk.
2547e43f45ccb8b30800db5f19af6ab024d37efea2bNikhil Sontakke<nikhil@timescale.com>Tue Mar 21 16:30:21 2023 +0530Ensure superuser perms during copy/move chunkThere is a security loophole in current core Postgres, due to which it's possible for a non-superuser to gain superuser access by attaching dependencies like expression indexes, triggers, etc. before logical replication commences. To avoid this, we now ensure that the chunk objects that get created for the subscription are done so as a superuser. This avoids malicious dependencies by regular users.
25538fcd1b76b14ddd73f64853a1bf6efca5e17fb4cFabrízio de Royes Mello<fabriziomello@gmail.com>Fri Mar 17 17:47:34 2023 -0300Improve Realtime Continuous Aggregate performanceWhen calling the `cagg_watermark` function to get the watermark of a Continuous Aggregate we execute a `SELECT MAX(time_dimension)` query in the underlying materialization hypertable. The problem is that a `SELECT MAX(time_dimention)` query can be expensive because it will scan all hypertable chunks increasing the planning time for a Realtime Continuous Aggregates. Improved it by creating a new catalog table to serve as a cache table to store the current Continous Aggregate watermark in the following situations: - Create CAgg: store the minimum value of hypertable time dimension data type; - Refresh CAgg: store the last value of the time dimension materialized in the underlying materialization hypertable (or the minimum value of materialization hypertable time dimension data type if there's no data materialized); - Drop CAgg Chunks: the same as refresh cagg. Closes #4699, #5307
256699fcf48aa71189e581c27777715f89824b56268shhnwz<mohammed@timescale.com>Fri Dec 23 11:07:51 2022 +0530Stats improvement for Uncompressed ChunksDuring the compression autovacuum use to be disabled for uncompressed chunk and enable after decompression. This leads to postgres maintainence issue. Let's not disable autovacuum for uncompressed chunk anymore. Let postgres take care of the stats in its natural way. Fixes #309
2575c07a57a0246cf81eb55d5f563825cd20512c7cfAlexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Wed Mar 22 12:43:22 2023 +0400Simplify control flow in decompress_chunk_execNo functional changes, mostly just reshuffles the code to prepare for batch decompression. Also removes unneeded repeated column value stores and ExecStoreTuple, to save 3-5
258execution time on some queries.
25963b416b6b0065e6e178913a916a2f366f4f0d1a4Erik Nordström<erik@timescale.com>Fri Mar 10 13:15:02 2023 +0100Use consistent snapshots when scanning metadataInvalidate the catalog snapshot in the scanner to ensure that any lookups into `pg_catalog` uses a snapshot that is consistent with the snapshot used to scan TimescaleDB metadata. This fixes an issue where a chunk could be looked up without having a proper relid filled in, causing an assertion failure (`ASSERT_IS_VALID_CHUNK`). When a chunk is scanned and found (in `chunk_tuple_found()`), the Oid of the chunk table is filled in using `get_relname_relid()`, which could return InvalidOid due to use of a different snapshot when scanning `pg_class`. Calling `InvalidateCatalogSnapshot()` before starting the metadata scan in `Scanner` ensures the pg_catalog snapshot used is refreshed. Due to the difficulty of reproducing this MVCC issue, no regression or isolation test is provided, but it is easy to hit this bug when doing highly concurrent COPY:s into a distributed hypertable.
2607d6cf90ee783656b8230e6ed8b35b47126729423Fabrízio de Royes Mello<fabriziomello@gmail.com>Sun Mar 19 18:30:48 2023 -0300Add missing gitignore entryPull request #4827 introduced a new template SQL test file but missed to add the properly `.gitignore` entry to ignore generated test files.
261cc51e20e87f3ce9426b88790149cd7321cc4853eBharathy<satish.8483@gmail.com>Mon Mar 20 21:59:38 2023 +0530Add support for ON CONFLICT DO UPDATE for compressed hypertablesThis patch fixes execution of INSERT with ON CONFLICT DO UPDATE by removing error and allowing UPDATE do happen on the given compressed hypertable.
2628cccc375fbf3bd8e0025f596583d3f09db489e9dKonstantina Skovola<konstantina@timescale.com>Tue Mar 14 14:23:09 2023 +0200Add license information to extension descriptionFixes #5436
263736c20fb7194f8e057fb5101e19deeba8c78946bKonstantina Skovola<konstantina@timescale.com>Mon Mar 20 14:53:37 2023 +0200Hardcode PG14-15 versions for chocolatey
2642570ab11109df25d1839042ec46a0b404cdd0beasyvb<smitty@timescale.com>Wed Mar 15 20:34:05 2023 -0400Add new clangd cache location to gitignore
26567ff84e8f2e380b8466152b8054ca4d30a17a3edMats Kindahl<mats@timescale.com>Wed Mar 15 14:20:41 2023 +0100Add check for malloc failure in libpq callsThe functions `PQconndefaults` and `PQmakeEmptyPGresult` calls `malloc` and can return NULL if it fails to allocate memory for the defaults and the empty result. It is checked with an `Assert`, but this will be removed in production builds. Replace the `Assert` with an checks to generate an error in production builds rather than trying to de-reference the pointer and cause a crash.
266790b322b242351b151bfbd46706d42dc61e05595Zoltan Haindrich<zoltan@timescale.com>Mon Mar 13 14:04:00 2023 +0000Fix DEFAULT value handling in decompress_chunkThe sql function decompress_chunk did not filled in default values during its operation. Fixes #5412
267827684f3e2718c09e93914d60b88e79488374b33Alexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Wed Mar 15 17:27:32 2023 +0400Use prepared statements for parameterized data node scansThis allows us to avoid replanning the inner query on each new loop, speeding up the joins.
26803a799b874a1a5d6accb40a2b49ed53a77b48e0aSven Klemm<sven@timescale.com>Tue Mar 14 20:21:35 2023 +0100Mention that new status values need handling in downgrade scriptWhen adding new status values we must make sure to add special handling for these values to the downgrade script as previous versions will not know how to deal with those.
269f8022eb33253dbe91bc643c317b787e03be37e1dDmitry Simonenko<dmitry@timescale.com>Mon Mar 13 17:15:31 2023 +0200Add additional tests for compression with HAMake sure inserts into compressed chunks work when a DN is down Fix #5039
27065562f02e88e814b4823be40fd27bee245b130aeSven Klemm<sven@timescale.com>Sun Jan 29 21:53:50 2023 +0100Support unique constraints on compressed chunksThis patch allows unique constraints on compressed chunks. When trying to INSERT into compressed chunks with unique constraints any potentially conflicting compressed batches will be decompressed to let postgres do constraint checking on the INSERT. With this patch only INSERT ON CONFLICT DO NOTHING will be supported. For decompression only segment by information is considered to determine conflicting batches. This will be enhanced in a follow-up patch to also include orderby metadata to require decompressing less batches.
271c02cb76b38ee3ecbf33a8fe0d6a5864454ee2b67Sven Klemm<sven@timescale.com>Sun Feb 5 19:23:14 2023 +0100Don't reindex relation during decompress_chunkReindexing a relation requires AccessExclusiveLock which prevents queries on that chunk. This patch changes decompress_chunk to update the index during decompression instead of reindexing. This patch does not change the required locks as there are locking adjustments needed in other places to make it safe to weaken that lock.
27220ea406616d557bb93de5c93710656bce0a5de8fSven Klemm<sven@timescale.com>Sun Mar 12 21:12:59 2023 +0100Add utility function to map attribute numbersThis patch adds a function ts_map_attno that can be used to map the attribute number from one relation to another by column name.
273356a20777c6f1aab234c5604f0f97de8077b4890Jan Nidzwetzki<jan@timescale.com>Fri Mar 10 14:34:56 2023 +0100Handle user-defined FDW options properlyThis patch changes the way user-defined FDW options (e.g., startup costs, per-tuple costs) are handled. So far, these values were retrieved in apply_fdw_and_server_options() but reset to default values afterward.
2745e0391392aca031c601f79e885452bb82ad909d1Maheedhar PV<mahi@timescale.com>Mon Mar 13 05:18:18 2023 +0530Out of on_proc_exit slots on guc license changeProblem: When the guc timescaledb.license = 'timescale' is set in the conf file and a SIGHUP is sent to postgress process and a reload of the tsl module is triggered. This reload happens in 2 phases 1. tsl_module_load is called which will load the module only if not already loaded and 2.The ts_module_init is called for every ts_license_guc_assign_hook irrespective of if it is new load.This ts_module_init initialization function also registers a on_proc_exit function to be called on exit. The list of on_proc_exit methods are maintained in a fixed array on_proc_exit_list of size MAX_ON_EXITS (20) which gets filled up on repeated SIGHUPs and hence an error. Fix: The fix is to make the ts_module_init() register the on_proc_exit callback, only in case the module is reloaded and not in every init call. Closes #5233
275e92d5ba748de9ba7f26221ebb9717c7db3fcca5dAlexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Thu Mar 9 14:34:28 2023 +0400Add more tests for compressionUnit tests for different data sequences, and SQL test for float4.
276f5db023152afed21ac5ea413b5e5ae12185a23beJan Nidzwetzki<jan@timescale.com>Thu Mar 9 14:19:19 2023 +0100Track file trailer only in debug buildsThe commit 96574a7 changes the handling of the file_trailer_received flag. It is now only used in asserts and not in any other kind of logic. This patch encapsulates the file_trailer_received in a USE_ASSERT_CHECKING macro.
277217ba014a7fc8e864a1dbd1b4af8634db67ed507Sven Klemm<sven@timescale.com>Wed Mar 8 23:03:51 2023 +0100Use version checks to decide about RelationGetSmgr backportingUse explicit version checks to decide whether to define backported RelationGetSmgr function or rely on the function being available. This simplifies the cmake code a bit and make the backporting similar to how we handle this for other functions.
2787b8177aa74de886b2e88a0fad41bc8ab9feb1e87Jan Nidzwetzki<jan@timescale.com>Tue Mar 7 13:32:02 2023 +0100Fix file trailer handling in the COPY fetcherThe copy fetcher fetches tuples in batches. When the last element in the batch is the file trailer, the trailer was not handled correctly. The existing logic did not perform a PQgetCopyData in that case. Therefore the state of the fetcher was not set to EOF and the copy operation was not correctly finished at this point. Fixes: #5323
279a854b2760f66cc640bf2fe71683b0e4595dfbddeSven Klemm<sven@timescale.com>Wed Mar 8 13:27:13 2023 +0100Simplify ts_indexing_relation_has_primary_or_unique_indexRely on postgres functionality for index column tracking instead of rolling our own.
280f54dd7b05df420df1fd3318bd3f768305c619c20Bharathy<satish.8483@gmail.com>Wed Mar 8 18:16:29 2023 +0530Fix SEGMENTBY columns predicates to be pushed downWHERE clause with SEGMENTBY column of type text/bytea non-equality operators are not pushed down to Seq Scan node of compressed chunk. This patch fixes this issue. Fixes #5286
281c76a0cff688afe970d256c31862e63207d29b2baErik Nordström<erik@timescale.com>Fri Feb 24 12:38:16 2023 +0100Add parallel support for partialize_agg()Make `partialize_agg()` support parallel query execution. To make this work, the finalize node need combine the individual partials from each parallel worker, but the final step that turns the resulting partial into the finished aggregate should not happen. Thus, in the case of distributed hypertables, each data node can run a parallel query to compute a partial, and the access node can later combine and finalize these partials into the final aggregate. Esssentially, there will be one combine step (minus final) on each data node, and then another one plus final on the access node. To implement this, the finalize aggregate plan is simply modified to elide the final step, and to reserialize the partial. It is only possible to do this at the plan stage; if done at the path stage, the PostgreSQL planner will hit assertions that assume that the node has certain values (e.g., it doesn't expect combine Paths to skip the final step).
282c13ed17fbce56129136239ad369ac5e5f1502821Bharathy<satish.8483@gmail.com>Tue Mar 7 20:11:42 2023 +0530Fix DELETE command tagDELETE on hypertables always reports 0 as affected rows. This patch fixes this issue.
283f680b995299c2900a1883f4a94128b89d5b61db5Sven Klemm<sven@timescale.com>Tue Mar 7 11:29:52 2023 +0100Fix assertion in calculate_chunk_interval for negative target sizeWhen called with negative chunk_target_size_bytes calculate_chunk_interval will throw an assertion. This patch adds error handling for this condition. Found by sqlsmith.
28400321dba410dbfd3984c45401941d1f5989e05deSven Klemm<sven@timescale.com>Tue Mar 7 09:42:59 2023 +01002.10.1 Post-release adjustmentsAdd 2.10.1 to update test scripts and adjust the downgrade versioning.
2855a3cacd06f95270569082cf14ba55b9092426c17Konstantina Skovola<konstantina@timescale.com>Fri Feb 10 10:21:47 2023 +0200Fix sub-second intervals in hierarchical caggsPreviously we used date_part("epoch", interval) and integer division internally to determine whether the top cagg's interval is a multiple of its parent's. This led to precision loss and wrong results in the case of intervals with sub-second components. Fixed by using the `ts_interval_value_to_internal` function to convert intervals to appropriate integer representation for division. Fixes #5277
28600b566dfe478c11134bcf1e7bcf38943e7fafe8fFabrízio de Royes Mello<fabriziomello@gmail.com>Mon Mar 6 15:51:03 2023 -0300Remove unused functionsWe don't use `ts_catalog_delete[_only]` functions anywhere and instead we rely on `ts_catalog_delete_tid[_only]` functions so removing it from our code base.
287d386aa1def48bb2a3321beffe3bb565548666765Sven Klemm<sven@timescale.com>Fri Mar 3 08:44:49 2023 +0100Release 2.10.1This release contains bug fixes since the 2.10.0 release. We recommend that you upgrade at the next available opportunity. **Bugfixes** * #5159 Support Continuous Aggregates names in hypertable_(detailed_)size * #5226 Fix concurrent locking with chunk_data_node table * #5317 Fix some incorrect memory handling * #5336 Use NameData and namestrcpy for names * #5343 Set PortalContext when starting job * #5360 Fix uninitialized bucket_info variable * #5362 Make copy fetcher more async * #5364 Fix num_chunks inconsistency in hypertables view * #5367 Fix column name handling in old-style continuous aggregates * #5378 Fix multinode DML HA performance regression * #5384 Fix Hierarchical Continuous Aggregates chunk_interval_size **Thanks** * @justinozavala for reporting an issue with PL/Python procedures in the background worker * @Medvecrab for discovering an issue with copying NameData when forming heap tuples. * @pushpeepkmonroe for discovering an issue in upgrading old-style continuous aggregates with renamed columns * @pushpeepkmonroe for discovering an issue in upgrading old-style continuous aggregates with renamed columns
2885cd2c038796fb302190b080c90e5acddbef4b8d1Sven Klemm<sven@timescale.com>Sat Mar 4 10:18:34 2023 +0100Simplify windows-build-and-test-ignored.yamlRemove code not needed for the skip workflow of the windows test.
2898a2f1f916aeee0dabc0eb653f2483ba5e8d43f74Sven Klemm<sven@timescale.com>Sat Mar 4 09:06:28 2023 +0100Fix windows package testChocolatey has all the postgres versions we need available so we can reenable previously disabled tests. But the recent packages seem to have different versioning schema without a suffix.
290830c37b5b0d2ab920e12e288000a4cdb0f2d5896Dmitry Simonenko<dmitry@timescale.com>Mon Mar 6 17:42:36 2023 +0200Fix concurrent locking with chunk_data_node tableConcurrent insert into dist hypertable after a data node marked as unavailable would produce 'tuple concurrently deleted` error. The problem occurs because of missing tuple level locking during scan and concurrent delete from chunk_data_node table afterwards, which should be treated as `SELECT … FOR UPDATE` case instead. Based on the fix by @erimatnor. Fix #5153
2914c0075010dbf57d6d300feda74bfa60cb76355baIldar Musin<zildermann@gmail.com>Thu Mar 2 17:13:18 2023 +0100Add hooks for hypertable dropsTo properly clean up the OSM catalog we need a way to reliably track hypertable deletion (including internal hypertables for CAGGS).
292474b09bdfc1f7bf2fe9039c07d6a97f34b9bd495Sven Klemm<sven@timescale.com>Fri Feb 24 21:08:45 2023 +0100Use pgspot 0.5.0 in CI
29332046832d3af53d2432bb1b2c7c9bdf5f88fcfb8Fabrízio de Royes Mello<fabriziomello@gmail.com>Thu Mar 2 16:09:49 2023 -0300Fix Hierarchical CAgg chunk_interval_sizeWhen a Continuous Aggregate is created the `chunk_interval_size` is defined my the `chunk_interval_size` of the original hypertable multiplied by a fixed factor of 10. The problem is currently when we create a Hierarchical Continuous Aggregate the same factor is applied and it lead to an exponential `chunk_interval_size`. Fixed it by just copying the `chunk_interval_size` from the base Continuous Aggregate for an Hierachical Continuous Aggreagate. Fixes #5382
2941423b55d1888b73c40d3d326fa63f8647fd8a413Nikhil Sontakke<nikhil@timescale.com>Thu Mar 2 13:24:31 2023 +0530Fix perf regression due to DML HAWe added checks via #4846 to handle DML HA when replication factor is greater than 1 and a datanode is down. Since each insert can go to a different chunk with a different set of datanodes, we added checks on every insert to check if DNs are unavailable. This increased CPU consumption on the AN leading to a performance regression for RF > 1 code paths. This patch fixes this regression. We now track if any DN is marked as unavailable at the start of the transaction and use that information to reduce unnecessary checks for each inserted row.
295a6ff7ba6cc15b280a275e5acd315741ec9c86accMats Kindahl<mats@timescale.com>Tue Feb 28 12:04:17 2023 +0100Rename columns in old-style continuous aggregatesFor continuous aggregates with the old-style partial aggregates renaming columns that are not in the group-by clause will generate an error when upgrading to a later version. The reason is that it is implicitly assumed that the name of the column is the same as for the direct view. This holds true for new-style continous aggregates, but is not always true for old-style continuous aggregates. In particular, columns that are not part of the `GROUP BY` clause can have an internally generated name. This commit fixes that by extracting the name of the column from the partial view and use that when renaming the partial view column and the materialized table column.
296e2e7ae304521b74ac6b3f157a207da047d44ab06Sven Klemm<sven@timescale.com>Fri Mar 3 11:22:06 2023 +0100Don't run sanitizer test on individual PRsSanitizer tests take a long time to run so we don't want to run them on individual PRs but instead run them nightly and on commits to master.
2979574dd8e748486d9c365c199c94b4b535a7dd250Sven Klemm<sven@timescale.com>Fri Mar 3 08:11:49 2023 +0100Adjust ARM64 package testWe only package timescaledb for ubuntu kinetic on PG14 because there are no prebuilt postgres packages available for the other postgres versions.
2986be14423d5c51282d5c0d6f9c0b57a4e7123a4b7Pallavi Sontakke<pallavi@timescale.com>Fri Mar 3 15:52:34 2023 +0530Flag test space_constraint.sql.in for release run (#5380)It was incorrectly flagged as requiring a debug build. Disable-check: force-changelog-changed
299386d31bc6e51913a02b0f0a0f964b36068bb9925Erik Nordström<erik@timescale.com>Fri Feb 24 18:25:45 2023 +0100Make copy fetcher more asyncMake the copy fetcher more asynchronous by separating the sending of the request for data from the receiving of the response. By doing that, the async append node can send the request to each data node before it starts reading the first response. This can massively improve the performance because the response isn't returned until the remote node has finished executing the query and is ready to return the first tuple.
300750e69ede1a3161b5a650a7a0dfe1dd9cf1fe1b0Sotiris Stamokostas<sotiris@timescale.com>Thu Mar 2 09:54:55 2023 +0200Renamed size_utils.sqlRenamed: tsl/test/sql/size_utils.sql tsl/test/expected/size_utils.out To: tsl/test/sql/size_utils_tsl.sql tsl/test/expected/size_utils_tsl.out because conflicting with test/sql/size_utils.sql
3017887576afaa113bc6e45f5007a6c6bca21b2108dJan Nidzwetzki<jan@timescale.com>Thu Feb 23 20:23:32 2023 +0100Handle MERGE command in reference join pushdownAt the moment, the MERGE command is not supported on distributed hypertables. This patch ensures that the join pushdown code ignores the invocation by the MERGE command.
302e6f6eb3ab8c95b2531401324b97d345ec6fb8ff2shhnwz<mohammed@timescale.com>Sun Feb 26 22:18:02 2023 +0530Fix for inconsistent num_chunksDifferent num_chunks values reported by timescaledb_information.hypertables and timescaledb_information.chunks. View definition of hypertables was not filtering dropped and osm_chunks. Fixes #5338
3032f7e0433a99d48455e65bcc7e6f63f547b243c7fgayyappan<gayathri@timescale.com>Fri Oct 28 16:32:43 2022 -0400Create index fails if hypertable has foreign table chunkWe cannot create indexes on foreign tables. This PR modifies process_index_chunk to skip OSM chunks
30456ce7907d91ba8b5ec80ff2d79c32ceaaae65eaaBharathy<satish.8483@gmail.com>Mon Feb 27 09:23:07 2023 +0530Backport MERGE command specific postgresql codeThis patch backports following: 1. Refactor ExecInsert/Delete/Update Backported commit 25e777cf8e547d7423d2e1e9da71f98b9414d59e 2. Backport all MERGE related interfaces and its implementations. Backported commit 7103ebb7aae8ab8076b7e85f335ceb8fe799097c
305152ef02d74fbe376e307399564bcb48b23a18150Fabrízio de Royes Mello<fabriziomello@gmail.com>Fri Feb 24 09:58:28 2023 -0300Fix uninitialized bucket_info variableThe `bucket_info` variable is initialized by `caggtimebucketinfo_init` function called inside the following branch: `if (rte->relkind == RELKIND_RELATION || rte->relkind == RELKIND_VIEW)` If for some reason we don't enter in this branch then the `bucket_info` will not be initialized leading to an uninitialized variable when returning `bucket_info` at the end of the `cagg_validate_query` function. Fixed it by initializing with zeros the `bucket_info` variable when declaring it. Found by coverity scan.
3060118e6b9520a4c45363e2c92d4664a91dd77e786noctarius aka Christoph Engelbert<me@noctarius.com>Mon Jan 9 17:20:38 2023 +0100Support CAGG names in hypertable_(detailed_)sizeThis small patch adds support for continuous aggregates to the `hypertable_detailed_size` (and with that `hypertable_size`). It adds an additional check to see if a continuous aggregate exists if a hypertable with the given regclass name isn't found.
307c8c50dad7eca4f7425bfb9980b872a1c44201cebMaheedhar PV<mahi@timescale.com>Tue Feb 21 23:03:46 2023 +0530Post-release fixes for 2.10.0Bumping the previous version and adding tests for 2.10.0
308e0be9eaa281527ee1cc8569ce025cfe64dca8574Jan Nidzwetzki<jan@timescale.com>Tue Jan 24 09:48:07 2023 +0100Allow pushdown of reference table joinsThis patch adds the functionality that is needed to perform distributed, parallel joins on reference tables on access nodes. This code allows the pushdown of a join if: * (1) The setting "ts_guc_enable_per_data_node_queries" is enabled * (2) The outer relation is a distributed hypertable * (3) The inner relation is marked as a reference table * (4) The join is a left join or an inner join
309f12a361ef7de9566113ea79617d49d62597b4bd2Dmitry Simonenko<dmitry@timescale.com>Tue Feb 21 19:17:20 2023 +0200Add timeout argument to the ping_data_node()This PR introduces a timeout argument and a new logic to the timescale_internal.ping_data_node() function which allows to handle io timeouts for nodes being unresponsive. Fix #5312
31009766343997aa903f9d6a1ab14bcfc49a0045864Sven Klemm<sven@timescale.com>Mon Feb 20 13:31:19 2023 +0100Set name for COPY insert buffer hash tableHaving the hash table named makes debugging easier as the name is used for the MemoryContext used by the hash table.
311330bb8f4af761f3277b4b62269dca9c50e882bacJan Nidzwetzki<jan@timescale.com>Thu Feb 16 15:38:58 2023 +0100Added coccinelle rule to find strlcpy on NameDataNameData is a fixed-size type of 64 bytes. Using strlcpy to copy data into a NameData struct can cause problems because any data that follows the initial null-terminated string will also be part of the data.
3128a51a76d00b0003ad56bfa39c208da4332bf6042Mats Kindahl<mats@timescale.com>Mon Feb 20 12:25:50 2023 +0100Fix changelog message for NameData issue
3130746517c77d4412909776e009143fbaed5c71f0eOleg Tselebrovskiy<mr.medvecrab@gmail.com>Tue Feb 14 13:17:04 2023 +0700Fix some incorrect memory handlingWhile running TimescaleDB under valgrind I've found two cases of incorrect memory handling. Case 1: When creating timescaledb extension, during the insertion of metadata there is some junk in memory that is not zeroed before writing there. Changes in metadata.c fix this. Case 2: When executing GRANT smth ON ALL TABLES IN SCHEMA some_schema and deconstructing this statement into granting to individual tables, process of copying names of those tables is wrong. Currently, you aren't copying the data itself, but an address to data on a page in some buffer. There's a problem - when the page in this buffer changes, copied address would lead to wrong data. Changes in process_utility.c fix this by allocating memory and then copying needed relname there. Fixes #5311
3147e43c702ba2663d56feba1043431d2232d8437c8Jan Nidzwetzki<jan@timescale.com>Mon Feb 20 09:23:41 2023 +0100Increase timeout for PostgreSQL in upgrade testsThe upgrade and downgrade tests are running PostgreSQL in Docker containers. The function 'wait_for_pg' is used to determine if PostgreSQL is ready to accept connections. In contrast to the upgrade tests, the downgrade tests use more relaxed timeout values. The upgrade tests sometimes fail because PostgreSQL cannot accept connections within the configured time range. This patch applies the more relaxed timeout values also to the upgrade script.
3150cbd7407a66c84365f8969d1a197572a57325442Mats Kindahl<mats@timescale.com>Fri Feb 17 13:16:52 2023 +0100Get PortalContext when starting jobWhen executing functions, SPI assumes that `TopTransactionContext` is used for atomic execution contexts and `PortalContext` is used for non-atomic contexts. Since jobs need to be able to commit and start transactions, they are executing in a non-atomic context hence `PortalContext` will be used, but `PortalContext` is not set when starting the job. This is not a problem for PL/PgSQL executor, but for other executors (such as PL/Python) it would be. This commit fixes the issue by setting the `PortalContext` variable to the portal context created for the portal and restores it (to NULL) after execution. Fixes #5326
31683fc20f1954c5ff0d22f790cd8ee11309724445aJan Nidzwetzki<jan@timescale.com>Fri Feb 17 16:24:45 2023 +0100Change bgw_main field length to BGW_MAXLENThe content of bgw_main is copied into BackgroundWorker. bgw_function_name, which has a length of BGW_MAXLEN. This patch ensures that the size of these fields has the same length.
31791b4a66eb9ae5feea57b94707b4a8e44b6505e9dMaheedhar PV<58430377+mahipv@users.noreply.github.com>Mon Feb 20 11:06:05 2023 +0530Release 2.10.0 (#5324)This release contains new features and bug fixes since the 2.9.3 release. This release is high priority for upgrade. We strongly recommend that you upgrade as soon as possible. **Features** * #5241 Allow RETURNING clause when inserting into compressed chunks * #5245 Manage life-cycle of connections via memory contexts * #5246 Make connection establishment interruptible * #5253 Make data node command execution interruptible * #5243 Enable real-time aggregation for continuous aggregates with joins * #5262 Extend enabling compression on a continuous aggregrate with 'compress_segmentby' and 'compress_orderby' parameters **Bugfixes** * #4926 Fix corruption when inserting into compressed chunks * #5218 Add role-level security to job error log * #5214 Fix use of prepared statement in async module * #5290 Compression can't be enabled on continuous aggregates when segmentby/orderby columns need quotation * #5239 Fix next_start calculation for fixed schedules
318ce85546b5633ba2654fc3c26c658a9381e7ce73dSven Klemm<sven@timescale.com>Mon Feb 13 08:35:41 2023 +0100Fix ABI testPin the OpenSSL version we compile against to OpenSSL 1.1 in backwards ABI test because OpenSLL 3 is not available across all supported versions.
319c7f46393e7406791f49edababe9f058995b152a0Fabrízio de Royes Mello<fabriziomello@gmail.com>Fri Feb 17 19:07:52 2023 -0300Change usage of term nested to hierarchicalTo don't make developers confused the right name for Continuous Aggregates on top of another Continuous Aggregates is `Hierarchical Continuous Aggregates`, so changed the usage of term `nested` for `hierarchical`.
320d50de8a72d1c294323ac4f0599ca1e5e1b89546fNikhil Sontakke<nikhil@timescale.com>Thu Feb 2 10:38:32 2023 +0200Fix uninitialized `bucket_info.htpartcolno` warningFound by coverity.
32138b71d0e703caa568a38a854e041a916c5601057Mats Kindahl<mats@timescale.com>Wed Feb 15 15:32:12 2023 +0100Use NameData and namestrcpy for namesUsing `strlcpy` to copy variables holding PostgreSQL names can cause issues since names are fixed-size types of length 64. This means that any data that follows the initial null-terminated string will also be part of the data. Instead of using `const char*` for PostgreSQL names, use `NameData` type for PostgreSQL names and use `namestrcpy` to copy them rather than `strlcpy`.
32209636092714bbff8689d8d37c3965b99bee0db26Jacob Champion<jchampion@timescale.com>Mon Feb 6 09:05:33 2023 -0800Align GUC initializations with boot valuesAs of upstream a73952b795 (16devel), custom GUCs have their initialized values checked against the configured boot value. If they differ, an assertion is tripped. So I've gone through the list and aligned the two sides, adding defaults where they did not previously exist for consistency. To allow for dynamic boot values, the new assertion logic allows the initialized value to be zero, in which case any boot value will be accepted. ts_guc_max_open_chunks_per_insert relies on the value of work_mem, so I've removed its (explicit) initializer entirely.
323917f7804a73ce93bbd704061011516a14123af0eJacob Champion<jchampion@timescale.com>Wed Feb 1 16:41:16 2023 -0800Remove obsolete usage of AssertArg()Upstream HEAD (16devel) removed this in commit b1099eca8f. Assert() is identical.
324f21bf6faacb3c4f9cb2a2af3f76ea3db80cdb949Jacob Champion<jchampion@timescale.com>Wed Feb 1 17:00:19 2023 -0800Fix misuse of CStringGetDatumOidFunctionCall1() returns a Datum, not const char *.
32520e468f40c98b45c29452a0a8c490fabf820670dJacob Champion<jchampion@timescale.com>Fri Jan 27 15:14:17 2023 -0800Fix use of TextDatumGetCString()TextDatumGetCString() was made typesafe in upstream HEAD (16devel), so now the compiler catches this. As Tom puts it in ac50f84866: "TextDatumGetCString(PG_GETARG_TEXT_P(x))" is formally wrong: a text* is not a Datum. Although this coding will accidentally fail to fail on all known platforms, it risks leaking memory if a detoast step is needed, unlike "TextDatumGetCString(PG_GETARG_DATUM(x))" which is what's used elsewhere.
326fd66f5936abb6f9271a713e15002be3c4854fb39Alexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Thu Feb 9 12:55:07 2023 +0400Warn about mismatched chunk cache sizesJust noticed abysmal INSERT performance when experimenting with one of our customers' data set, and turns out my cache sizes were misconfigured, leading to constant hypertable chunk cache thrashing. Show a warning to detect this misconfiguration. Also use more generous defaults, we're not supposed to run on a microwave (unlike Postgres).
32748d4f41d95dccf99751bec04b95d05f9ad4d6f45Konstantina Skovola<konstantina@timescale.com>Tue Feb 14 15:07:03 2023 +0200Run apt package tests against Ubuntu 22.10 (Kinetic Kudu)
3289d3866a50efecbed3604622b7b3b981bea0200c3Zoltan Haindrich<zoltan@timescale.com>Fri Feb 10 13:22:09 2023 +0000Accept all compression options on caggsEnable to properly handle 'compress_segmentby' and 'compress_orderby' compression options on continous aggregates. ALTER MATERIALIZED VIEW test_table_cagg SET ( timescaledb.compress = true, timescaledb.compress_segmentby = 'device_id' ); Fixes #5161
329d00c1f37213dced5c443baf6fdfc1d298281779dAlexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Mon Feb 13 11:29:58 2023 +0400Fix some errors in processing of code coverage dataWe were using mismatched compiler and gcov, which led to either segfaults or errors like "GCOV_TAG_COUNTER_ARCS mismatch". Add some cmake code that tries to find the gcov that matches the compiler. This should hopefully fix some of the mysterious missing coverage problems that we've been experiencing for a while.
3309ec11d8af6e56dcf994c7e70c66ae40233099230Sven Klemm<sven@timescale.com>Fri Feb 10 12:04:32 2023 +0100Bump PG version used in CI to 12.14, 13.10, 14.7 and 15.2
331ef25fb9ec79d8cbe7d75fdc24fe1e3221f383d15Sven Klemm<sven@timescale.com>Fri Feb 10 12:10:36 2023 +0100Add dist_ref_table_join generated test files to .gitignore
332484a4ea3fc5acb58468f19d445b38c7aaf38fb7bAlexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Fri Feb 10 20:02:46 2023 +0400Fix our codecov repository yamlCodecov keeps complaining that it's invalid.
333ece15d66a438971dcd517d0575c03305e27874ddRafia Sabih<rafia.sabih@gmail.com>Mon Jan 30 14:53:51 2023 +0530Enable real time aggregation for caggs with joins
334348796f9d9dcfc01716e78886ac1cb3de8623f8fKonstantina Skovola<konstantina@timescale.com>Fri Jan 27 17:06:59 2023 +0200Fix next_start calculation for fixed schedulesThis patch fixes several issues with next_start calculation. - Previously, the offset was added twice in some cases. This is fixed by this patch. - Additionally, schedule intervals with month components were not handled correctly. Internally, time_bucket with origin is used to calculate the next start. However, in the case of month intervals, the timestamp calculated for a bucket is always aligned on the first day of the month, regardless of origin. Therefore, previously the result was aligned with origin by adding the difference between origin and its respective time bucket. This difference was computed as a fixed length interval in terms of days and time. That computation led to incorrect computation of next start occasionally, for example when a job should be executed on the last day of a month. That is fixed by adding an appropriate interval of months to initial_start and letting Postgres handle this computation properly. Fixes #5216
335756ef68d0af0b3a9a5e7616b1bb7e1ac993c6f98Sven Klemm<sven@timescale.com>Tue Feb 7 10:57:36 2023 +0100Fix compression_hypertable ordering relianceThe hypertable_compression test had on implicit reliance on the ordering of tuples when querying the materialized results. This patch makes the ordering explicit in this test.
336caf79e0f5e3b789f70361f4fd3093afcea3a1da0Alexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Thu Feb 2 16:28:25 2023 +0400When backporting, fetch the main branch with large depthApparently in some cases we're getting a shallow repo in the Github Actions.
337063a9dae295672fbbfa4087cf524cd35705afe17Alexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Wed Feb 8 15:08:35 2023 +0400Improve cost model for data node scans1) Simplify the path generation for the parameterized data node scans. 1) Adjust the data node scan cost if it's an index scan, instead of always treating it as a sequential scan. 1) Hard-code the grouping estimation for distributed hypertable, instead of using the totally bogus per-column ndistinct value. 1) Add the GUC to disable parameterized data node scan. 1) Add more tests.
338cad2440b58926817912809ef48626bb1b5ca77cdZoltan Haindrich<zoltan@timescale.com>Tue Feb 7 09:53:09 2023 +0000Compression can't be enabled on caggsThe continuous aggregate creation failed in case segmentby/orderby columns needed quotation.
3391eb8aa3f14d1f5c2198b44150944295fbc253c93Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Tue Feb 7 13:24:09 2023 +0530Post-release fixes for 2.9.3Bumping the previous version and adding tests for 2.9.3.
3404cb76bc0530d3f0c86aa3ea7e96212de0af5adf7Rafia Sabih<rafia.sabih@gmail.com>Thu Jan 26 12:46:53 2023 +0530Cosmetic changes to create.c
3418132908c97ae469ace776b6cf55bbe3dd8bf8971Sven Klemm<sven@timescale.com>Sun Feb 5 13:13:08 2023 +0100Refactor chunk decompression functionsRestructure the code inside decompress_chunk slightly to make core loop reusable by other functions.
342fb3ad7d6c6dd52813c703f11de6692708b883b5aLakshmi Narayanan Sreethar<lakshmi@timescale.com>Fri Feb 3 11:05:05 2023 +0530Release 2.9.3This release contains bug fixes since the 2.9.2 release. This release is high priority for upgrade. We strongly recommend that you upgrade as soon as possible. **Bugfixes** * #4804 Skip bucketing when start or end of refresh job is null * #5108 Fix column ordering in compressed table index not following the order of a multi-column segment by definition * #5187 Don't enable clang-tidy by default * #5255 Fix year not being considered as a multiple of day/month in hierarchical continuous aggregates * #5259 Lock down search_path in SPI calls
343206056ca12c611b2038b35bfa0eac43372a563c2Erik Nordström<erik@timescale.com>Fri Feb 3 12:14:13 2023 +0100Fix dist_hypertable testA previous change accidentally broke the dist_hypertable test so that it prematurely exited. This change restores the test so that it executes properly.
344b81033b835bd22802cf59ae5dde5c9bc137d19f5Erik Nordström<erik@timescale.com>Thu Feb 2 16:50:19 2023 +0100Make data node command execution interruptibleThe function to execute remote commands on data nodes used a blocking libpq API that doesn't integrate with PostgreSQL interrupt handling, making it impossible for a user or statement timeout to cancel a remote command. Refactor the remote command execution function to use a non-blocking API and integrate with PostgreSQL signal handling via WaitEventSets. Partial fix for #4958. Refactor remote command execution function
345c4d8f3530787ee21f8a80176d0b11b18ba585d9eAlexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Wed Feb 1 17:08:22 2023 +0400Improve automated backportsA follow-up for the review comments in the previous PR. 1. Create one backport PR per one source PR, even with multiple commits. 1. Add a comment to the source PR if we fail to backport it for some reason.
3466bc89802161656b00928dbf5fffc08a0e2fdfffbKonstantina Skovola<konstantina@timescale.com>Tue Jan 31 10:38:58 2023 +0200Fix year not multiple of day/month in nested CAggPreviously all intervals were converted to seconds using "epoch" with date_part. However, this treats a year as 365.25 days to account for leap years, leading to the unexpected situation that a year is not a multiple of a day or a month. Fixed by treating month-only intervals as multiples of 30 days. Fixes #5231
3479133319081aef92705f1405087822fc281d215d4Alexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Wed Feb 1 20:38:12 2023 +0400Fix pylint againApparently a new version is out and it complains about Exception being too general.
348739fd00bb9184832d6527e253cc44ca1a47585caAlexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Thu Jan 26 18:58:22 2023 +0400Add a workflow for automated backporting1. Find the latest release branch 1. For each commit in main and not in release branch (compared by title), find the corresponding PR. 1. If the PR fixes an issue labeled "bug", and neither the PR nor the issue are labeled "no-backport", cherry-pick the commits from the PR onto the release branch, and create a PR with these changes.
3492a47462fbc930ac6230a83d07100c8a21d040b70Sven Klemm<sven@timescale.com>Wed Feb 1 07:59:14 2023 +0100Remove SECURITY DEFINER from get_telemetry_reportWe should not broadly make functions security definer as that increases the attack surface for our extension. Especially for our telemetry we should strive to only run it with the minimum required privileges.
35044cd71a602ba96029001de6e97a1b44488730080Alexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Wed Feb 1 13:15:39 2023 +0400Fix the python code style checkFor an unknown reason, pip started to install an older version of prospector which is incompatible with the current pylint. Require the new prospector version explicitly.
351d8f19e57a04d17593df5f2c694eae8775faddbc7Sven Klemm<sven@timescale.com>Wed Feb 1 08:34:20 2023 +0100Bump version of setup-wsl github actionThe currently used version pulls in Node.js 12 which is deprecated on github. https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/
352789bb26dfbf1aaf85163e5ddfc70fa6dae0894fbSven Klemm<sven@timescale.com>Tue Jan 31 13:59:48 2023 +0100Lock down search_path in SPI calls
353f75a51def79796ff7fef58ec950c859fe4e71618Alexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Tue Jan 31 15:55:55 2023 +0400Run yamllint in CIHelps find errors in GitHub workflows.
354c0f2ed18095f21ac737f96fe93e4035dbfeeaf2cFabrízio de Royes Mello<fabriziomello@gmail.com>Mon Jan 30 17:11:22 2023 -0300Mark cagg_watermark parallel safeThe `cagg_watermark` function perform just read-only operations so is safe to make it parallel safe to take advantage of the Postgres parallel query. Since 2.7 when we introduced the new Continuous Aggregate format we don't use partials anymore and those aggregate functions `partialize_agg` and `finalize_agg` are not parallel safe, so make no sense don't take advantage of Postgres parallel query for realtime Continuous Aggregates.
355e6173d12414735641f76bd783c9dad89f7b8c3c0Fabrízio de Royes Mello<fabriziomello@gmail.com>Mon Jan 30 18:24:10 2023 -0300Remove unused function prototype
356d489ed6f3225931d400ac7b664dbb003e76a7f0bErik Nordström<erik@timescale.com>Tue Jan 24 18:18:22 2023 +0100Fix use of prepared statement in async moduleBroken code caused the async connection module to never send queries using prepared statements. Instead, queries were sent using the parameterized query statement instead. Fix this so that prepared statements are used when created.
3571a3e7ad7d19f2530f25bd30752957c04ac8fa82eLakshmi Narayanan Sreethar<lakshmi@timescale.com>Mon Jan 30 12:19:03 2023 +0530Run dist_move_chunk as a solo test in PG15When run in a parallel group, the dist_move_chunk test can get into a deadlock with another test running a 'DROP DATABASE' command. So, mark it as a solo test to disallow it from running in a parallel group. Closes #4972
35803b740cd709b5e1887352f3ca1d879773ed8a923Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Mon Jan 30 11:46:11 2023 +0530Enable telemetry_stats testcaseThe telemetry_stats testcase was accidentally disabled by PR #5162.
3595d12a3883d80f026252eaac8416143de6cd5653dErik Nordström<erik@timescale.com>Mon Jan 30 11:57:05 2023 +0100Make connection establishment interruptibleRefactor the data node connection establishment so that it is interruptible, e.g., by ctrl-c or `statement_timeout`. Previously, the connection establishment used blocking libpq calls. By instead using asynchronous connection APIs and integrating with PostgreSQL interrupt handling, the connection establishment can be canceled by an interrupt caused by a statement timeout or a user. Fixes #2757
36001ea255f2f3226178b42cff597c427ec66c62442Sven Klemm<sven@timescale.com>Mon Jan 30 13:36:55 2023 +0100Rename variable in ts_chunk_dispatch_get_chunk_insert_stateThe variable new_chunk was misleading since the chunk could be either a new chunk or an existing chunk.
361b229b3aefd01049ee6fd046f762ad7a9fcb2a6e2Sven Klemm<sven@timescale.com>Mon Jan 30 10:31:53 2023 +0100Small decompress_chunk refactorRefactor the decompression code to move the decompressor initialization into a separate function.
362cce0e18c3665fec327797b2d469eafb411ee3050Erik Nordström<erik@timescale.com>Mon Jan 30 11:14:51 2023 +0100Manage life-cycle of connections via memory contextsTie the life cycle of a data node connection to the memory context it is created on. Previously, a data node connection was automatically closed at the end of a transaction, although often a connection needs to live beyond a single transaction. For example, a connection cache is maintained for data node connections, and, for such cases, a flag was set on a connection to avoid closing it automatically. Instead of tying connections to transactions, they are now life-cycle managed via memory contexts. This simplifies the handling of connections and avoids having to create exceptions to closing connections at transaction end.
363872128438f16cccb60e570a49f9ab51791964a91Sven Klemm<sven@timescale.com>Mon Jan 30 12:37:33 2023 +0100Update checkout version in changelog-checkUpdate checkout to not pull in Node.js 12 which is deprecated on GitHub. https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/.
3645661ff15236ea6bba8125160eba71538910f1cb9Mats Kindahl<mats@timescale.com>Wed Jan 25 08:38:56 2023 +0100Add role-level security to job error logSince the job error log can contain information from many different sources and also from many different jobs it is important to ensure that visibility of the job error log entries is restricted to job owners. This commit extend the view `timescaledb_information.job_errors` with role-based checks so that a user can only see entries for jobs that she has permission to view and restrict the permissions to `_timescaledb_internal.job_errors` so that users only can view the job error log through the view. A special case is added so that the superuser and the database owner can see all log entries, even if there is no associated job id with the log entry. Closes #5217
365c89fb2550dce9c35c7b89cfa33c8c813a579f610Alexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Wed Jan 25 17:45:00 2023 +0400Run sqlsmith on all commits in mainThis would help to gather more statistics. We have some rare assertion failures that happen with SQLSmith like #4185
36621a3f8206c0de98932867096637c7d1e3d04d925Alexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Fri Jan 27 18:46:09 2023 +0400Run python linter and formatter in CIHelps find some errors and cosmetic problems.
367334864127db53edd711d1053a26aaeeb346f6d33Sven Klemm<sven@timescale.com>Mon Jan 30 00:15:51 2023 +0100Stop blocking RETURNING for compressed chunksRecent refactorings in the INSERT into compressed chunk code path allowed us to support this feature but the check to prevent users from using this feature was not removed as part of that patch. This patch removes the blocker code and adds a minimal test case.
368043092a97fc7348f2ddfa08edd758723de93993cRafia Sabih<rafia.sabih@gmail.com>Fri Oct 7 16:25:46 2022 +0200Fix timestamp out of rangeWhen start or end for a refresh job is null, then it gives an error while bucketing because start and end are already min and max timestamp value before bucketing. Hence, skip bucketing for this case. Partly fixes #4117
369684637a172b3a05a7500425cd8ce82cf7aad6092Bharathy<satish.8483@gmail.com>Tue Jan 24 20:16:12 2023 +0530Post-release fixes for 2.9.2Bumping the previous version and adding tests for 2.9.2
370552950d221b332c6e0cbc2682e39022f2b972f32Alexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Fri Jan 20 16:52:00 2023 +0400Save SQLSmith results to the CI DBMostly we are interested in stacktraces and failed queries here.
371a67b90e977194f3e55c93ed6b3f5d2a671d503c1Rafia Sabih<rafia.sabih@gmail.com>Mon Oct 24 13:05:55 2022 +0200Allow joins in continuous aggregatesEnable the support of having join in the query used for creating the continuous aggregates. It has follwoing restrictions- 1. Join can involve only one hypertable and one normal table 2. Join should be a inner join 3. Join condition can only be equality
3729ae3ae33b758fb05ee07c90078d0a20790e196faJan Nidzwetzki<jan@timescale.com>Wed Jan 18 14:47:48 2023 +0100Add scan plan logic for remote joinsThis patch adds the missing functionality to create scan plans for remote joins. Most of the code is a backport from PG Upstream.
373f211294c613a40a56604a7be6ac0d1663ea49958Bharathy<satish.8483@gmail.com>Mon Jan 23 15:05:30 2023 +0530Release 2.9.2This release contains bug fixes since the 2.9.1 release. We recommend that you upgrade at the next available opportunity. **Bugfixes** * #5114 Fix issue with deleting data node and dropping the database on multi-node * #5133 Fix creating a CAgg on a CAgg where the time column is in a different order of the original hypertable * #5152 Fix adding column with NULL constraint to compressed hypertable * #5170 Fix CAgg on CAgg variable bucket size validation * #5180 Fix default data node availability status on multi-node * #5181 Fix ChunkAppend and ConstraintAwareAppend with TidRangeScan child subplan * #5193 Fix repartition behavior when attaching data node on multi-node
374d2254cb5c5a8e267abcd8503c4b3f17596d1004cAlexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Mon Jan 16 19:04:55 2023 +0400Don't enable clang-tidy by defaultThis is aimed at developers. If we enable it by default, it confuses our users and slows down the build for them.
375014b7b9664f828c30b98dd36a563ac6190f08337Konstantina Skovola<konstantina@timescale.com>Fri Jan 20 09:33:30 2023 +0200Move .gitattributes to root and remove build-13Commit effc8efe148c4ec0048bd7c1dfe0ca01df2afdc9 accidentally placed .gitattributes inside a build-13 directory instead of the root of the project. This commit removes build-13 and fixes the structure.
37628dbeaa2ca98c6f86c4b8cee6241841df80855cdJan Nidzwetzki<jan@timescale.com>Tue Jan 17 10:36:44 2023 +0100Add cost estimation for remote joinsThis patch adds the missing functionality to estimate the costs of remote joins. Most of the code is a backport from PG Upstream.
377effc8efe148c4ec0048bd7c1dfe0ca01df2afdc9Konstantina Skovola<konstantina@timescale.com>Fri Jun 3 18:26:52 2022 +0300Add workflow to check for CHANGELOG update
378167625984094c4a62770521d60feeaa1b7acc8d6Erik Nordström<erik@timescale.com>Tue Jan 17 14:10:01 2023 +0100Fix repartition behavior when attaching data nodeWhen attaching a data node and specifying `repartition=>false`, the current number of partitions should remain instead of recalculating the partitioning based on the number of data nodes. Fixes #5157
37919065bbdf39d2536a227041331adf24ffb38ffdcJan Nidzwetzki<jan@timescale.com>Tue Jan 17 08:46:21 2023 +0100Introduce a FDW option to mark reference tablesWith this patch, the ability to mark reference tables (tables that exist on all data nodes of a multi-node installation) via an FDW option has been added.
3809a2cbe30a102a9d027f832b6c288b0b9adddf62aBharathy<satish.8483@gmail.com>Wed Jan 18 10:32:56 2023 +0530Fix ChunkAppend, ConstraintAwareAppend child subplanWhen TidRangeScan is child of ChunkAppend or ConstraintAwareAppend node, an error is reported as "invalid child of chunk append: Node (26)". This patch fixes the issue by recognising TidRangeScan as a valid child. Fixes: #4872
3818f4fa8e4cca73f11d3892ce6afde04ca104465d2Mats Kindahl<mats@timescale.com>Mon Jan 16 09:24:32 2023 +0100Add build matrix to Windows and Linux buildsBuild matrix is missing from the ignore workflows for the Windows and Linux builds, so this commit adds them.
3826aa3d6e2fc7d68b4ef4946ad2b8b186202c946aeAlexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Tue Jan 17 13:36:41 2023 +0400Don't run the APT package test on PRsWe run them nightly on main.
3831d3d81491b9116dc00d609ba9e900c1f91064ecaJan Nidzwetzki<jan@timescale.com>Tue Jan 17 09:07:43 2023 +0100Update issue workflow actions and used tokenThis patch updates the used issue workflow actions and ensures that the 'secrets.ORG_AUTOMATION_TOKEN' is used by all actions.
3845c897ff75dd014d00484507ee96eb2730fda596cDmitry Simonenko<dmitry@timescale.com>Mon Jan 16 15:20:25 2023 +0200Fix default data node availability statusFunction alter_data_node() return uninitialized value for "available" option when it is not presented in the option list. Fix #5154
385dbe89644b5abf9d5a15f43d8d260b676ea8af0a1Sven Klemm<sven@timescale.com>Mon Jan 16 10:15:15 2023 +0100Remove no longer used compression codeThe recent refactoring of INSERT into compression chunk made this code obsolete but forgot to remove it in that patch.
38673df496c75c206745d44bab2088bf4c6c661ec51Fabrízio de Royes Mello<fabriziomello@gmail.com>Tue Jan 10 15:19:18 2023 -0300Fix CAgg on CAgg variable bucket size validationPrevious attempt to fix it (PR #5130) was not entirely correct because the bucket width calculation for interval width was wrong. Fixed it by properly calculate the bucket width for intervals using the Postgres internal function `interval_part` to extract the epoch of the interval and execute the validations. For integer widths use the already calculated bucket width. Fixes #5158, #5168
387ca9d508edeada0deba58beda5f1735631af2b21bMats Kindahl<mats@timescale.com>Fri Jan 13 11:33:38 2023 +0100Add missing ignore filesThe workflow ignore files for 32-bit Linux builds and Windows was missing from #5156 so these are added here.
3881e7b9bc558b1e6f9d036cf10baabc214f8eeb8d6Erik Nordström<erik@timescale.com>Thu Dec 22 10:24:42 2022 +0100Fix issue with deleting data node and dropping databaseWhen deleting a data node with the option `drop_database=>true`, the database is deleted even if the command fails. Fix this behavior by dropping the remote database at the end of the delete data node operation so that other checks fail first.
3894118a72575d4a1d493ec0884e659e6a7437fd3a0Fabrízio de Royes Mello<fabriziomello@gmail.com>Wed Jan 11 17:29:32 2023 -0300Remove parallel safe from partialize_aggPrevious PR #4307 mark `partialize_agg` and `finalize_agg` as parallel safe but this change is leading to incorrect results in some cases. Those functions are supposed work in parallel but seems is not the case and it is not evident yet the root cause and how to properly use it in parallel queries so we decided to revert this change and provide correct results to users. Fixes #4922
390f36db10826f53b48f6cacd5083342aa79fc8df87Mats Kindahl<mats@timescale.com>Mon Jan 9 13:53:58 2023 +0100Do not run regress workflows on benign changesIf only documentation is changed, the full regression check workflow will still be executed, so this commit will instead skip running the regression workflows if there are only changes to files that will not affect the success of the workflow.
391396bc6def7c50523367f5ca12f688cd6d508d321Jan Nidzwetzki<jan@timescale.com>Tue Jan 3 15:59:02 2023 +0100Add join functionality to the deparser codeThis patch adds the missing functionality to handle joins to the deparser. Most of the code is a backport from PG Upstream.
392cfd34f2752213de6cf7b52b0e5ffffb573883ed8Sven Klemm<sven@timescale.com>Tue Jan 10 12:14:41 2023 +0100Restructure chunk_dispatchThis patch adjusts the code layout for chunk_dispatch to be similar to the other custom nodes. All the files related to chunk_dispatch are moved into dedicated nodes/chunk_dispatch directory.
39306eca172bda323779ba2105814507494e4d81303Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Tue Jan 10 15:22:48 2023 +0530Fix telemetry_stats test failure in PG15The telemetry_stats testcase uses random() with seed(1) to generate the column values on which the hypertable is partitioned. The Postgres commit postgres/postgres@3804539e48 updates the random() implementation to use a better algorithim causing the test to generate a different set of rows in PG15. Due to this the test failed in PG15 as the distrubution stats of the tuples have now changed. Fixed that by creating separate test outputs for PG15 and other releases. Fixes #5037
3947d3d260afb1f47ff0e7be5a49bfeb715198a1e79Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Tue Jan 10 13:40:22 2023 +0530Skip auto assigning reviewers for draft PRsReviewers should be assigned only when the PR is ready for review.
3957a6101a441ca4ad02018ffddd225e7abdea4385fSven Klemm<sven@timescale.com>Tue Jan 3 22:24:04 2023 +0100Bump pgspot version used in CI
396cd48553de5464505df6006b987cf7970bb48fe76Fabrízio de Royes Mello<fabriziomello@gmail.com>Mon Dec 26 18:03:07 2022 -0300Fix CAgg on CAgg variable bucket size validationDuring the creation of a CAgg on top of another CAgg we check if the bucket width is multiple of the parent and for this arithmetic we made an assumption that picking just the `month` part of the `interval` for variable bucket size was enought. This assumption was wrong for bucket sizes that doesn't have the month part (i.e: using timezones) leading to division by zero error because in that case the `month` part of an `interval` is equal to 0 (zero). Fixed it by properly calculating the bucket width for variable sized buckets. Fixes #5126
39773c97524a0130e728eda2d58f82cba05ddad854aFabrízio de Royes Mello<fabriziomello@gmail.com>Wed Dec 28 15:56:49 2022 -0300Fix CAgg on CAgg different column orderCreating a CAgg on a CAgg where the time column is in a different order of the original hypertable was raising the following exception: `ERROR: time bucket function must reference a hypertable dimension column` The problem was during the validation we're initializing internal data structure with the wrong hypertable metadata. Fixes #5131
39841d6a1f142a80fbb781c77feafba7d75e6707f25Fabrízio de Royes Mello<fabriziomello@gmail.com>Thu Jan 5 16:02:11 2023 -0300Fix adding column with NULL constraintAdding new column with NULL constraint to a compressed hypertable is raising an error but it make no sense because NULL constraints in Postgres does nothing, I mean it is useless and exist just for compatibility with other database systems: https://www.postgresql.org/docs/current/ddl-constraints.html#id-1.5.4.6.6 Fixed it by ignoring the NULL constraints when we check for `ALTER TABLE .. ADD COLUMN ..` to a compressed hypertable. Fixes #5151
3991751efbaea57be75d813fbf93a0c9b4ec8a7d994Jan Nidzwetzki<jan@timescale.com>Thu Dec 1 09:57:09 2022 +0100Improve the PR workflow actionsThis patch includes two changes to the PR handling workflow: (1) It changes the trigger for the workflow to pull_request_target. So, PRs can now also be assigned to reviewers if the PR is opened from external sources. (2) A workflow has been added that automatically assigns PRs to the author.
4002c70dc622e4ca36deb3b1afa3ae51ebe96f4be5dAlexander Kuzmenkov<36882414+akuzm@users.noreply.github.com>Tue Jan 3 15:41:14 2023 +0400Run all the tests on every commit in mainIf we test every commit in master, we can allow GitHub to merge the PRs automatically without requiring a manual rebase on the current master. These rebases are a real time sink.
40164e8e31c6e2a33e5c17bafab7ded90dc23588c32Sven Klemm<sven@timescale.com>Mon Jan 2 09:33:24 2023 +0100Improve ASSERT_IS_VALID_CHUNK macroCurrently when ASSERT_IS_VALID_CHUNK fails it is impossible to tell which of the conditions fails without opening the coredump in debugger as all the conditions are ANDed in a single Assert. This patch splits the conditions into individual Asserts so you can immediately see from stacktrace which condition failed.
4023a8d294d5862a9c2c3244b0754affab4472e5756Bharathy<satish.8483@gmail.com>Mon Jan 2 15:30:22 2023 +0530SELECT from partial compressed chunks crashesSELECT from partially compressed chunk crashes due to reference to NULL pointer. When generating paths for DecompressChunk, uncompressed_partial_path is null which is not checked, thus causing a crash. This patch checks for NULL before calling create_append_path(). Fixes #5134
4031eacb35107eebafb703677c2192936b9cd43541aSven Klemm<sven@timescale.com>Thu Dec 22 13:53:04 2022 +0100Show postgres log in apt package test
404b92f36d765e08e3df826f594467c13cd2b935e2dSven Klemm<sven@timescale.com>Fri Dec 23 17:56:04 2022 +0100Add 2.9.1 to update test scripts
40593667df7d883af7f64bea60719902d705333253cSven Klemm<sven@timescale.com>Fri Dec 23 07:14:25 2022 +0100Release 2.9.1This release contains bug fixes since the 2.9.0 release. This release is high priority for upgrade. We strongly recommend that you upgrade as soon as possible. **Bugfixes** * #5072 Fix CAgg on CAgg bucket size validation * #5101 Fix enabling compression on caggs with renamed columns * #5106 Fix building against PG15 on Windows * #5117 Fix postgres server restart on background worker exit * #5121 Fix privileges for job_errors in update script
4060a3615fc706ab4dc986a443eedda8e7412120aceKonstantina Skovola<konstantina@timescale.com>Fri Dec 23 12:38:59 2022 +0200Fix privileges for job_errors table in update script
407cdf8676689549a3240126c603283b6012add3f13Konstantina Skovola<konstantina@timescale.com>Thu Dec 22 21:23:51 2022 +0200Fix postgres server restart on background worker exitFixed by removing the croak signal handler that was introduced to enable the silent exit of the telemetry job.
408ca609696d64e3877c9796983de7b3a31dee44fc6Sven Klemm<sven@timescale.com>Thu Dec 22 10:07:52 2022 +0100Fix Windows package test
409b1314e63f2ff6151ab5becfb105afa3682286a4dSven Klemm<sven@timescale.com>Thu Dec 22 12:03:35 2022 +0100Fix RPM package test for PG15 on centos 7Installing PG15 on Centos 7 requires the EPEL repository to satisfy the dependencies.
4104527f51e7c0e5e923fcf37e4a15d5ee424b4f83bSven Klemm<sven@timescale.com>Sat Nov 5 11:13:25 2022 +0100Refactor INSERT into compressed chunksThis patch changes INSERTs into compressed chunks to no longer be immediately compressed but stored in the uncompressed chunk instead and later merged with the compressed chunk by a separate job. This greatly simplifies the INSERT-codepath as we no longer have to rewrite the target of INSERTs and on-the-fly compress leading to a roughly 2x improvement on INSERT rate into compressed chunk. Additionally this improves TRIGGER-support for INSERTs into compressed chunks. This is a necessary refactoring to allow UPSERT/UPDATE/DELETE on compressed chunks in follow-patches.
411bd20afccbbdccc1e4929b0f04838d996cd4c0e3aSven Klemm<sven@timescale.com>Tue Dec 20 18:03:57 2022 +0100Add test for PG15 windows package
4121d5167233650c7fda45009bd09e3bc0948b8e473Sven Klemm<sven@timescale.com>Tue Dec 20 11:38:48 2022 +0100Skip package downgrade test for PG15Since we currently only have 1 released version that supports PG15 we cannot test downgrade with PG15.
413a4806827dca4c87c44e85e29704584144bd2912eLakshmi Narayanan Sreethar<lakshmi@timescale.com>Wed Dec 7 13:22:42 2022 +0530Enable PG15 in various CI checksThis commit enables PG15 in the following workflows: - Regression Linux - ABI test - Memory tests - Coverity - SQLSmith - Additional cron tests Co-authored-by: Bharathy Satish <bharathy@timescale.com>
414024b1e1f30db0c58b49eae04ff0b50055b191734Fabrízio de Royes Mello<fabriziomello@gmail.com>Fri Dec 9 16:01:50 2022 -0300Fix CAgg on CAgg bucket size validationThe bucket size of a Continuous Aggregate should be greater or equal to the parent Continuous Aggregate because there are many cases where you actually want to roll up on another dimension.
415c5e496a554e9f4d04578f39669108554c22c918dBharathy<satish.8483@gmail.com>Tue Dec 20 19:50:39 2022 +0530Fix column ordering in compressed table index.When defining compression segment by parameter using multiple columns, the parameter ordering is not respected for index creation. This patch fixes the issue by maintaining the same order in which user has defined columns in segment by clause. Fixes #5104
4167d1b74a8c6b0e07c7cd156943f48fc9be16876dcSven Klemm<sven@timescale.com>Mon Dec 19 23:51:57 2022 +0100Use rand() instead of random()Use rand() instead of random() cause the latter is not available on Windows and postgres stopped backporting it with PG15. Ideally we switch to the crypto functions added in PG15 but that requires a bit more work and this is the minimal change required to get it to build against PG15 on Windows.
417b74f563a3364d5d65304cd576f7e8d5574287f8dSven Klemm<sven@timescale.com>Mon Dec 19 20:42:42 2022 +0100Run regression tests on pg15 windows
41808bb21f7e69b636a736635e081bf16b1083eacb1Sven Klemm<sven@timescale.com>Thu Dec 15 16:42:46 2022 +01002.9.0 Post-release adjustmentsAdd 2.9.0 to update test scripts and adjust downgrade scripts for 2.9.0. Additionally adjust CHANGELOG to sync with the actual release CHANGELOG and add PG15 to CI.
41927310470bee4790c66d2c75b9e0b58e14145fed4Alexander Kuzmenkov<akuzmenkov@timescale.com>Thu Dec 1 21:18:34 2022 +0400Allow AsyncAppend under IncrementalSortWe forgot to add a case for it.
420c0e9bb4a30b9d1b15d057992e803f975f2c22358Sven Klemm<sven@timescale.com>Sat Dec 17 08:57:21 2022 +0100Fix enabling compression on caggs with renamed columnsOn caggs with realtime aggregation changing the column name does not update all the column aliases inside the view metadata. This patch changes the code that creates the compression configuration for caggs to get the column name from the materialization hypertable instead of the view internals. Fixes #5100
421317f8f1a9964df67960394145c83be1e1f9d1460Fabrízio de Royes Mello<fabriziomello@gmail.com>Fri Dec 2 11:39:00 2022 -0300Refactor CAggs on CAggs regression testsWhen CAggs on CAggs was introduced in commit 3749953 the regression tests was splited into 6 (six) different test suites. Simplyfied it grouping tests and reduced to just 2 (two) different test suites. It save resources and time because each suite test spawn it own Postgres instance.
422854b67774904e1d244aef2dcd49e533e33d52167Fabrízio de Royes Mello<fabriziomello@gmail.com>Fri Dec 16 14:07:09 2022 -0300Fix broken postgres install on Windows CIThe last minor versions for PG14 (14.6) and PG15 (15.1) were unlisted by chocolatey maintainers due to some issues. Fixed it by hardcoding the 14.5 until the packages become available again.
4234694c7d7986f9c6f2d61201c94273e980f45f224Fabrízio de Royes Mello<fabriziomello@gmail.com>Mon Dec 5 14:31:30 2022 -0300Refactor CAgg migrate regression testsWhen CAggs migration was introduced in commit e34218ce the regression tests was splited into 6 (six) different test suites. Simplyfied it grouping tests and reduced to just 2 (two) different test suites. It save resources and time because each suite test spawn it own Postgres instance.
424e5843dddd3e97fb1fafc82336335abff0696dca1Mats Kindahl<mats@timescale.com>Mon Dec 5 13:26:51 2022 +0100Link development and design documentationThe tree contains a lot of design and architecture documents, but they are not linked together, so this commits adds a few additional README and build a basic structure for the documentation.
425601b37daa84c33917157d9a57a07ca3b5832b630shhnwz<mohammed@timescale.com>Thu Oct 13 20:38:05 2022 +0530Index support for compress chunkIt allows to override tuplesort with indexscan if compression setting keys matches with Index keys. Moreover this feature has Enable/Disable Toggle. To Disable from the client use the following command, SET timescaledb.enable_compression_indexscan = 'OFF'
426cbf51803dd38b1e05a066ce4636ec97fb1057464Ante Kresic<ante.kresic@gmail.com>Thu Dec 15 09:59:42 2022 +0100Fix index att number calculationAttribute offset was used by mistake where attribute number was needed causing wrong values to be fetched when scanning compressed chunk index.
4273f9e3379a93ee2657d48c26c3d8a1dbe530b441fAnte Kresic<ante.kresic@gmail.com>Wed Dec 14 18:53:00 2022 +0100Allow BitmapHeapScans on non-parameterized pathsPlanner can decide to use BitmapHeapScans exclusively when scanning compressed chunks. Since we filter out such scans due to previously reported issues, this can lead to no query plan devised when querying compressed chunks. This change allows Bitmap scans on compressed chunks only when it is not parameterized. Fixes #5090
4283b3846b0ffc2b9d4ab4de505ba50b15044d40a62Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Tue Dec 13 23:09:24 2022 +0530Fix assertion failure in cursor_fetcher_rewindThe cursor_fetcher_rewind method assumes that the data node cursor is rewind either after eof or when there is an associated request. But the rewind can also occur once the server has generated required number of rows by joining the relation being scanned with another regular relation. In this case, the fetch would not have reached eof and there will be no associated requests as the rows would have been already loaded into the cursor causing the assertion in cursor_fetcher_rewind to fail. Fixed that by removing the Assert and updating cursor_fetcher_rewind to discard the response only if there is an associated request. Fixes #5053
429940626b1d4d6458cfa10559fd56fe57f2117288bJan Nidzwetzki<jan@timescale.com>Wed Dec 14 10:00:10 2022 +0100Fix Git permission issue during CI buildThe new permissions checks to fix CVE-2022-29187 in Git caused some issues in our CI pipeline. This patch adds the checkout directory to Git's "safe.directory" setting.
430558688c86f2e02cc8b5721e58294dbe552364772Mats Kindahl<mats@timescale.com>Tue Dec 13 09:41:56 2022 +0100Reset baserel cache on invalid hypertable cacheWhen popping the hypertable cache stack, it might happen that the hypertable cache was invalidated between the push and the pop. In that case, the baserel cache can contain invalid entries pointing to the now popped hypertable cache, so we reset the baserel cache. Fixes #4795
431df16815009b6353383c720e364e1b3d2c82f8867Matvey Arye<mat@timescale.com>Wed Dec 7 21:14:06 2022 -0500Fix memory leak for compression with merge chunksThe RelationInitIndexAccessInfo call leaks cache memory and seems to be unnecessary.
43213ac2fc63aa4c21b0f731a74c6197caa0b3d6515Ildar Musin<zildermann@gmail.com>Mon Nov 14 17:10:40 2022 +0100Add a GUC variable to enable/disable OSM for SELECTs
433dd65a6b43676459668f100ffdf58ab112ff911d9Bharathy<satish.8483@gmail.com>Mon Dec 12 16:37:27 2022 +0530Fix segfault after second ANALYZEIssue occurs in extended query protocol mode only where every query goes through PREPARE and EXECUTE phase. First time ANALYZE is executed, a list of relations to be vaccumed is extracted and saved in a list. This list is referenced in parsetree node. Once execution of ANALYZE is complete, this list is cleaned up, however reference to the same is not cleaned up in parsetree node. When second time ANALYZE is executed, segfault happens as we access an invalid memory location. Fixed the issue by restoring the actual value in parsetree node once ANALYZE completes its execution. Fixes #4857
434d92739099b7135712f15d6e0c5e9240d5b430109Jan Nidzwetzki<jan@timescale.com>Thu Dec 8 15:56:29 2022 +0100Reduce test group size in sanitizer runsWhen the sanitizer is active, the tests require a lot of memory. If they are run in large parallel groups, out-of-memory situations can occur. This patch reduces the size of parallel groups to 5 when the sanitizer is active.
435a01e483bf3552ead468bf6156d734a17f0007d4cAlexander Kuzmenkov<akuzmenkov@timescale.com>Thu Dec 8 18:40:35 2022 +0400More gdb output in CIPrint locals and arguments.
436c76dfa0acbd19b33c8ef43e84c88a6f69e6ae8ffJan Nidzwetzki<jan@timescale.com>Wed Dec 7 20:59:00 2022 +0100Improve Sanitizer checksThis patch contains two changes to the Sanitizer checks: (1) All logfiles of the Sanitizer will be uploaded to the CI database. (2) The Sanitizer checks are executed on every PR.
437323d41b53b2880a7b47b776eb882330790bf530dJan Nidzwetzki<jan@timescale.com>Wed Dec 7 22:37:19 2022 +0100Ensure dist_hypertable is executed as solo testThe `dist_hypertable` test needs a lot of memory, especially when the sanitizer is enabled. This patch runs this test as a `SOLO_TEST`. This ensures that PostgreSQL does not run into an out-of-memory situation.
4385fd9170b0a4697fc55ffd32275d2348d42b26d6aJan Nidzwetzki<jan@timescale.com>Wed Dec 7 17:52:53 2022 +0100Correct sanitizer log directorySo far, we have treated the 'log_path' setting of the sanitizer like a file. In fact, this value is used as a prefix for the created log file. Since we expected the exact file name when uploading the sanitizer output, this file was not found and we lost the messages of the sanitizer. This PR changes the behavior. We now treat the setting as a prefix and upload all files created in a new sanitizer output folder.
439bfed42c2d371322b7f5bcddfbf43d09042296379Bharathy<satish.8483@gmail.com>Tue Dec 6 09:50:31 2022 +0530Fix remote_txn on PG15In remote_txn, testcases which kill remote processes on data nodes, tend to rollback transactions and as part of the process, WARNINGS/ERROR are reported to client. Client however reports WARNINGS/ERROR in different order intermittently. This is an issue specific to psql utility. Placing psql in gdb and trying to diagnise the problem does not reproduce the issue. This patch fixes the tests by not reporting WARNINGS. Fixes #4837
440fd42fe76fa37d1dce9e1aa3d6fe6709c797310c5Erik Nordström<erik@timescale.com>Tue Nov 15 11:52:34 2022 +0100Read until EOF in COPY fetcherEnsure the COPY fetcher implementation reads data until EOF with `PQgetCopyData()`. Also ensure the malloc'ed copy data is freed with `PQfreemem()` if an error is thrown in the processing loop. Previously, the COPY fetcher didn't read until EOF, and instead assumed EOF when the COPY file trailer is received. Since EOF wasn't reached, it required terminating the COPY with an extra call to the (deprecated) `PQendcopy()` function. Still, there are cases when a COPY needs to be prematurely terminated, for example, when querying with a LIMIT clause. Therefore, distinguish between "normal" end (when receiving EOF) and forceful end (cancel the ongoing query).
441cd4509c2a35d86f6b5d4a2dc8701ef116693cf9aSachin<sachin@timescale.com>Wed Nov 30 12:32:58 2022 +0000Release 2.9.0This release adds major new features since the 2.8.1 release. We deem it moderate priority for upgrading. This release includes these noteworthy features: * Hierarchical Continuous Aggregates (aka Continuous Aggregate on top of another Continuous Aggregate) * Improve `time_bucket_gapfill` function allowing specifying timezone to bucket * Use `alter_data_node()` to change the data node configuration. This function introduces the option to configure the availability of the data node. This release also includes several bug fixes. **Features** * #4476 Batch rows on access node for distributed COPY * #4567 Exponentially backoff when out of background workers * #4650 Show warnings when not following best practices * #4664 Introduce fixed schedules for background jobs * #4668 Hierarchical Continuous Aggregates * #4670 Add timezone support to time_bucket_gapfill * #4678 Add interface for troubleshooting job failures * #4718 Add ability to merge chunks while compressing * #4786 Extend the now() optimization to also apply to CURRENT_TIMESTAMP * #4820 Support parameterized data node scans in joins * #4830 Add function to change configuration of a data nodes * #4966 Handle DML activity when datanode is not available * #4971 Add function to drop stale chunks on a datanode **Bugfixes** * #4663 Don't error when compression metadata is missing * #4673 Fix now() constification for VIEWs * #4681 Fix compression_chunk_size primary key * #4696 Report warning when enabling compression on hypertable * #4745 Fix FK constraint violation error while insert into hypertable which references partitioned table * #4756 Improve compression job IO performance * #4770 Continue compressing other chunks after an error * #4794 Fix degraded performance seen on timescaledb_internal.hypertable_local_size() function * #4807 Fix segmentation fault during INSERT into compressed hypertable * #4822 Fix missing segmentby compression option in CAGGs * #4823 Fix a crash that could occur when using nested user-defined functions with hypertables * #4840 Fix performance regressions in the copy code * #4860 Block multi-statement DDL command in one query * #4898 Fix cagg migration failure when trying to resume * #4904 Remove BitmapScan support in DecompressChunk * #4906 Fix a performance regression in the query planner by speeding up frozen chunk state checks * #4910 Fix a typo in process_compressed_data_out * #4918 Cagg migration orphans cagg policy * #4941 Restrict usage of the old format (pre 2.7) of continuous aggregates in PostgreSQL 15. * #4955 Fix cagg migration for hypertables using timestamp without timezone * #4968 Check for interrupts in gapfill main loop * #4988 Fix cagg migration crash when refreshing the newly created cagg **Thanks** * @jflambert for reporting a crash with nested user-defined functions. * @jvanns for reporting hypertable FK reference to vanilla PostgreSQL partitioned table doesn't seem to work * @kou for fixing a typo in process_compressed_data_out * @xvaara for helping reproduce a bug with bitmap scans in transparent decompression * @byazici for reporting a problem with segmentby on compressed caggs * @tobiasdirksen for requesting Continuous aggregate on top of another continuous aggregate * @xima for reporting a bug in Cagg migration
44229f35da905e99dace4b5cf87b2653a5b5c7e25eeSachin<sachin@timescale.com>Thu Dec 1 14:37:07 2022 +0000Fix Github CI failuresNot specifying alpine version causes libssl version to change, which in turn cause error in downgrade tests as well as ABI tests. This commit also fixes shellcheck failures. Some failing windows tests are addd to ignore list. Co-authored-by: Lakshmi Narayanan Sreethar <lakshmi@timescale.com> Co-authored-by: Alexander Kuzmenkov <akuzmenkov@timescale.com> Signed-off-by: Sachin <sachin@timescale.com>
4431a806e2fde2e6148cd7ffd02752ed59478d426cdSven Klemm<sven@timescale.com>Tue Nov 29 10:41:47 2022 +0100Check for presence of RelationGetSmgrRelationGetSmgr was backported by upstream to the STABLE branches but is not yet available in any released version so we cannot use pg version to determine presence of RelationGetSmgr.
44409c0ba713691f69cdc96c992c44f1654181e9838Mats Kindahl<mats@timescale.com>Thu Nov 24 11:03:26 2022 +0100Do not spam log with telemetry problemsThe telemetry process runs on a regular basis and usually does not make a lot of noise, but in a few particular cases, it writes entries to the log unnecessarily. If the telemetry server cannot be contacted, it will print a warning in the log that the server cannot be contacted. Since it is nothing wrong with the system and the telemetry process will try to re-connect at a later time, it is unnecessary to print as a warning. If the telemetry response is malformed, a warning is printed. This is also unnecessary since there is nothing wrong with the system, there is nothing the user can do about it, and this warning can be largely ignored. If the hard-coded telemetry scheme is incorrect, a warning will be printed. This should not normally happen, and if it happens on a running server, there is nothing that can be done to eliminate the error message and the message is unnecessary. When the telemetry job exits, a standard termination message is printed in the log. Although harmless, it is mostly confusing and provide no value to the user. If the telemetry process is attempting to connect, or is connected, to the telemetry server, the telemetry server will wait until the connection gets a timeout before shutting down. This is unnecessary since there is no critical problem in aborting the connection and doing a direct shutdown. This commit turns those warnings into notices and installs a signal handler so that the telemetry job exits silently and abort any outstanding connections. Fixes #4028
445558da2c5c698aa4237f3ebc35dd12e7c511c2a90Sven Klemm<sven@timescale.com>Sat Nov 26 11:18:27 2022 +0100Use RelationGetSmgr instead of rd_smgrrd_smgr should not be accessed directly but RelationGetSmgr should be used instead. Accessing it directly can lead to segfaults when parallel relcache flushes are happening. https://github.com/postgres/postgres/commit/f10f0ae420ee62400876ab34dca2c09c20dcd030
4462d0087a0e7c2be92cd5f4a1e47098d73c5ecde30Sven Klemm<sven@timescale.com>Sun Nov 27 00:00:37 2022 +0100Fix segfault in cagg creationWhen trying to create cagg on top of any relation that is a neither a hypertable nor a continuous aggregate the command would segfault. This patch changes the code to handle this case gracefully and error out when trying to create a cagg on top of a relation that is not supported. Found by coverity.
44735c91204987ccb0161d745af1a39b7eb91bc65a5Fabrízio de Royes Mello<fabriziomello@gmail.com>Thu Nov 24 13:19:36 2022 -0300Add Hierarchical Continuous Aggregates validationsCommit 3749953e introduce Hierarchical Continuous Aggregates (aka Continuous Aggregate on top of another Continuous Aggregate) but it lacks of some basic validations. Validations added during the creation of a Hierarchical Continuous Aggregate: * Forbid create a continuous aggregate with fixed-width bucket on top of a continuous aggregate with variable-width bucket. * Forbid incompatible bucket widths: - should not be equal; - bucket width of the new continuous aggregate should be greater than the source continuous aggregate; - bucket width of the new continuous aggregate should be multiple of the source continuous aggregate.
44883b13cf6f73a74656dde9cc6ec6cf76740cddd3cSven Klemm<sven@timescale.com>Fri Nov 25 08:27:45 2022 +0100Use packaged postgres for sqlsmith and coverity CIThe sqlsmith and coverity workflows used the cache postgres build but could not produce a build by themselves and therefore relied on other workflows to produce the cached binaries. This patch changes those workflows to use normal postgres packages instead of custom built postgres to remove that dependency.
4493b94b996f248291caa37de206ef65dd4cc3a56c2Sven Klemm<sven@timescale.com>Mon Nov 21 17:36:55 2022 +0100Use custom node to block frozen chunk modificationsThis patch changes the code that blocks frozen chunk modifications to no longer use triggers but to use custom node instead. Frozen chunks is a timescaledb internal object and should therefore not be protected by TRIGGER which is external and creates several hazards. TRIGGERs created to protect internal state contend with user-created triggers. The trigger created to protect frozen chunks does not work well with our restoring GUC which we use when restoring logical dumps. Thirdly triggers are not functional for any internal operations but are only working in code paths that explicitly added trigger support.
450ce778faa117f503231b3cd62d94d6718670ac257Mats Kindahl<mats@timescale.com>Fri Nov 25 16:10:40 2022 +0100Updating scheduled runUpdating scheduled run to avoid original creator from being notified.
4514a30e5969bf310402f468f2792c48370b144dc3fKonstantina Skovola<konstantina@timescale.com>Wed Nov 16 13:42:12 2022 +0200Fix flaky bgw_db_scheduler_fixed testApply date_trunc to last_successful_finish. Commit 20cdd9ca3ed0c2d62779c4fc61d278a489b4460a mostly fixed the flakiness, but date_trunc was not applied to the last_successful_finish so we still got some flaky runs.
452c92e29ba3a64d99173afa97ac6d8910dae49760cNikhil Sontakke<nikhil@timescale.com>Fri Nov 11 19:14:21 2022 +0530Fix DML HA in multi-nodeIf a datanode goes down for whatever reason then DML activity to chunks residing on (or targeted to) that DN will start erroring out. We now handle this by marking the target chunk as "stale" for this DN by changing the metadata on the access node. This allows us to continue to do DML to replicas of the same chunk data on other DNs in the setup. This obviously will only work for chunks which have "replication_factor" > 1. Note that for chunks which do not have undergo any change will continue to carry the appropriate DN related metadata on the AN. This means that such "stale" chunks will become underreplicated and need to be re-balanced by using the copy_chunk functionality by a micro service or some such process. Fixes #4846
45326e3be1452e47be35795982626c4f549d45158d1Dmitry Simonenko<dmitry@timescale.com>Thu Nov 24 18:33:58 2022 +0200Test dist caggs with an unavailable data nodeAdd additional test cases to ensure caggs functionality on distributed hypertable during data node being unavailable. Fix #4978
454826dcd2721d0f406672da3aca466a130a230e498Dmitry Simonenko<dmitry@timescale.com>Thu Nov 24 15:13:17 2022 +0200Ensure nodes availability using dist restore pointMake sure that a data node list does not have unavailable data nodes when using create_distributed_restore_point() API. Fix #4979
4557bfd28a02fb3e4431a8d21c3d87e2ef6d4f807fbBharathy<satish.8483@gmail.com>Thu Nov 24 17:50:36 2022 +0530Fix dist_fetcher_type test on PG15
4565813173e07af7d798e6d29ec10123e361c13ded3Dmitry Simonenko<dmitry@timescale.com>Wed Nov 23 16:54:59 2022 +0200Introduce drop_stale_chunks() functionThis function drops chunks on a specified data node if those chunks are not known by the access node. Call drop_stale_chunks() automatically when data node becomes available again. Fix #4848
457bdae647f0a73a3941541dbf3b2a0cda0b6f9ecfaAlexander Kuzmenkov<akuzmenkov@timescale.com>Tue Nov 22 18:56:11 2022 +0400Add i386 check results to databaseAlso add some more gdb commands to give us more context.
45826db8666376541f8929a0bfa2cc637092fe1ed99Alexander Kuzmenkov<akuzmenkov@timescale.com>Tue Nov 22 18:54:30 2022 +0400Fix GITHUB_OUTPUT on WindowsWe have to add it to WSLENV and translate it as a path, so that it properly passes the WSL <-> native process boundary.
45940297f1897ab73d5b9b7d960b5ae83338f14e1bfKonstantina Skovola<konstantina@timescale.com>Tue Nov 22 15:23:24 2022 +0200Fix TRUNCATE on hierarchical caggsWhen truncating a cagg that had another cagg defined on top of it, the nested cagg would not get invalidated accordingly. That was because we were not adding a corresponding entry in the hypertable invalidation log for the materialization hypertable of the base cagg. This commit adds an invalidation entry in the table so that subsequent refreshes see and properly process this invalidation. Co-authored-by: name <fabriziomello@gmail.com>
46035fa891013bcba87515b026e7e7b0abb728f1a54Fabrízio de Royes Mello<fabriziomello@gmail.com>Tue Nov 22 17:35:00 2022 -0300Add missing gitignore entryPull request #4998 introduced a new template SQL test file but missed to add the properly `.gitignore` entry to ignore generated test files.
461e84a6e2e6523de90b7b41a9bcf80120b85844894Fabrízio de Royes Mello<fabriziomello@gmail.com>Wed Nov 16 14:59:56 2022 -0300Remove the refresh step from CAgg migrationWe're facing some weird `portal snapshot` issues running the `refresh_continuous_aggregate` procedure called from other procedures. Fixed it by ignoring the Refresh Continuous Aggregate step from the `cagg_migrate` and warning users to run it manually after the execution. Fixes #4913
4627bc6e56cb7aa24e4142ddb97b51f58754bb46c58Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Mon Nov 21 14:47:42 2022 +0530Fix plan_hashagg test failure in PG15Updated the expected output of plan_hashagg to reflect changes introduced by postgres/postgres@4b160492.
463639a5018a3bad4499bce0e1215c24270514234d5Sven Klemm<sven@timescale.com>Tue Nov 22 11:37:45 2022 +0100Change time of scheduled CI runSince we now use the date as a part of the cache key to ensure no stale cache entries hiding build failures we need to make sure we have a cache entry present before workflows that depend on cache are run.
46448d9733fda44b869d95c3d3158f8423ab87b64adKonstantina Skovola<konstantina@timescale.com>Mon Nov 21 18:43:43 2022 +0200Add telemetry for caggs on top of caggsCommit #4668 introduced hierarchical caggs. This patch adds a field `num_caggs_nested` to the telemetry report to include the number of caggs defined on top of other caggs.
465fd84bf42a5c691d6e9f3e928f95830b81a85f17aJan Nidzwetzki<jan@timescale.com>Tue Nov 22 08:53:46 2022 +0100Use Ensure in get_or_add_baserel_from_cacheThis patch changes an Assert in get_or_add_baserel_from_cache to an Ensure. Therefore, this check is also performed in release builds. This is done to detect metadata corruptions at an early stage.
466a5b8c9b084aa6edd5eb8aeb38cc0ab16ecfd8ac4Fabrízio de Royes Mello<fabriziomello@gmail.com>Fri Nov 18 16:26:05 2022 -0300Fix caggs on caggs tests on PG15PR #4668 introduced the Hierarchical Continuous Aggregates (aka Continuous Aggregate on top of another Continuous Aggregate) but unfortunately we miss to fix the regression tests on PG15.
46789cede81bdae16f82125e75fdd4e891ad0157ed5Bharathy<satish.8483@gmail.com>Mon Nov 21 13:31:45 2022 +0530Fix PG15 specific tests.
4683b5653e4ccdb0dfbb7cef6e55c7fb49447bfd8e7Fabrízio de Royes Mello<fabriziomello@gmail.com>Fri Nov 18 16:35:02 2022 -0300Ignore trailing whitespaces changes in git blame
469a4356f342f1732857a1d8057f71219b50f1919b2Fabrízio de Royes Mello<fabriziomello@gmail.com>Wed Nov 16 17:00:40 2022 -0300Remove trailing whitespaces from test code
470b1742969d09114cd5138abe16f5c70dfbf864e4fFabrízio de Royes Mello<fabriziomello@gmail.com>Wed Nov 16 16:34:53 2022 -0300Add SQL test files to trailing whitespace CI checkIn commit 1f807153 we added a CI check for trailing whitespaces over our source code files (.c and .h). This commit add SQL test files (.sql and .sql.in) to this check.
4713749953e9704e45df8f621607989ada0714ce28dFabrízio de Royes Mello<fabriziomello@gmail.com>Wed Oct 5 18:45:40 2022 -0300Hierarchical Continuous AggregatesEnable users create Hierarchical Continuous Aggregates (aka Continuous Aggregates on top of another Continuous Aggregates). With this PR users can create levels of aggregation granularity in Continuous Aggregates making the refresh process even faster. A problem with this feature can be in upper levels we can end up with the "average of averages". But to get the "real average" we can rely on "stats_aggs" TimescaleDB Toolkit function that calculate and store the partials that can be finalized with other toolkit functions like "average" and "sum". Closes #1400
472fd11479700a1d91f78b20ba57cfddd43836fb72aJan Nidzwetzki<jan@timescale.com>Wed Nov 2 11:32:48 2022 +0100Speed up get_or_add_baserel_from_cache operationCommit 9f4dcea30135d1e36d1c452d631fc8b8743b3995 introduces the get_or_add_baserel_from_cache function. It contains a performance regression, since an expensive metadata scan (ts_chunk_get_hypertable_id_by_relid) is performed even when it could be avoided.
473380464df9bb35784853f186b9e268cd9d50e442bJan Nidzwetzki<jan@timescale.com>Fri Oct 28 16:09:52 2022 +0200Perform frozen chunk status check via triggerThe commit 9f4dcea30135d1e36d1c452d631fc8b8743b3995 introduces frozen chunks. Checking whether a chunk is frozen or not has been done so far in the query planner. If it is not possible to determine which chunks are affected by a query in the planner (e.g., due to a cast in the WHERE condition), all chunks are checked. This leads (1) to an increased planning time and (2) to the situation that a single frozen chunk could reject queries, even if the frozen chunk is not addressed by the query.
4747c32ceb0737b0d959eac0d866447918c4453844aLakshmi Narayanan Sreethar<lakshmi@timescale.com>Thu Nov 17 18:13:41 2022 +0530Fix perl test import in PG15Removed an invalid import from 007_healthcheck.pl test. Also enabled all the perl tests and a couple of others in PG15.
475b9ca06d6e3d6a0d8ca924917fddb3e78e6f14a64gayyappan<gayathri@timescale.com>Mon Nov 14 09:56:24 2022 -0500Move freeze/unfreeze chunk to tslMove code for freeze and unfreeze chunk to tsl directory.
476bfa641a81c2db82366baf7848c0723ee6eae7f90Bharathy<satish.8483@gmail.com>Thu Nov 17 18:44:09 2022 +0530INSERT .. SELECT on distributed hypertable fails on PG15INSERT .. SELECT query containing distributed hypertables generates plan with DataNodeCopy node which is not supported. Issue is in function tsl_create_distributed_insert_path() where we decide if we should generate DataNodeCopy or DataNodeDispatch node based on the kind of query. In PG15 for INSERT .. SELECT query timescaledb planner generates DataNodeCopy as rte->subquery is set to NULL. This is because of a commit in PG15 where rte->subquery is set to NULL as part of a fix. This patch checks if SELECT subquery has distributed hypertables or not by looking into root->parse->jointree which represents subquery. Fixes #4983
4771e3200be7db529560d12a0a2323ed962e8614301Sachin<sachin.timescale.com>Mon Nov 7 08:50:22 2022 +0000USE C function for time_bucket() offsetInstead of using SQL UDF for handling offset parameter added ts_timestamp/tz/date_offset_bucket() which will handle offset
478839e42dd0c1d132a230760681e135706d3b7c971Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Thu Nov 10 02:02:18 2022 +0530Use async API to drop database from delete_data_nodePG15 introduced a ProcSignalBarrier mechanism in drop database implementation to force all backends to close the file handles for dropped tables. The backend that is executing the drop database command will emit a new process signal barrier and wait for other backends to accept it. But the backend which is executing the delete_data_node function will not be able to process the above mentioned signal as it will be stuck waiting for the drop database query to return. Thus the two backends end up waiting for each other causing a deadlock. Fixed it by using the async API to execute the drop database command from delete_data_node instead of the blocking remote_connection_cmdf_ok call. Fixes #4838
4791b65297ff7ed21ae2b338a88cf16d151903178f4Alexander Kuzmenkov<akuzmenkov@timescale.com>Wed Nov 16 13:32:26 2022 +0400Fix memory leak with INSERT into compressed hypertableWe used to allocate some temporary data in the ExecutorContext.
4807e4ebd131f0e6716bdea3447ff5e801eb71314bdAlexander Kuzmenkov<akuzmenkov@timescale.com>Tue Nov 15 19:18:13 2022 +0400Escape the quotes in gdb command
481676d1fb1f1f82f34ae5cdad96022796682215f27Alexander Kuzmenkov<akuzmenkov@timescale.com>Tue Nov 15 18:03:05 2022 +0400Fix const null clauses in runtime chunk exclusionThe code we inherited from postgres expects that if we have a const null or false clause, it's going to be the single one, but that's not true for runtime chunk exclusion because we don't try to fold such restrictinfos after evaluating the mutable functions. Fix it to also work for multiple restrictinfos.
482f3a3da780440ec204a4c979bc663aa298c80c0d3Mats Kindahl<mats@timescale.com>Wed Nov 2 22:29:11 2022 +0100Take advisory lock for job tupleJob ids are locked using an advisory lock rather than a row lock on the jobs table, but this lock is not taken in the job API functions (`alter_job`, `delete_job`, etc.), which appears to cause a race condition resulting in addition of multiple rows with the same job id. This commit adds an advisory `RowExclusiveLock` on the job id while altering it to match the advisory locks taken while performing other modifications. Closes #4863
48351e5f319184050c36599a0517fdf4b2a6a23fd62Ante Kresic<ante.kresic@gmail.com>Thu Nov 10 11:56:01 2022 +0100Update compress chunk interval on compressed dataCompress chunk interval is set using an ALTER TABLE statement. This change makes it so you can update the compress chunk interval while keeping the rest of the compression settings intact. Updating it will only affect chunks that are compressed and rolled up after the change.
4848b6eb9024f6995e4615098e9c166aabb4c77f2e5Sven Klemm<sven@timescale.com>Fri Nov 11 22:19:01 2022 +0100Check for interrupts in gapfill main loopAdd CHECK_FOR_INTERRUPTS() macro to gapfill main loop.
48587756bcff955cb3916c88ef19c3992d5c25183a7Sven Klemm<sven@timescale.com>Thu Nov 10 19:13:26 2022 +0100Bump postgres versions used in CIUse PG 12.13, 13.9 and 14.6 in our CI
4862f237e6e57e5ac66c126233d66969a1f674ffaa4Sven Klemm<sven@timescale.com>Thu Nov 10 19:10:49 2022 +0100Add Enterprise Linux 9 packages to RPM package test
48733531212b233027d10ba7887ef9754dad14c35b2Lakshmi Narayanan Sreethar<lakshmi@timescale.com>Mon Nov 14 19:30:33 2022 +0530Disable dist_move_chunk test in PG15The dist_move_chunk causes the CI to hang when compiled and run with PG15 as explained in #4972. Also fixed schema permission issues in data_node and dist_param tests.
4888afdddc2da6020e56ba9128d8f36d3cb5b7775f6Bharathy<satish.8483@gmail.com>Tue Nov 15 06:18:15 2022 +0530Deprecate continuous aggregates with old formatThis patch will report a warning when upgrading to new timescaledb extension, if their exists any caggs with partial aggregates only on release builds. Also restrict users from creating cagss with old format on timescaledb with PG15.
489b085833fdac4d6ffeafef320227e5e8c53f23a1bMats Kindahl<mats@timescale.com>Fri Nov 11 10:34:59 2022 +0100Print errors in release builds for jobsOld assertions checking integrety of metadata for jobs will print error message in release builds instead of continuing executing with bad metadata.
490121631c70fdf08c285ac9201d0767ed99e4891c8Alexander Kuzmenkov<akuzmenkov@timescale.com>Mon Nov 14 18:09:54 2022 +0400Support parameterized data node scans in joinsThis allows us to perform a nested loop join of a small outer local table to an inner distributed hypertable, without downloading the entire hypertable to the access node.
4919964ba8ba6440a7df9f7799f880fb144db1858a6Alexander Kuzmenkov<akuzmenkov@timescale.com>Mon Nov 14 18:21:10 2022 +0400Remove accidental debug outputWas added in # 4890
4920d30155b26da1711f7f0b824f1fa7a7302ebf268Alexander Kuzmenkov<akuzmenkov@timescale.com>Mon Nov 14 16:59:59 2022 +0400Upload test results into a databaseThis will help us find the flaky tests or the rare failures.
4930360812e3ccc627ab6e1cb6aab8e95f925956593Alexander Kuzmenkov<akuzmenkov@timescale.com>Wed Nov 9 20:01:58 2022 +0400Simplify llvm configuration for linux/macos buildsSet it only in the matrixbuilder.
494feb09c54e9da991baec6ecb11d9bd661b20a121bAlexander Kuzmenkov<akuzmenkov@timescale.com>Wed Nov 9 20:03:49 2022 +0400Rebuild cached PG daily and on config changesOtherwise it's easy to break these builds and not notice it until much later.
495141e114ccb5207bd5ba5f99ee7d46d1736bad899Mats Kindahl<mats@timescale.com>Mon Nov 14 12:38:45 2022 +0100Fix race in bgw_db_scheduler_fixedWhen deleting a job in the test, the job does not necessarily terminate immediately, so wait for a log entries from the job before checking the jobs table. Fixed #4859
496e2b7c76c9c1d53edf15ea3d4d01d666a675a7c5fMarkos Fountoulakis<markos@timescale.com>Thu Nov 10 10:55:22 2022 +0200Disable MERGE when using hypertablesFixes #4930 Co-authored-by: Lakshmi Narayanan Sreethar <lakshmi@timescale.com>
4979e276c58ee7b99ae479f4a544de12bbbcc84c211Fabrízio de Royes Mello<fabriziomello@gmail.com>Fri Nov 11 14:42:22 2022 -0300Revert "Upload test results into the database"This reverts commit 252cefb509153fadcb32741a27ec3fa977487049 because it broke our CI globally.
4986ae192631edb3c5a852b0ac2d0441e5b3e2b8a12Fabrízio de Royes Mello<fabriziomello@gmail.com>Thu Nov 10 09:56:09 2022 -0300Fix CAgg migration with timestamp without timezoneIt was a leftover from the original implementation where we didn't add tests for time dimension using `timestamp without timezone`. Fixed it by dealing with this datatype and added regression tests. Fixes #4956
499252cefb509153fadcb32741a27ec3fa977487049Alexander Kuzmenkov<akuzmenkov@timescale.com>Wed Nov 9 20:06:32 2022 +0400Upload test results into the databaseThis will help us find the flaky tests or the rare failures.
500f13214891cf47fed0db6183ce6b56d9273865de3Erik Nordström<erik@timescale.com>Fri Oct 14 11:09:53 2022 +0200Add function to alter data nodesAdd a new function, `alter_data_node()`, which can be used to change the data node's configuration originally set up via `add_data_node()` on the access node. The new functions introduces a new option "available" that allows configuring the availability of the data node. Setting `available=>false` means that the node should no longer be used for reads and writes. Only read "failover" is implemented as part of this change, however. To fail over reads, the alter data node function finds all the chunks for which the unavailable data node is the "primary" query target and "fails over" to a chunk replica on another data node instead. If some chunks do not have a replica to fail over to, a warning will be raised. When a data node is available again, the function can be used to switch back to using the data node for queries. Closes #2104
501fe6731cead8625ed71c3feb9ed5a17679bffe837Sven Klemm<sven@timescale.com>Sat Nov 5 16:39:06 2022 +0100Fix compress_segmentby in isolation testscompress_segmentby should never be on a column with random() values as that will result in very inefficient compression as the batches will only have 1 tuple each.
5024f9eef3211166b22424beb51a87dfe7c329b60c7Jan Nidzwetzki<jan@timescale.com>Thu Nov 10 14:13:47 2022 +0100Print correct variables in downgrade test scriptThe downgrade script has printed a message in which the same variable is used for the upgrade and the downgrade version. This patch corrects the output and uses the correct variables.
5036ad28248f364d2b78ecb9495c37bc13a99969eb0Alexander Kuzmenkov<akuzmenkov@timescale.com>Wed Nov 9 19:59:15 2022 +0400Change the flaky check to use output filesThis is simpler, accounts for both sql and isolation tests, changes in included files, and versioned tests.
504e4ba2bcf560568ae68f3775c058f0a8d7f7c0501Sven Klemm<sven@timescale.com>Wed Nov 9 09:29:36 2022 +0100Remove debian 9 from packages tests.Debian 9 is EOL since July 2022 so we won't build packages for it anymore and can remove it from CI.
5051f807153085b37c4c48f955ddbcc575bec10c6d2Mats Kindahl<mats@timescale.com>Tue Nov 8 13:59:18 2022 +0100Check for trailing whitespaceAs a result of editing, trailing whitespace is often resulting and since some editors automatically remove trailing whitespace this creates diffs with more changed lines than necessary. Add a check that files do not have trailing whitespace and fail if there are.
5069744b4f3bc9859bed7a434143b46c9ae298999bfSven Klemm<sven@timescale.com>Tue Nov 1 10:25:46 2022 +0100Remove BitmapScan support in DecompressChunkWe don't want to support BitmapScans below DecompressChunk as this adds additional complexity to support and there is little benefit in doing so. This fixes a bug that can happen when we have a parameterized BitmapScan that is parameterized on a compressed column and will lead to an execution failure with an error regarding incorrect attribute types in the expression.
507bfef3173bc89b8470fbc423ceb5a49ee138c82e3Fabrízio de Royes Mello<fabriziomello@gmail.com>Mon Nov 7 17:06:13 2022 -0300Refactor CAgg migration code to use job APIThe current implementation update the jobs table directly and to make it consistent with other parts of the code we changed it to use the `alter_job` API instead to enable and disable the jobs during the migration. This refactoring is related to #4863.
5082a64450651a62114b2de3811f772eac44232ee9cBharathy<satish.8483@gmail.com>Mon Nov 7 21:42:22 2022 +0530Add new tests to gitignore listSince new tests specific to PG15 were added, these tests which generated .sql files needs to be added to .gitnore
5093a9688cc97bb726d31b5c381ece9e1a5da756cc9Bharathy<satish.8483@gmail.com>Mon Nov 7 20:05:30 2022 +0530Extra Result node on top of CustomScan on PG15On PG15 CustomScan by default is not projection capable, thus wraps this node in Result node. THis change in PG15 causes tests result files which have EXPLAIN output to fail. This patch fixes the plan outputs. Fixes #4833
510b95576550cae05c0db1b520b5f0ae1668312e949Mats Kindahl<mats@timescale.com>Fri Nov 4 15:01:57 2022 +0100Add printout for multiple jobs with same job_idWe have a rare condition where a debug build asserts on more than one job with the same job id. Since it is hard to create a reproduction, this commit adds a printout for those conditions and print out all the jobs with that job id in the postgres log. Part of #4863
5113059290beaa4e722e77dada386a9dd29d59c51dfSven Klemm<sven@timescale.com>Fri Nov 4 20:44:53 2022 +0100Add new chunk state CHUNK_STATUS_COMPRESSED_PARTIALA chunk is in this state when it is compressed but also has uncompressed data in the uncompressed chunk. Individual tuples can only ever exist in either area. This is preparation patch to add support for uncompressed staging area for DML operations.
5125b0bff384bd85db1dd727050e1782ac618a4b553Sven Klemm<sven@timescale.com>Fri Nov 4 20:35:49 2022 +0100Improve InvalidOid coccinelle checkThe initial version of the check did not include a detailed message about the code failure in the CI output and did not check for expressions with operands in wrong order.
513f289ef8828c71ee5cb62bcc30fce92b607912aa5Sven Klemm<sven@timescale.com>Fri Nov 4 20:40:58 2022 +0100Remove unused function ts_chunk_is_uncompressed_or_unordered
51412745c880668825c8e3b966c43e3d4cdcb4d2900Bharathy<satish.8483@gmail.com>Mon Nov 7 09:09:04 2022 +0530Fix error: variable not found in subplan target list on PG15On PG15 new flag CUSTOMPATH_SUPPORT_PROJECTION is introduced. This flag tells if a planner node is projection capable or not. CustomScan created in TimescaleDB by default is not projection capable, this causes CustomScan node to be wrapped around Result node. Update query on a hypertable has a logic which is based on assumption that "ModifyTable" plan nodes lefttree should be CustomScan node. With PG15 this assumption is broken which causes "ERROR: variable not found in subplan target list". Fixes #4834
5156c73b61b998293f750ed3392f8afa35b97a63b66Fabrízio de Royes Mello<fabriziomello@gmail.com>Thu Nov 3 15:10:34 2022 -0300Fix orphan jobs after CAgg migrationWhen using `override => true` the migration procedure rename the current cagg using the suffix `_old` and rename the new created with suffix `_new` to the original name. The problem is the `copy polices` step was executed after the `override` step and then we didn't found the new cagg name because it was renamed to the original name leading the policy orphan (without connection with the materialization hypertable). Fixed it by reordering the steps executin the `copy policies` before the `override` step. Also made some ajustments to properly copy all `bgw_job` columns even if this catalog table was changed. Fixes #4885
5161847f64a2f766c5ff2936fa39c568fb4f82ae702Alexander Kuzmenkov<akuzmenkov@timescale.com>Wed Nov 2 11:12:37 2022 +0400Fix sanitizer builds with -WclobberedThey use GCC 10 which has some other set of false positives.
517c54cf3ea56de9e05852ea54f90c55c5a221fa1bbKonstantina Skovola<konstantina@timescale.com>Fri Oct 14 10:43:18 2022 +0300Add job execution statistics to telemetryThis patch adds two new fields to the telemetry report, `stats_by_job_type` and `errors_by_sqlerrcode`. Both report results grouped by job type (different types of policies or user defined action). The patch also adds a new field to the `bgw_job_stats` table, `total_duration_errors` to separate the duration of the failed runs from the duration of successful ones.
518f1535660b04251cfb6cdfd4435cfa5185420f1f7Fabrízio de Royes Mello<fabriziomello@gmail.com>Tue Nov 1 19:07:51 2022 -0300Honor usage of OidIsValid() macroPostgres source code define the macro `OidIsValid()` to check if the Oid is valid or not (comparing against the `InvalidOid` type). See `src/include/c.h` in Postgres source three. Changed all direct comparisons against `InvalidOid` for the `OidIsValid` call and add a coccinelle check to make sure the future changes will use it correctly.
5197dd45cf348576f3afec90fe2ee282e97dda0ed26Fabrízio de Royes Mello<fabriziomello@gmail.com>Fri Oct 28 15:29:10 2022 -0300Fix failure resuming a CAgg migrationTrying to resume a failed Continuous Aggregate raise an exception that the migration plan already exists, but this is wrong and the expected behaviour should be resume the migration and continue from the last failed step.
52008791cad4316b7cb567176fb1ea46f28a6f66fd8Alexander Kuzmenkov<akuzmenkov@timescale.com>Thu Nov 3 13:41:00 2022 +0400Disable llvm on macosI accidentally re-enabled it when adding the flaky check.
5212475c1b92ff9e566cb3858924ca153aa14ab4a25Ante Kresic<ante.kresic@gmail.com>Fri Sep 16 15:45:07 2022 +0200Roll up uncompressed chunks into compressed onesThis change introduces a new option to the compression procedure which decouples the uncompressed chunk interval from the compressed chunk interval. It does this by allowing multiple uncompressed chunks into one compressed chunk as part of the compression procedure. The main use-case is to allow much smaller uncompressed chunks than compressed ones. This has several advantages: - Reduce the size of btrees on uncompressed data (thus allowing faster inserts because those indexes are memory-resident). - Decrease disk-space usage for uncompressed data. - Reduce number of chunks over historical data. From a UX point of view, we simple add a compression with clause option `compress_chunk_time_interval`. The user should set that according to their needs for constraint exclusion over historical data. Ideally, it should be a multiple of the uncompressed chunk interval and so we throw a warning if it is not.
5228d1755bd78008dd894510b38fa609458b1beb9f8Sutou Kouhei<kou@clear-code.com>Wed Nov 2 11:29:29 2022 +0900Fix a typo in process_compressed_data_out()
523c06b647680dabac74cd027735ad7176f855c24a0Bharathy<satish.8483@gmail.com>Tue Nov 1 19:39:38 2022 +0530pg_dump on PG15 does not log messages with log level set to PG_LOG_INFO.Version 15 pg_dump program does not log any messages with log level < PG_LOG_WARNING to stdout. Whereas this check is not present in version 14, thus we see corresponding tests fail with missing log information. This patch fixes by supressing those log information, so that the tests pass on all versions of postgresql. Fixes #4832
524840f144e09640fcf981706eab30c387ce59a1fd1Alexander Kuzmenkov<akuzmenkov@timescale.com>Thu Oct 27 18:04:27 2022 +0400Enable and fix -WclobberedThe one in job_stat.c could probably lead to errors.
5251cc8c15cad938b432995217bcdaada5030a34b9fAlexander Kuzmenkov<akuzmenkov@timescale.com>Thu Oct 27 15:59:31 2022 +0400Do not clobber the baserel cache on UDF errorThe baserel cache should only be allocated and freed by the top-level query.
52620cdd9ca3ed0c2d62779c4fc61d278a489b4460aSven Klemm<sven@timescale.com>Tue Nov 1 12:22:59 2022 +0100Fix bgw_db_scheduler_fixed flakynessDepending on date boundaries the number of chunks produced for the cagg hypertable was not constant resulting on flaky tests on certain days.
5273d30f07bf48d5e0e186535ede438d8e4003a7664Sven Klemm<sven@timescale.com>Tue Nov 1 11:11:48 2022 +0100Swap lookup order for clang-formatLook for the binary with exact version before looking for the generic name to prevent failure when clang-format is lower then required version but clang-format-14 exists.
528d51fefb74405a519c51dd0f10a89d75c816399c4Alexander Kuzmenkov<akuzmenkov@timescale.com>Mon Oct 31 18:23:14 2022 +0400Add the Flaky CheckIt runs new or changed tests multiple times to find flakiness.
529e08e0a59db5f8cee24350f79971a0271ee4269d6gayyappan<gayathri@timescale.com>Tue Oct 25 10:43:33 2022 -0400Add hook for chunk creationAfter data is tiered using OSM, we cannot insert data into the same range. Need a callback that can be invoked by timescaledb to check for range overlaps before creating a new chunk
5305b2d9d5a106d6dc381d16758780893d5bcbc35ddAlexander Kuzmenkov<akuzmenkov@timescale.com>Fri Oct 28 17:06:46 2022 +0400Enable -Wnewline-eofIt enforces the newline at end of file, which is required by the C standard.
531c48b1231a884bebe061624281f30934037885c9bgayyappan<gayathri@timescale.com>Thu Oct 27 18:47:18 2022 -0400Allow foreign tables in hypetable modify pathOSM chunks are foreign tables. Modify assert to allow updates/deletes on hypertables with foreign table chunks.
532dfbf030af7ceec8bf6b41ae02e87414bc72bd318Jan Nidzwetzki<jan@timescale.com>Thu Oct 27 16:26:22 2022 +0200Remove no-activity label on issue activitySo far, only the "need-more-info" label was removed when there was activity on an issue. This PR ensures that the "no-activity" label is also removed.
53385f5efdc8f86630039faeaa3523a2ddbe16f1974Alexander Kuzmenkov<akuzmenkov@timescale.com>Thu Oct 27 19:00:01 2022 +0400Fix -Wsign-compare with PG 15It changed the type of Var.varno from Index to int. I'm starting to wonder if it was a good idea to enable this warning, but maybe we can give it the last try.
534d8e892a658d9b3a3071764be745465c331f86d52Alexander Kuzmenkov<akuzmenkov@timescale.com>Wed Oct 26 17:25:22 2022 +0400Save postgres logs on Windows in CIWe don't save them currently.
5358d1e165d7f2cd660fe5ee82d34463a4f9aa420a6Fabrízio de Royes Mello<fabriziomello@gmail.com>Wed Oct 26 16:44:59 2022 -0300Refactor Continuous Aggregate catalog codeGet rid of `GETSTRUCT` to fill the form data and use `heap_deform_tuple` instead. This is necessary specially when you have variable lenght fields and/or fields that accept NULL values. This refactoring will be specially usefull in a following PR for Nested Continuous Aggregates where we'll add a new metadata to the catalog that can accept NULL values. Also refactor the rename view and schema code paths improving the readability and maintainability.
5369b157d5438049dc2a267dd3a5ed57ef33b8820f4Alexander Kuzmenkov<akuzmenkov@timescale.com>Thu Oct 27 15:17:26 2022 +0400Don't use docker for clang-formatIt's not something we normally do for the developer tools.
537313845a88245312fdb9d19f26c29d2e027808a3eAlexander Kuzmenkov<akuzmenkov@timescale.com>Thu Oct 27 15:08:09 2022 +0400Enable -WextraOur code mostly has warnings about comparison with different signedness.
538864da20cee764b33b149444d561af4f60653eb64Alexander Kuzmenkov<akuzmenkov@timescale.com>Fri Oct 21 17:04:41 2022 +0400Build on Ubuntu 22.04It has newer GCC which should detect more warnings.
5392e7d7ee960d2a0506ff415e1f4f50b74a51df632Fabrízio de Royes Mello<fabriziomello@gmail.com>Wed Oct 26 11:08:24 2022 -0300Remove useless message from tsl_cagg_try_repairThe PR #3899 introduced a new function named `tsl_cagg_try_repair` to try to fix buggy Continuous Aggregates that lead to segfault on a select query. It added an INFO message when skipping the check for Continuous Aggregate that don't have partials and it's annoying during the upgrade/downgrade the extension specially if you have many Continuous Aggregate. Remove this message because it's completely useless.
540da9af2c05d1be2b487c2d3f873a0de49bdb2740fAlexander Kuzmenkov<akuzmenkov@timescale.com>Fri Oct 21 22:39:38 2022 +0400Do not cache the classify_relation resultIt depends on the context, not only on the relation id. The same chunk can be expanded both as a child of hypertable and as an independent table.
541498b8af261f7c5e93852448db55ca418e86ae6e2Dmitry Simonenko<dmitry@timescale.com>Wed Oct 26 13:00:21 2022 +0300Block multi-statement DDL command in one queryEnsure that queries involving several distributed DDL commands in one query string are blocked. Fix #4818
542cef8c462dbfa46e68896976e9bc1e7ecd5e46162Sven Klemm<sven@timescale.com>Sun Oct 23 16:38:44 2022 +0200Fix postgres version assert in telemetryThe telemetry code that reads the postgres version was not updated when support for older postgres version was dropped so we introduce a new macro PG_MAJOR_MIN which is the oldest pg major version we support.
543f05545883bc3bd338936446d7007fc53759a0cf8Jan Nidzwetzki<jan@timescale.com>Mon Oct 24 12:11:15 2022 +0200Add a Coccinelle test for PG 12.3+ ereport syntaxThis PR adds a Coccinelle test for ereport(..) calls that use the PG 12.3+ syntax (postgres/postgres@a86715451653c730d637847b403b0420923956f7). We had some of these calls in the past, which we had to fix afterward ( see #4733, #4809, #4871). This Coccinelle patch detects such calls and reports them in the CI run.
544fabb01fdaf611c2deb66ce53e133a0ca3efb3e0cKonstantina Skovola<konstantina@timescale.com>Wed Oct 19 08:58:35 2022 +0300Add telemetry for fixed schedule jobsPrevious commit #4664 introduced the ability to execute background jobs on a fixed schedule. This commit updates our telemetry data to include the number of jobs scheduled to execute on a fixed schedule vs the number registered to execute on a drifting schedule.
54506f2e57c50fc54b899565fc156aac7ba72b91e03Fabrízio de Royes Mello<fabriziomello@gmail.com>Fri Oct 21 15:38:13 2022 -0300Fix ereport call in job schedule for PG 12.0Since PG 12.3 the `ereport` syntax changed and the commit 54ed0d introduced and `ereport` call that works just using newer PG versions. Changed the `ereport` call a PG 12.0 compatible syntax. CI failure: https://github.com/timescale/timescaledb/actions/runs/3292571583/jobs/5428090238 Related PRs: #4733, #4809
54639c9921947eec033081003d4ee4b74604476a9c6Alexander Kuzmenkov<akuzmenkov@timescale.com>Fri Oct 21 18:43:26 2022 +0400Fix flaky copy_memory_usage testsThe changes from e555eea lead to flakiness. They are a leftover of earlier version and probably not needed anymore. The original version is also still flaky on Windows, so use linear regression to tell if the memory usage is increasing. Verified to still fail on 2.7.x
54725628e037a225857eee2f17f1d2a3a88c9317727Alexander Kuzmenkov<akuzmenkov@timescale.com>Tue Oct 18 18:04:37 2022 +0400Use non-refcounted tupdesc for multi-insert buffersWe don't need reference counting there, and it spends a lot of CPU in ResourceOwner. This slightly improves COPY performance on some data sets.
54884b2fef6ef166a5bad2b9d8fafcf0590259f8473Mats Kindahl<mats@timescale.com>Thu Oct 20 13:37:26 2022 +0200Fix GitHub output actionTo avoid untrusted logged data to use `set-state` and `set-output` workflow commands without the intention of the workflow author GitHub have introduced a new set of environment files to manage state and output. This commit changes the existing uses of `set-output` to use the new environment files instead. See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
5494b05402580b9ae8e843acaf48f1559c7b261e032Erik Nordström<erik@timescale.com>Thu Sep 1 17:26:41 2022 +0200Add health check functionA new health check function _timescaledb_internal.health() returns the health and status of the database instance, including any configured data nodes (in case the instance is an access node). Since the function returns also the health of the data nodes, it tries hard to avoid throwing errors. An error will fail the whole function and therefore not return any node statuses, although some of the nodes might be healthy. The health check on the data nodes is a recursive (remote) call to the same function on those nodes. Unfortunately, the check will fail with an error if a connection cannot be established to a node (or an error occurs on the connection), which means the whole function call will fail. This will be addressed in a future change by returning the error in the function result instead.
55023c01c44e5c259cbc1091a1f3492758a27dcaad3Jan Nidzwetzki<jan@timescale.com>Fri Oct 21 09:24:17 2022 +0200Remove an unused function in the copy codeSince e555eea9dbc05f4c09cf0d7e23b814054a459d19 the function TSCopyMultiInsertInfoIsEmpty is no longer used. This patch removes the unused code from src/copy.c.
551e555eea9dbc05f4c09cf0d7e23b814054a459d19Jan Nidzwetzki<jan@timescale.com>Mon Oct 17 11:57:28 2022 +0200Fix performance regressions in the copy codeIn 8375b9aa536a619a5ac2644e0dae3c25880a4ead, a patch was added to handle chunks closes during an ongoing copy operation. However, this patch introduces a performance regression. All MultiInsertBuffers are deleted after they are flushed. In this PR, the performance regression is fixed. The most commonly used MultiInsertBuffers survive flushing. The 51259b31c4c62b87228b059af0bbf28caa143eb3 commit changes the way the per-tuple context is used. Since this commit, more objects are stored in this context. The size of the context was used to set the tuple size to PG < 14. The extra objects in the context lead to wrong (very large) results and flushes almost after every tuple read. The cache synchronization introduced in 296601b1d7aba7f23aea3d47c617e2d6df81de3e is reverted. With the current implementation, `MAX_PARTITION_BUFFERS` survive the flash. If `timescaledb.max_open_chunks_per_insert` is lower than `MAX_PARTITION_BUFFERS` , a buffer flush would be performed after each tuple read.
55240a6c4cf87edb3ca261cebcf4b2c6af11fcc6f0eErik Nordström<erik@timescale.com>Sat Oct 15 16:20:34 2022 +0200Fix unused sort in dimension partition lookupDimension partition lookups use binary search to find the partition to place a chunk in. However, in the code, an array of partitions might not be sorted because the sort happened on a copy of the array instead of the main array. This change fixes the issue to ensure the array is sorted and binary search works properly.
553f862212c8ca19b1af56c7608a68f22b7dd0c985eAlexander Kuzmenkov<akuzmenkov@timescale.com>Tue Oct 18 21:12:35 2022 +0400Add clang-tidy warning readability-inconsistent-declaration-parameter-nameMostly cosmetic stuff. Matched to definition automatically with --fix-notes.
55473c3d02ed2472b9c92e118c67a01749802595950Alexander Kuzmenkov<akuzmenkov@timescale.com>Tue Oct 18 21:20:06 2022 +0400Enable clang-tidy warning readability-misleading-indentation
55505ba1cf22f0dc9232069b566dd23c3edb2cbaee4Alexander Kuzmenkov<akuzmenkov@timescale.com>Tue Oct 18 20:53:38 2022 +0400Add clang-tidy warning readability-suspicious-call-argumentHelps find accidentally swapped arguments, like in the recent epoll_ctl() error.
556276d3a331dc4e248056424230ad953041866106dMats Kindahl<mats@timescale.com>Fri May 20 20:55:39 2022 +0200Add macro to assert or errorFor some unexpected conditions, we have a check and an error that is generated. Since this always generate an error, it is more difficult to find the bug if the error is generated rather than an assert fired generating a core dump. Similarly, some asserts can occur in production builds and will lead to strange situations triggering a crash. For those cases we should instead generate an error. This commit introduces a macro `Ensure` that will result in an assert in debug builds, but an error message in release build. This macro should only be used for conditions that should not occur during normal runtime, but which can happen is odd corner-cases in release builds and therefore warrants an error message. It also replaces some existing checks with such errors to demonstrate usage.
557f55aaf06dd2bf8d1d9296b19bb5f7eea541f05afNikhil Sontakke<nikhil@timescale.com>Tue Oct 4 15:55:54 2022 +0530Add hook for ssl optionsExternal components like timescaledb_cloudutils might want to add additional options or do additional ssl related processing. They can do so by implementing a hook and then assigning it to a timescaledb variable to allow timescale to invoke it as appropriate.
558d218715d5c064c88f0e8d56070d762a95c3b65abBharathy<satish.8483@gmail.com>Wed Oct 19 17:35:02 2022 +0530Fix tests which fail on PG15When TimescaleDB 2.9.0 compiled against PG15, many tests fail due to permissions on default public schema not getting propagated to data nodes, although connected user has required GRANTS on access nodes. This patch fixes failing tests by explicitly granting required permissions for connected user or role after data nodes are added.
559080011d767a6e61d09dc83b4d58f8be7dc9ecb31Alexander Kuzmenkov<akuzmenkov@timescale.com>Tue Oct 18 20:26:45 2022 +0400Speed up the dist_copy testsIn some cases we can use less chunks, less data, and not truncate tables.
560702ac53c0ac4fe339e87130622ddaaa63366f03fFabrízio de Royes Mello<fabriziomello@gmail.com>Tue Oct 18 17:30:00 2022 -0300Bump codecov github action versionLeftover from previous commit 8950ab where we bumped some github action versions to run on Node16 instead of Node12 (in deprecation).
56154ed0d5c05df990674a6fc9857e1120cdcc9b338Konstantina Skovola<konstantina@timescale.com>Thu Aug 25 13:58:08 2022 +0300Introduce fixed schedules for background jobsCurrently, the next start of a scheduled background job is calculated by adding the `schedule_interval` to its finish time. This does not allow scheduling jobs to execute at fixed times, as the next execution is "shifted" by the job duration. This commit introduces the option to execute a job on a fixed schedule instead. Users are expected to provide an initial_start parameter on which subsequent job executions are aligned. The next start is calculated by computing the next time_bucket of the finish time with initial_start origin. An `initial_start` parameter is added to the compression, retention, reorder and continuous aggregate `add_policy` signatures. By passing that upon policy creation users indicate the policy will execute on a fixed schedule, or drifting schedule if `initial_start` is not provided. To allow users to pick a drifting schedule when registering a UDA, an additional parameter `fixed_schedule` is added to `add_job` to allow users to specify the old behavior by setting it to false. Additionally, an optional TEXT parameter, `timezone`, is added to both add_job and add_policy signatures, to address the 1-hour shift in execution time caused by DST switches. As internally the next start of a fixed schedule job is calculated using time_bucket, the timezone parameter allows using timezone-aware buckets to calculate the next start.
5628950abe0ee071549fbcd2d52ce544532ef3e7844Fabrízio de Royes Mello<fabriziomello@gmail.com>Mon Oct 17 15:22:30 2022 -0300Bump github action versionsAll github actions that run on Node12 are deprecated so bumped github action versions to run on Node16. https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/
563043bd55c0bf7ef372da6ad3e7874be030b10781cFabrízio de Royes Mello<fabriziomello@gmail.com>Thu Oct 13 20:05:04 2022 -0300Miss segmentby compression option in CAGGsTimescale 2.7 released a new version of Continuous Aggregate (#4269) that store the final aggregation state instead of the byte array of the partial aggregate state, offering multiple opportunities of optimizations as well a more compact form. This new version also removes the unecessary `chunk_id` column from the materialization hypertable and consequently the re-aggregation in the user view. It means the user view that query the materialization hypertable don't have a GROUP BY clause anymore that was problematic for query performance. Before 2.7 when users turn compression ON we infer compression options `segmentby` and `orderby` based on the GROUP BY clause and time bucket respectively. With the new version without a GROUP BY clause in the user view the inferetion for the 'segmentby' compression option stopped to work. Fixed it by changing the code to the compression on the new version of Continuous Aggregate (aka finals form) behave the same as the old version. Fix #4816
564bde337e92d32e7d20f5c5e75fb0ccbc3e50e8262Alexander Kuzmenkov<akuzmenkov@timescale.com>Mon Oct 17 19:41:20 2022 +0300Fix the flaky pg_dump testIt was frequently failing on Windows. Sort by what is actually printed.
5650e32656b54ca2221ea1a2da6b941e8055f13c7daBharathy<satish.8483@gmail.com>Mon Oct 17 20:53:34 2022 +0530Support for PG15.As part of this patch, added and fixed some of the regress checks which fail on PG15.
566d5c25e8914513694bb20dad22146c39c16d908a7Markos Fountoulakis<markos@timescale.com>Mon Oct 17 16:06:15 2022 +0300Adjust partition pruning to support PG15PostgreSQL 15 introduced a Bitmapset for tracking non-pruned partitions for performance purposes. Adjust our code for expanding hypertable chunks to support this. https://github.com/postgres/postgres/commit/475dbd0b718
567066bcbed6d18a8c8a29a96b5ac607d9939ddc860Alexander Kuzmenkov<akuzmenkov@timescale.com>Thu Oct 13 20:25:11 2022 +0300Rename row-by-row fetcher to COPY fetcherThis name better reflects its characteristics, and I'm thinking about resurrecting the old row-by-row fetcher later, because it can be useful for parameterized queries.
56838878bee1671a0288c562e8a4e0934bb4b06143aBharathy<satish.8483@gmail.com>Wed Oct 12 09:20:09 2022 +0530Fix segementation fault during INSERT into compressed hypertable.INSERT into compressed hypertable with number of open chunks greater than ts_guc_max_open_chunks_per_insert causes segementation fault. New row which needs to be inserted into compressed chunk has to be compressed. Memory required as part of compressing a row is allocated from RowCompressor::per_row_ctx memory context. Once row is compressed, ExecInsert() is called, where memory from same context is used to allocate and free it instead of using "Executor State". This causes a corruption in memory. Fixes: #4778
5698f5698f49d11d41dfe7b97c63e98b543e6d5de7aSven Klemm<sven@timescale.com>Tue Oct 11 00:05:10 2022 +0200Show information about OOM killer in CIInclude OOM kill event logs into error printout. Previously these would only be visible by inspecting the postgres log and looking for killed by signal 9.
570e33bd89727cd058d09d353c2595965da613b97aeMarkos Fountoulakis<markos@timescale.com>Tue Oct 11 13:43:02 2022 +0300Adjust TAP tests permissionsStarting with PG15, default permissions on the public schema is restricted for any non-superuser non-owner. Adjust TAP tests so as to not fail with "permission denied for schema public". https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=b073c3cc
571cc7ea8efd10ba5ade6cbf0e9af988ade06d24011Sven Klemm<sven@timescale.com>Mon Oct 10 23:35:23 2022 +0200Fix ereport call in dist_copy for PG 12.0ereport in PG 12.0 requires extra parenthesis around the auxiliary function calls.
572459c365794fd63c7708067e37b38a0a6769bcea6Alexander Kuzmenkov<akuzmenkov@timescale.com>Mon Oct 10 17:34:59 2022 +0300Ignore clang-format-14 changes in git blame
573fbe4d3c1df1d82dca4e21bd09292ddaa7d3368d8Alexander Kuzmenkov<akuzmenkov@timescale.com>Mon Oct 10 14:20:44 2022 +0300Fix a warning with clang 14Mark the variable as used for asserts only.
5747758f5959c8ed64499ab0e6bb66c30464b11dd81Alexander Kuzmenkov<akuzmenkov@timescale.com>Tue Oct 4 12:14:37 2022 +0300Update .clang-format for version 14The only configuration we're missing is the newline for braces after case labels. The rest of the differences looks like bugs/omissions of the version 8 that we use now. Require clang-format-14 in cmake and use it in the CI check. We can't support versions earlier than 14 because they have some formatting differences that can't be configured.
57530596c0c478a168344a550b35ca480c5ad5a4a9fAlexander Kuzmenkov<akuzmenkov@timescale.com>Mon Oct 10 14:36:04 2022 +0300Batch rows on access node for distributed COPYGroup the incoming rows into batches on access node before COPYing to data nodes. This gives 2x-5x speedup on various COPY queries to distributed hypertables. Also fix the text format passthrough, and prefer text transfer format for text input to be able to use this passthrough. It saves a lot of CPU on the access node.
5767600896a66e55fd933e81433f1aceecc7ddfc1c6Markos Fountoulakis<markos@timescale.com>Thu Oct 6 16:25:34 2022 +0300Fix libpq disconnect for PG15Make sure the FATAL error message before the data node disconnects is not lost when using PG15. https://github.com/postgres/postgres/commit/618c1670
5772defb2b0b374b150dc1e678c03f621fb2f59ecf8Sven Klemm<sven@timescale.com>Sat Oct 8 16:55:42 2022 +0200Improve job_crash_log testOlder versions seens to have problems when undef is passed to poll_query_until so we change the call to pass explicit query instead.
578efbd8a94b2bcf54e0772dc533949555bd98eaeb7Sven Klemm<sven@timescale.com>Sat Oct 8 22:39:49 2022 +0200Increase timeout to wait for cluster startBy default pg_isready only waits for 3 seconds before giving up which is occasionally not enough in the windows tests. This patch bumps the timeout up to 30 seconds which should be plenty to have the cluster start up under all circumstances.
579e0bbd4042acf1bdcfdcc4cac54c3c3e5bcbdd8e4Fabrízio de Royes Mello<fabriziomello@gmail.com>Thu Sep 22 18:29:36 2022 -0300Fix missing upgrade/downgrade tests DDL validationRecently we fixed a DDL error (#4739) after upgrading to 2.8.0 version that surprisly the CI upgrade/dowgrade tests didn't complained during the development of the feature (#4552). Fixed it by adding an specific query in the `post.catalog.sql` script to make sure we'll check all the constraints of our internal tables and catalog.
5802f739bb3286bca4db6fda9e71ba6e74c7f22ecffJan Nidzwetzki<jan@timescale.com>Wed Oct 5 14:49:12 2022 +0200Post-release fixes for 2.8.1Bumping the previous version and adding tests for 2.8.1.
581ea1014fa61dff6ae9bfb3e8acde08f72e85fc00fKonstantina Skovola<konstantina@timescale.com>Thu Oct 6 15:55:12 2022 +0200Fix flaky bgw_custom test
58245a8c0b5cf60ba8dbbb1c0236a51b6afa96517beSven Klemm<sven@timescale.com>Wed Oct 5 23:02:15 2022 +0200Improve formatting when printing coredump informationAdd a newline between query and stacktrace when printing coredump information to make copying the query easier.
583d602c1fe2eb50cdf3684fd7454d231f6ad83c3acSven Klemm<sven@timescale.com>Wed Oct 5 23:01:27 2022 +0200Fix typo in homebrew workflow
584d2f0c4ed202fbf0b6cd3161197ad032fed70ace3Sven Klemm<sven@timescale.com>Tue Oct 4 14:14:31 2022 +0200Fix update script handling of bgw_job_statUpdate scripts should not use ADD/DROP/RENAME and always rebuild catalog tables to ensure the objects are identical between new install, upgrade and downgrade.
585a76f76f4ee6ee1d5437fe31cbd551e0d6f51393fFabrízio de Royes Mello<fabriziomello@gmail.com>Tue Oct 4 14:20:23 2022 -0300Improve size utils functions and views performanceChanged queries to use LATERAL join on size functions and views instead of CTEs and it eliminate a lot of unnecessary projections and give a chance for the planner to push-down predicates. Closes #4775
5868cda0e17ec89452f1d536f8b1d66f939c891ea4eSven Klemm<sven@timescale.com>Sat Oct 1 21:19:28 2022 +0200Extend the now() optimization to also apply to CURRENT_TIMESTAMPThe optimization that constifies certain now() expressions before hypertable expansion did not apply to CURRENT_TIMESTAMP even though it is functionally similar to now(). This patch extends the optimization to CURRENT_TIMESTAMP.
58712b7b9f665865fde19c0a6460006147a3e545095Jan Nidzwetzki<jan@timescale.com>Thu Sep 29 14:50:15 2022 +0200Release 2.8.1This release is a patch release. We recommend that you upgrade at the next available opportunity. **Bugfixes** * #4454 Keep locks after reading job status * #4658 Fix error when querying a compressed hypertable with compress_segmentby on an enum column * #4671 Fix a possible error while flushing the COPY data * #4675 Fix bad TupleTableSlot drop * #4676 Fix a deadlock when decompressing chunks and performing SELECTs * #4685 Fix chunk exclusion for space partitions in SELECT FOR UPDATE queries * #4694 Change parameter names of cagg_migrate procedure * #4698 Do not use row-by-row fetcher for parameterized plans * #4711 Remove support for procedures as custom checks * #4712 Fix assertion failure in constify_now * #4713 Fix Continuous Aggregate migration policies * #4720 Fix chunk exclusion for prepared statements and dst changes * #4726 Fix gapfill function signature * #4737 Fix join on time column of compressed chunk * #4738 Fix error when waiting for remote COPY to finish * #4739 Fix continuous aggregate migrate check constraint * #4760 Fix segfault when INNER JOINing hypertables * #4767 Fix permission issues on index creation for CAggs **Thanks** * @boxhock and @cocowalla for reporting a segfault when JOINing hypertables * @carobme for reporting constraint error during continuous aggregate migration * @choisnetm, @dustinsorensen, @jayadevanm and @joeyberkovitz for reporting a problem with JOINs on compressed hypertables * @daniel-k for reporting a background worker crash * @justinpryzby for reporting an error when compressing very wide tables * @maxtwardowski for reporting problems with chunk exclusion and space partitions * @yuezhihan for reporting GROUP BY error when having compress_segmentby on an enum column
588b259191dfe27bc13cb33dbc2bd327cf825ded400Alexander Kuzmenkov<akuzmenkov@timescale.com>Mon Oct 3 19:36:20 2022 +0300Add COSTS OFF to make test more stableFor some reason the cost estimates are different on my machine.
5898a5e59b0978209d5913cdffcb6c5f69487ac1273Konstantina Skovola<konstantina@timescale.com>Wed Oct 5 09:01:32 2022 +0200Fix flaky bgw_custom testThe test was flaky because the scheduler was launching the scheduled jobs, therefore their next_start field could differ depending on whether they had finished executing. Fixed by not selecting the next_start field in alter_job calls, when it is not of interest. Fixes #4719
59033e4e554d4a18284bb2b1f79398aa9bb5ff0cc88Jan Nidzwetzki<jan@timescale.com>Tue Oct 4 16:57:04 2022 +0200Ensure that internal users don't trigger workflowsThis patch adds a membership check to the 'Waiting for Engineering' workflow. The check ensures that the workflow is only triggered by external users. Without this check, when someone from the database engineering team responded to an issue, the "need-more-info" flag was removed and the issue was erroneously moved to the "waiting for engineering" column.
591f1c6fd97a3ca38aecae518efc2b2cda649dc745dBharathy<satish.8483@gmail.com>Tue Oct 4 20:20:23 2022 +0530Continue compressing other chunks after an errorWhen a compression_policy is executed by a background worker, the policy should continue to execute even if compressing or decompressing one of the chunks fails. Fixes: #4610
592ea5038f26387c47b6dba538f521f99cea3430870Dmitry Simonenko<dmitry@timescale.com>Tue Oct 4 10:06:06 2022 +0300Add connection cache invalidation ignore logicCalling `ts_dist_cmd_invoke_on_data_nodes_using_search_path()` function without an active transaction allows connection invalidation event happen between applying `search_path` and the actual command execution, which leads to an error. This change introduces a way to ignore connection cache invalidations using `remote_connection_cache_invalidation_ignore()` function. This work is based on @nikkhils original fix and the problem research. Fix #4022
593fa9d07f6a81f3f5109718c0232cdee60367278dcSven Klemm<sven@timescale.com>Fri Sep 30 10:05:19 2022 +0200Add link to community forum to issue template chooser
594eac3132b67f8ef2f377ff7e58c40ce144a2d847eSven Klemm<sven@timescale.com>Sat Oct 1 09:17:24 2022 +0200Migrate CI summary slack bot to eng-database
5957a6ce372e7727c43e0e077b31eb51ae75f6457f8Sven Klemm<sven@timescale.com>Sat Oct 1 15:06:55 2022 +0200Adjust pgspot CI checkChange the pgspot check to use downgrade_to_version instead of update_from_version. We use downgrade_to_version instead of update_from_version because when the release PR for a new version has been merged to main but the version is not tagged yet update_from will not exist yet. In all other situations update_from_version and downgrade_to_version should point to the same version.
596f7c769c684d1cafe0b73c405b109f035fde57c61Rafia Sabih<rafia.sabih@gmail.com>Wed Sep 28 15:33:26 2022 +0200Allow manual index creation in CAggsThe materialised hypertable resides in the _timescaledb.internal schema which resulted in permission error at the time of manual index creation by non super user. To solve this, it now switches to timescaledb user before index creation of CAgg. Fixes #4735
5979bd772de250308946b0d7ec6bb71f47ec1ee583aKonstantina Skovola<konstantina@timescale.com>Tue Sep 6 16:25:09 2022 +0300Add interface for troubleshooting job failuresThis commit gives more visibility into job failures by making the information regarding a job runtime error available in an extension table (`job_errors`) that users can directly query. This commit also adds an infromational view on top of the table for convenience. To prevent the `job_errors` table from growing too large, a retention job is also set up with a default retention interval of 1 month. The retention job is registered with a custom check function that requires that a valid "drop_after" interval be provided in the config field of the job.
5981d4b9d6977098e74ad10888c2b44e8faf187458bSven Klemm<sven@timescale.com>Thu Sep 29 08:59:06 2022 +0200Fix join on time column of compressed chunkDo not allow paths that are parameterized on a compressed column to exist when creating paths for a compressed chunk.
599940187936c93b6d78e702ded75d79d914f8fea96Sven Klemm<sven@timescale.com>Tue Sep 27 19:49:42 2022 +0200Fix segfault when INNER JOINing hypertablesThis fixing a segfault when INNER JOINing 2 hypertables that are ordered by time.
600d833293a5244092aa680a2ee293b61a678be0246Sven Klemm<sven@timescale.com>Wed Sep 28 05:08:37 2022 +0200Add missing ORDER BY clause to dist_move_chunk
601cc110a33a2e785e8619f82a72ec48745c75208ebAnte Kresic<ante.kresic@gmail.com>Mon Sep 26 14:53:01 2022 +0200Move ANALYZE after heap scan during compressionDepending on the statistics target, running ANALYZE on a chunk before compression can cause a lot of random IO operations for chunks that are bigger than the number of pages ANALYZE needs to read. By moving that operation after the heap is loaded into memory for sorting, we increase the chance of hitting cache and reducing disk operations necessary to execute compression jobs.
6029c819882f317f5d3d53e0bd040c6e7eac2c4bee2Ante Kresic<ante.kresic@gmail.com>Mon Sep 26 14:35:23 2022 +0200Increase memory usage for compression jobsWhen compressing larger chunks, compression sort tends to use temporary files since memory limits (`work_mem`) are usually pretty small to fit all the data into memory. On the other hand, using `maintenance_work_mem` makes more sense since its generally safer to use a larger value without impacting general resource usage.
603c0e193dd810d11e66d75a987b7b1291e6fe7a9f9Mats Kindahl<mats@timescale.com>Fri Jun 17 13:10:46 2022 +0200Keep locks after reading job statusWhen reading the job status table `bgw_job_stat` and after that updating it, locks where released after the read, allowing a competing session to update the job status and trigger a concurrent update error either in a session doing the update or in the scheduler. Since the scheduler does not recover after aborting with an error, this caused the background worker subsystem to stop and not start new jobs. This commit fixes this by upgrading `RowExclusiveLock` to `ShareRowExclusiveLock` to ensure that not two sessions tries to update the row at the same time, remove an initial speculative lock that are taken when a job status row can be added, and also keeps the lock until the end of the transaction to prevent other sessions to update. Since these updating transactions are short, it should not cause other threads to block long. Fixes #4293
604f6dd55a19161d7d64d224069adbe0ab48c10ea29Bharathy<satish.8483@gmail.com>Tue Sep 27 19:33:15 2022 +0530Hypertable FK reference to partitioned tableConsider a hypertable which has a foreign key constraint on a referenced table, which is a parititioned table. In such case, foreign key constraint is duplicated for each of the partitioned table. When we insert into a hypertable, we end up checking the foreign key constraint multiple times, which obviously leads to foreign key constraint violation. Instead we only check foreign key constraint of the parent table of the partitioned table. Fixes #4684
605244b3e637c2a290a0dfc3262339ce1b190f63c08Mats Kindahl<mats@timescale.com>Mon Sep 26 16:05:46 2022 +0200Move perltidyrc to rootTo allow perltidy to be used from editors and IDEs, the perltidyrc file is moved from `scripts/perltidyrc` to `.perltidyrc`. This will allow editors and IDEs to quickly find the style file in the root of the repository, where `perltidy` normally searches for the style file. The workflow is then updated to use the new location, and the two options `--backup-file-extension` and `--backup-and-modify-in-place` are moved to the workflow file to allow editors and IDEs to use whatever method they find useful to process the file.
6066011c1446e9ddcd7f1c3ac22a3580be5523ea36bAlexander Kuzmenkov<akuzmenkov@timescale.com>Wed Sep 21 16:10:25 2022 +0300Fix error when waiting for remote COPY to finishPass proper flags to WaitLatchOrSocket, and fix the swapped up arguments.
6079d0d159ac10ee7784754437ed0fa26f01de0cccfMarkos Fountoulakis<markos@timescale.com>Tue Sep 20 15:15:47 2022 +0300Port perl tests to support PG15Port the timescaledb perl tests and the corresponding infrastructure to support the new perl namespace introduced in PG15. https://github.com/postgres/postgres/commit/b3b4d8e6
608893faf8a6b096f98a01435d36cf88f385a827b4cFabrízio de Royes Mello<fabriziomello@gmail.com>Thu Sep 15 16:37:06 2022 -0300Fix Continuous Aggregate migration policiesAfter migrate a Continuous Aggregate from the old format to the new using `cagg_migrate` procedure we end up with the following problems: * Refresh policy is not copied from the OLD to the NEW cagg; * Compression setting is not copied from the OLD to the NEW cagg. Fixed it by properly copying the refresh policy and setting the `timescaledb.compress=true` flag to the new CAGG. Fix #4710
6092529ae3f68504b6375b159f36c9c51a7d708d6e7Sven Klemm<sven@timescale.com>Fri Sep 16 23:12:47 2022 +0200Fix chunk exclusion for prepared statements and dst changesThe constify code constifying TIMESTAMPTZ expressions when doing chunk exclusion did not account for daylight saving time switches leading to different calculation outcomes when timezone changes. This patch adds a 4 hour safety buffer to any such calculations.
610217f514657bcf008a9973b9fbffb6cd414b5d98dFabrízio de Royes Mello<fabriziomello@gmail.com>Wed Sep 21 10:15:32 2022 -0300Fix continuous aggregate migrate check constraintInstances upgraded to 2.8.0 will end up with a wrong check constraint in catalog table `continuous_aggregate_migrate_plan_step`. Fixed it by removing and adding the constraint with the correct checks. Fix #4727
6114cb38350c67a2e60c8725934b402b53c812c22eeJan Nidzwetzki<jan@timescale.com>Thu Sep 22 13:29:52 2022 +0200Change project management GH actionIn af8e3c6b12035dd45bc7bf61e9420489cfa56eaa, an GitHub action to assign issues to a project column has been introduced. However, this action does not work with organization-wide projects. This patch replaces the used project management action with a more recent one.
612de30d190e47c2874d27f3a5406efc5654fb1c3fcJan Nidzwetzki<jan@timescale.com>Tue Sep 6 16:24:20 2022 +0200Fix a deadlock in chunk decompression and SELECTsThis patch fixes a deadlock between chunk decompression and SELECT queries executed in parallel. The change in a608d7db614c930213dee8d6a5e9d26a0259da61 requests an AccessExclusiveLock for the decompressed chunk instead of the compressed chunk, resulting in deadlocks. In addition, an isolation test has been added to test that SELECT queries on a chunk that is currently decompressed can be executed. Fixes #4605
6135600fc06d65eb366cb304b8723eb1e953501c0fdJan Nidzwetzki<jan@timescale.com>Wed Sep 21 10:29:22 2022 +0200Updated the text of the stalebotThis PR improves the text of the stalebot and makes it clearer who is addressed by the message.
6147508d6663967816633beeeba55696d8c33e106c0Sven Klemm<sven@timescale.com>Mon Sep 19 17:57:32 2022 +0200Fix gapfill function signatureVery recent compilers will warn about function pointers with empty argument list. While currently in C func() means a function with an unspecified argument list the next version of the C standard will change this to mean func(void).
615db66a194b28aca11850aef5c50f837fa47f21d43Jan Nidzwetzki<jan@timescale.com>Tue Sep 20 13:53:07 2022 +0200Fix an ereport syntax error when using PG 12.0Since PG 12.3, the syntax of the ereport() function has changed slightly. The change 97a603fe5c5ba25aa6e4e596fd7da7a401051d7b introduces an ereport() call that only works using newer PG versions. This PR changes the ereport() call to a PG 12.0 compatible syntax.
616b451f0c521ee5e8c3f06c633cc455f0b4b111bd8Jan Nidzwetzki<jan@timescale.com>Mon Sep 19 14:01:39 2022 +0200Update the name of the automation tokenWe now have an organization-wide token for automation. This patch changes the name in existing Github actions accordingly.
617a4d9c9fd6995f00b24edacde1eb6248aa35d9b08Jan Nidzwetzki<jan@timescale.com>Mon Sep 19 09:34:56 2022 +0200Fix CI coredump information printThe patch #4714 introduces the extraction of the running query from a coredump by calling gdb with two commands. These commands are separated by a newline character. This character may not always be correctly converted to a new line before being processed by gdb, resulting in the following error: Invalid character '\' in expression. This PR ensures the proper handling of the newline character.
618af8e3c6b12035dd45bc7bf61e9420489cfa56eaaMats Kindahl<mats@timescale.com>Wed Sep 14 14:02:15 2022 +0200Update procedural.ymlFix the 'Waiting for Engineering' job. Issues that contain the label 'need-more-info' that receive an issue_comment are automatically moved to the 'Waiting for Engineering' column on the bug board and the 'need-more-info' is removed.
61997a603fe5c5ba25aa6e4e596fd7da7a401051d7bKonstantina Skovola<konstantina@timescale.com>Thu Sep 15 15:57:28 2022 +0300Remove support for procedures as custom checksProcedures doing their own transaction handling could lead to errors or even crashes. Fixes #4703
620042735f1f5d9b253e479075866d8b9cc24eaaa60Markos Fountoulakis<markos@timescale.com>Fri Sep 16 12:33:21 2022 +0300Fix vacuum_set_xid_limits_compat() macroFix an error in the PG15 portion of the vacuum_set_xid_limits_compat() preprocessor macro.
621d00a55772cd1762e295673a3d8f5ee0b58f9b964Bharathy<satish.8483@gmail.com>Sat Sep 17 07:39:04 2022 +0530error compressing wide tableConsider a compressed hypertable has many columns (like more than 600 columns). In call to compress_chunk(), the compressed tuple size exceeds, 8K which causes error as "row is too big: size 10856, maximum size 8160." This patch estimates the tuple size of compressed hypertable and reports a warning when compression is enabled on hypertable. Thus user gets aware of this warning before calling compress_chunk(). Fixes #4398
622ffd9dfb7ebd05e2bc8d619ac87b4d5937dae0f23Sven Klemm<sven@timescale.com>Thu Sep 15 20:54:05 2022 +0200Fix assertion failure in constify_nowThe code added to support VIEWs did not account for the fact that varno could be from a different nesting level and therefore not be present in the current range table.
62385d0e16a982ab3110b39b0c713faa421dd82fd81Sven Klemm<sven@timescale.com>Fri Sep 16 13:02:29 2022 +0200Fix flaky pg_dump testUse DROP DATABASE WITH(FORCE) to drop the database in pg_dump test since occasionally there would still be connections to the database leading to test failures. Unfortunately PG12 does not support that syntax so we have to drop without that option on PG12.
6241cb3edddc1cc6057cf5cce74fbb24cfd4db1e215Sven Klemm<sven@timescale.com>Fri Sep 16 11:24:35 2022 +0200Fix bgw_db_scheduler regresscheck configurationRecent refactoring changed bgw_db_scheduler to also be run on non-Debug builds. Adjust the configuration so it is only included for debug builds.
6253e1ce8c34aae49b5e6dc5188a154f1986e56fe13Sven Klemm<sven@timescale.com>Thu Sep 15 22:18:22 2022 +0200Include running query in CI coredump informationPretty print the active query during a coredump when printing the stacktrace for a coredump.
6267aadf1332fb21e8b61ff6a996e7c1d08c913cee9Nikhil Sontakke<nikhil@timescale.com>Mon Sep 5 18:17:14 2022 +0530Fix some clang compile warningsLocal compilation of timescaledb fails on MaCOSx with clang version 11.0.0. Fixes for a couple of warnings.
627fee27484cec7a01c2a98c16133e364f089689181Alexander Kuzmenkov<akuzmenkov@timescale.com>Thu Sep 15 20:13:15 2022 +0300Do not use row-by-row fetcher for parameterized plansWe have to prepare the data node statement in this case, and COPY queries don't work with prepared statements.
628424f6f7648e88907b9373ef44ec851787db21080Sven Klemm<sven@timescale.com>Mon Sep 12 08:50:04 2022 +0200Remove database port from test outputDon't include the used database ports into test output as this will lead to failing tests when running against a local instance or against a preconfigured cloud instance.
6291642750e47aaa953015f050f9f850d3f2b41b550Sven Klemm<sven@timescale.com>Tue Sep 13 12:38:21 2022 +0200Remove multiple PG configurations from regresscheck-tUsing multiple different configurations in a single target will not work when running against a local instance or when running against a preconfigured cloud instance. With recent adjustments to the test cleanup this should not be needed anymore and if we really need different configuration we should make it a separate target to make it compatible with instances configured outside of pg_regress.
630cea1a21c01d76f0e421fcfd86e2ae116f92e1943Sven Klemm<sven@timescale.com>Tue Sep 13 20:42:23 2022 +0200Improve SKIPS handling in regression testsThis patch changes the regression test schedule generation to only completely rebuild the schedule when TESTS is specified. In all other cases the existing schedule is amended. This means any parallelity present in the cmake generated schedule will be kept.
631063bfcfef912ad74ec86d8e9d0c0f15fff73b87dSven Klemm<sven@timescale.com>Tue Sep 13 23:05:30 2022 +0200Fix pgspot update script checkPreviously the pgspot call used in CI did not properly check the update script. Unsafe function creations for functions with changed signatures could go undetected in the update script.
6323b3681858d0a29676098212acabb37ea4549e82aKonstantina Skovola<konstantina@timescale.com>Mon Sep 12 14:44:38 2022 +0300Remove test case causing bgw_custom crashPatch #4425 introduced regression test failures, namely, a crash in function `ts_bgw_job_update_by_id`. The failures are due to the COMMIT statement in the custom check procedure. This patch removes that particular test case from bgw_custom.
6330144c75b3f1b932bac4cf28b432c7fb179307b6fSven Klemm<sven@timescale.com>Tue Sep 13 22:24:32 2022 +0200Remove flaky test from bgw_db_schedulerThe out of background worker test in bgw_db_scheduler is flaky and fails very often, especially in the 32bit environment and on windows. This patch removes that specific test from bgw_db_scheduler. If we want to test this specific part of the scheduler this should be better rewritten in an isolation test.
63488e2f24ea3e09f4c39256d27b558d997d0367738Mats Kindahl<mats@timescale.com>Mon Sep 12 13:04:51 2022 +0200Add automation for waiting on authorIf an issue is labeled with `needs-more-info` it is automatically considered as waiting for author and we should move it to the column for that.
63502ad4f6b763a52a206fab9e231ab023d62360e60Fabrízio de Royes Mello<fabriziomello@gmail.com>Mon Sep 12 16:26:55 2022 -0300Change parameter names of cagg_migrate procedureRemoved the underline character prefix '_' from the parameter names of the procedure `cagg_migrate`. The new signature is: cagg_migrate( IN cagg regclass, IN override boolean DEFAULT false, IN drop_old boolean DEFAULT false )
6366ecefff93ec2991505af56442b751c6c2925e303Fabrízio de Royes Mello<fabriziomello@gmail.com>Fri Sep 9 14:26:01 2022 -0300Add CAGG migration permission testsTimescale 2.8 released a migration path from the old format of Continuous Aggregate to the new format (#4552). Unfortunately it lacks of proper tests when a non-superuser execute the migration. For a non-superuser execute the migration properly it requires SELECT/INSERT/UPDATE permissions in some catalog objects: * _timescaledb_catalog.continuous_agg_migrate_plan * _timescaledb_catalog.continuous_agg_migrate_plan_step * _timescaledb_catalog.continuous_agg_migrate_plan_step_step_id_seq Improved the regression tests to cover the lack of permissions in the catalog objects for non-superusers.
637d2baef3ef361b4fa0d54fcbfd8e0b49cb4fa1975Sven Klemm<sven@timescale.com>Mon Sep 5 23:29:28 2022 +0200Fix planner chunk exclusion for VIEWsAllow planner chunk exclusion in subqueries. When we decicde on whether a query may benefit from constifying now and encounter a subquery peek into the subquery and check if the constraint references a hypertable partitioning column. Fixes #4524
638b869f91e256df56461021dfe836c69a4c45836e3Bharathy<satish.8483@gmail.com>Mon Sep 12 17:25:58 2022 +0530Show warnings during create_hypertable().The schema of base table on which hypertables are created, should define columns with proper data types. As per postgres best practices Wiki (https://wiki.postgresql.org/wiki/Don't_Do_This), one should not define columns with CHAR, VARCHAR, VARCHAR(N), instead use TEXT data type. Similarly instead of using timestamp, one should use timestamptz. This patch reports a WARNING to end user when creating hypertables, if underlying parent table, has columns of above mentioned data types. Fixes #4335
6394e47302c2c2a923c8ed30e34d3486a942767059bAlexander Kuzmenkov<akuzmenkov@timescale.com>Fri Sep 9 18:45:06 2022 +0300Speed up chunk search by restriction clausesWe don't have to look up the dimension slices for dimensions for which we don't have restrictions. Also sort chunks by ids before looking up the metadata, because this gives more favorable table access patterns (closer to sequential). This fixes a planning time regression introduced in 2.7.
640a26a5974dce08e1146bc7aa35eac7e1f6f1716e2Sven Klemm<sven@timescale.com>Sat Sep 10 10:20:08 2022 +0200Improve space constraint exclusion datatype handlingThis patch adjusts the operator logic for valid space dimension constraints to no longer look for an exact match on both sides of the operator but instead allow mismatched datatypes. Previously a constraint like `col = value` would require `col` and `value` to have matching datatype with this change `col` and `value` can be different datatype as long as they have equality operator in btree family. Mismatching datatype can happen commonly when using int8 columns and comparing them with integer literals. Integer literals default to int4 so the datatypes would not match unless special care has been taken in writing the constraints and therefore the optimization would never apply in those cases.
641f27e62734141ed7fca30401f22a5ad1ead86b9e2Sven Klemm<sven@timescale.com>Fri Sep 9 13:57:16 2022 +0200Fix chunk exclusion for space partitions in SELECT FOR UPDATE queriesSince we do not use our own hypertable expansion for SELECT FOR UPDATE queries we need to make sure to add the extra information necessary to get hashed space partitions with the native postgres inheritance expansion working.
6426de979518d286a83783f68172fbf1623f8873e26Sven Klemm<sven@timescale.com>Thu Sep 8 18:10:10 2022 +0200Fix compression_chunk_size primary keyThe primary key for compression_chunk_size was defined as chunk_id, compressed_chunk_id but other places assumed chunk_id is actually unique and would error when it was not. Since it makes no sense to have multiple entries per chunk since that reference would be to a no longer existing chunk the primary key is changed to chunk_id only with this patch.
6438e4dcddad62ac9f70933a8d61ab02c9c687e0c4eAlexander Kuzmenkov<akuzmenkov@timescale.com>Thu Sep 8 12:18:06 2022 +0300Make the copy_memory_usage test less flakyIncrease the failure threshold.
644d65cad94e3dadd8ec4423575940061c8daada550Sven Klemm<sven@timescale.com>Mon Sep 5 13:22:51 2022 +0200Reorganize gapfill header filesCombine gapfill header files to only have gapfill.h and gapfill_internal.h and make C files globally unique.
645b34b91f18bcaf3d6d997a6053e0e23dc44108fc3Sven Klemm<sven@timescale.com>Mon Sep 5 10:49:10 2022 +0200Add timezone support to time_bucket_gapfillThis patch adds a new time_bucket_gapfill function that allows bucketing in a specific timezone. You can gapfill with explicit timezone like so: `SELECT time_bucket_gapfill('1 day', time, 'Europe/Berlin') ...` Unfortunately this introduces an ambiguity with some previous call variations when an untyped start/finish argument was passed to the function. Some queries might need to be adjusted and either explicitly name the positional argument or resolve the type ambiguity by casting to the intended type.
646698084c0e1b5e2f6079db355367270f9f4f96a34Markos Fountoulakis<markos@timescale.com>Tue Sep 6 15:53:00 2022 +0300Fix bad TupleTableSlot dropPostgreSQL 15 exposed a use after free bug that went undetected in previous versions.
647533a138ae22ddabf8a576d23dcb8f88a842fb6e5Alexander Kuzmenkov<akuzmenkov@timescale.com>Mon Sep 5 13:51:42 2022 +0300Fix a possible error while flushing the COPY dataApparently, pqFlush can report a success status, but the underlying socket can become invalid at the same time. Check for this. In passing, also change to the proper error reporting functions that use the connection error information, where needed.
6480d5049cf15275b159890e1ee4d435a94e59f9f4aKonstantina Skovola<konstantina@timescale.com>Mon Sep 5 09:36:30 2022 +0200Fix max backoff on MAX_CONSECUTIVE_FAILURES
64983eb635e53ea1332b96f402141c1b3f7e3e9fab2Mats Kindahl<mats@timescale.com>Fri Sep 2 10:46:32 2022 +0200Fix coverity warning about potential overflowThere is a potential overflow in shifting in the code. The shift count should be less than 20, so this should be safe, but adding a cast to ensure that types match later usage and also extending the assert to capture bugs.
650fe8d823bef3561d3db8b56f2cefb7d4dd9de0be8Sven Klemm<sven@timescale.com>Tue Jul 12 12:44:59 2022 +0200Add compat macros for PG15 signature changesPG15 refactors INSERT/UPDATE/DELETE code and changes the signatures of some of the functions. https://github.com/postgres/postgres/commit/25e777cf
6519eef2e70f27366602f4da9ae89e44eeccba7bd08Sven Klemm<sven@timescale.com>Thu Sep 1 11:08:17 2022 +0200Don't error when compression metadata is missingSince the process that adjusts the compressed chunk statistics gets run during VACUUM we do not want to throw any errors in that process to let the VACUUM succeed.
6520d7da62251cff811ea531c3d54522ed6f3021e06Sven Klemm<sven@timescale.com>Tue Jul 12 12:15:51 2022 +0200Adjust reorder code for PG15PG15 removes "recheck" argument from check_index_is_clusterable and consolidate VACUUM xid cutoff logic. https://github.com/postgres/postgres/commit/b940918d https://github.com/postgres/postgres/commit/efa4a946
6535c8b0b52b4dfadb8d8ab4c5c5d42c2f75a24728cSven Klemm<sven@timescale.com>Thu Sep 1 12:00:39 2022 +0200Adjust ts_get_node_name for PG15PG15 removes T_Expr nodeTag because it's an abstract type. https://github.com/postgres/postgres/commit/85399291
65439a700a4de4090a76268181faca19ea3d689e9eaSven Klemm<sven@timescale.com>Thu Sep 1 17:35:34 2022 +0200Fix changelog entries added in wrong placeCommit ed212b44 added the changelog entries to the bottom of the changelog instead of the top.
6553722b0bf23e3f10c8c053a1fd21dd01ebbcc1012Sven Klemm<sven@timescale.com>Wed Aug 31 21:55:12 2022 +0200Add 2.8.0 to update testsAdd 2.8.0 to update tests and adjust the downgrade script files.
656fca9078d6c7592d2df6e0e40428688401aa47110Konstantina Skovola<konstantina@timescale.com>Wed Aug 31 19:52:53 2022 +0300Exponentially backoff when out of background workersThe scheduler detects the following three types of job failures: 1.Jobs that fail to launch (due to shortage of background workers) 2.Jobs that throw a runtime error 3.Jobs that crash due to a process crashing In cases 2 and 3, additive backoff is applied in calculating the next start time of a failed job. In case 1 we previously retried to launch all jobs that failed to launch simultaneously. This commit introduces exponential backoff in case 1, randomly selecting a wait time in [2, 2 + 2^f] seconds at microsecond granularity. The aim is to reduce the collision probability for jobs that compete for a background worker. The maximum backoff value is 1 minute. It does not change the behavior for cases 2 and 3. Fixes #4562
657ed212b4442ca112d281dc5331e4dc8e677e6fae9Bharathy<satish.8483@gmail.com>Mon Aug 29 10:01:56 2022 +0530GROUP BY error when setting compress_segmentby with an enum columnWhen using a custom ENUM data type for compressed hypertable on the GROUP BY clause raises an error. Fixed it by generating scan paths for the query by checking if the SEGMENT BY column is a custom ENUM type and then report a valid error message. Fixes #3481
6581d4f90b1d31e7603f00d78d03e1992195e74865bSven Klemm<sven@timescale.com>Wed Aug 31 17:28:18 2022 +0200Pass PlannerInfo by reference to can_exclude_constraints_using_clausesPlannerInfo is 608 bytes and should be passed by reference and not by value. Found by coverity.
65921673f2df2703bc7d7d8012c31ea593940c3a4fdSven Klemm<sven@timescale.com>Wed Aug 31 17:08:27 2022 +0200Fix copy-paste error in ts_bgw_job_insert_relationFound by coverity.
660f432d7f93169a5c806f5c9da628513c69ca8eed2Sven Klemm<sven@timescale.com>Thu Aug 25 18:32:34 2022 +0200Release 2.8.0This release adds major new features since the 2.7.2 release. We deem it moderate priority for upgrading. This release includes these noteworthy features: * time_bucket now supports bucketing by month, year and timezone * Improve performance of bulk SELECT and COPY for distributed hypertables * 1 step CAgg policy management * Migrate Continuous Aggregates to the new format **Features** * #4188 Use COPY protocol in row-by-row fetcher * #4307 Mark partialize_agg as parallel safe * #4380 Enable chunk exclusion for space dimensions in UPDATE/DELETE * #4384 Add schedule_interval to policies * #4390 Faster lookup of chunks by point * #4393 Support intervals with day component when constifying now() * #4397 Support intervals with month component when constifying now() * #4405 Support ON CONFLICT ON CONSTRAINT for hypertables * #4412 Add telemetry about replication * #4415 Drop remote data when detaching data node * #4416 Handle TRUNCATE TABLE on chunks * #4425 Add parameter check_config to alter_job * #4430 Create index on Continuous Aggregates * #4439 Allow ORDER BY on continuous aggregates * #4443 Add stateful partition mappings * #4484 Use non-blocking data node connections for COPY * #4495 Support add_dimension() with existing data * #4502 Add chunks to baserel cache on chunk exclusion * #4545 Add hypertable distributed argument and defaults * #4552 Migrate Continuous Aggregates to the new format * #4556 Add runtime exclusion for hypertables * #4561 Change get_git_commit to return full commit hash * #4563 1 step CAgg policy management * #4641 Allow bucketing by month, year, century in time_bucket and time_bucket_gapfill * #4642 Add timezone support to time_bucket **Bugfixes** * #4359 Create composite index on segmentby columns * #4374 Remove constified now() constraints from plan * #4416 Handle TRUNCATE TABLE on chunks * #4478 Synchronize chunk cache sizes * #4486 Adding boolean column with default value doesn't work on compressed table * #4512 Fix unaligned pointer access * #4519 Throw better error message on incompatible row fetcher settings * #4549 Fix dump_meta_data for windows * #4553 Fix timescaledb_post_restore GUC handling * #4573 Load TSL library on compressed_data_out call * #4575 Fix use of `get_partition_hash` and `get_partition_for_key` inside an IMMUTABLE function * #4577 Fix segfaults in compression code with corrupt data * #4580 Handle default privileges on CAggs properly * #4582 Fix assertion in GRANT .. ON ALL TABLES IN SCHEMA * #4583 Fix partitioning functions * #4589 Fix rename for distributed hypertable * #4601 Reset compression sequence when group resets * #4611 Fix a potential OOM when loading large data sets into a hypertable * #4624 Fix heap buffer overflow * #4627 Fix telemetry initialization * #4631 Ensure TSL library is loaded on database upgrades * #4646 Fix time_bucket_ng origin handling * #4647 Fix the error "SubPlan found with no parent plan" that occurred if using joins in RETURNING clause. **Thanks** * @AlmiS for reporting error on `get_partition_hash` executed inside an IMMUTABLE function * @Creatation for reporting an issue with renaming hypertables * @janko for reporting an issue when adding bool column with default value to compressed hypertable * @jayadevanm for reporting error of TRUNCATE TABLE on compressed chunk * @michaelkitson for reporting permission errors using default privileges on Continuous Aggregates * @mwahlhuetter for reporting error in joins in RETURNING clause * @ninjaltd and @mrksngl for reporting a potential OOM when loading large data sets into a hypertable * @PBudmark for reporting an issue with dump_meta_data.sql on Windows * @ssmoss for reporting an issue with time_bucket_ng origin handling
661ae6773fca6f285a3f0f56cda27bff1d08d8af596Alexander Kuzmenkov<akuzmenkov@timescale.com>Tue Aug 23 18:30:20 2022 +0300Fix joins in RETURNINGTo make it work, it is enough to properly pass the parent of the PlanState while initializing the projection in RETURNING clause.
6621fa8373931aeb98d175ac7988f1705b4a1c647d0Sven Klemm<sven@timescale.com>Sun Aug 28 19:18:16 2022 +0200Fix segfaults in policy check functions
663c697700addbe50027ca744c5aabca4181c89c0e3Dmitry Simonenko<dmitry@timescale.com>Mon Aug 29 16:55:18 2022 +0300Add hypertable distributed argument and defaultsThis PR introduces a new `distributed` argument to the create_hypertable() function as well as two new GUC's to control its default behaviour: timescaledb.hypertable_distributed_default and timescaledb.hypertable_replication_factor_default. The main idea of this change is to allow automatic creation of the distributed hypertables by default.
664e34218ce2963358a500f6bc315aace0fad29c450Fabrízio de Royes Mello<fabriziomello@gmail.com>Tue Jul 5 13:39:14 2022 +0200Migrate Continuous Aggregates to the new formatTimescale 2.7 released a new version of Continuous Aggregate (#4269) that store the final aggregation state instead of the byte array of the partial aggregate state, offering multiple opportunities of optimizations as well a more compact form. When upgrading to Timescale 2.7, new created Continuous Aggregates are using the new format, but existing Continuous Aggregates keep using the format they were defined with. Created a procedure to upgrade existing Continuous Aggregates from the old format to the new format, by calling a simple procedure: test=# CALL cagg_migrate('conditions_summary_daily'); Closes #4424
665c43307387e6e96765a98deca041b47f57e3c3928Matvey Arye<mat@timescale.com>Fri Jul 29 15:08:53 2022 -0400Add runtime exclusion for hypertablesIn some cases, entire hypertables can be excluded at runtime. Some Examples: WHERE col @> ANY(subselect) if the subselect returns empty set WHERE col op (subselect) if the op is a strict operator and the subselect returns empty set. When qual clauses are not on partition columns, we use the old chunk exclusion, otherwise we try hypertable exclusion. Hypertable exclusion is executed once per hypertable. This is cheaper than the chunk exclusion that is once-per-chunk.
666706a3c0e50777819c6a1caea5f29e9fa8354b34dAlexander Kuzmenkov<akuzmenkov@timescale.com>Wed Aug 24 17:14:15 2022 +0300Enable statement logging in the testsRemove 'client_min_messages = LOG' where not needed, and add the 'LOG: statement' output otherwise.
6675d934baf1de8b7eace6384128f0942d4798d3798Sven Klemm<sven@timescale.com>Mon Aug 22 08:16:14 2022 +0200Add timezone support to time_bucketThis patch adds a new function time_bucket(period,timestamp,timezone) which supports bucketing for arbitrary timezones.
668dc145b7485171f7d38ba563efecd0c311a00bdd2Konstantina Skovola<konstantina@timescale.com>Tue Jun 28 16:19:32 2022 +0300Add parameter check_config to alter_jobPreviously users had no way to update the check function registered with add_job. This commit adds a parameter check_config to alter_job to allow updating the check function field. Also, previously the signature expected from a check was of the form (job_id, config) and there was no validation that the check function given had the correct signature. This commit removes the job_id as it is not required and also checks that the check function has the correct signature when it is registered with add_job, preventing an error being thrown at job runtime.
669e0f3e17575902b995fb10ffb70a47f4418aa3c00Mats Kindahl<mats@timescale.com>Fri Jun 3 13:39:20 2022 +0300Use new validation functionsOld patch was using old validation functions, but there are already validation functions that both read and validate the policy, so using those. Also removing the old `job_config_check` function since that is no longer use and instead adding a `job_config_check` that calls the checking function with the configuration.
6707c55d0d5dcdd10e87d3479bf3f7ed4b317f6a045gayyappan<gayathri@timescale.com>Thu Aug 18 14:36:15 2022 -0400Modify OSM chunk's constraint info in chunk catalogThe OSM chunk registers a dummy primary dimension range in the TimescaleDB catalog. Use the max interval of the dimension instead of the min interval i.e use range like [Dec 31 294246 PST, infinity). Otherwise, policies can try to apply the policy on an OSM chunk. Add test with policies for OSM chunks
671bc85fb1cf04a05bd5fd32427464aa5d56e7468fcAlexander Kuzmenkov<akuzmenkov@timescale.com>Wed Aug 24 10:30:06 2022 +0300Fix the flaky dist_ddl testAdd an option to hide the data node names from error messages.
672f4ba6e3c8e37a23017c93d1921f8a0a1afa528b3Sven Klemm<sven@timescale.com>Mon Aug 22 07:21:09 2022 +0200Fix time_bucket_ng origin handlingThis patch makes time_bucket_ng work correctly with origin values that are after the timestamp value to be bucketed.
673c3a344dc0c188f44c1b3e0fef3e7d2160404898cMarkos Fountoulakis<markos@timescale.com>Wed Aug 24 11:03:50 2022 +0300Fix Windows Packages workflow
6740786226e43ae80b992fb7c43a4117679cc2ce4ccJan Nidzwetzki<jan@timescale.com>Thu Aug 18 14:41:07 2022 +0200Ensure TSL library is loaded on database upgradesThis patch ensures that the TSL library is loaded when the database is upgraded and post_update_cagg_try_repair is called. There are some situations when the library is not loaded properly (see #4573 and Support-Dev-Collab#468), resulting in the following error message: "[..] is not supported under the current "timescale" license HINT: Upgrade your license to 'timescale'"
67551259b31c4c62b87228b059af0bbf28caa143eb3Alexander Kuzmenkov<akuzmenkov@timescale.com>Tue Aug 23 18:52:15 2022 +0300Fix OOM in large INSERTsDo not allocate various temporary data in PortalContext, such as the hyperspace point corresponding to the row, or the intermediate data required for chunk lookup.
6763acfbd02c13a35f3d66231251b701965ab6c7619Joshua Lockerman<josh@timescale.com>Mon Aug 22 11:56:20 2022 -0400Schema-qualify function telemetryThis commit unconditionally schema-qualifies the function telemetry. In the default setting `format_procedure()` only schema-qualifies things that aren't on the search path. This could cause to much variation across users. Further, it'd be nice to tell if functions in-use are from an experimental schema or a main one.
6771c0bf4b7776d26991fb2aa0322d2dd165bfecef1Sven Klemm<sven@timescale.com>Sun Aug 21 19:09:48 2022 +0200Support bucketing by month in time_bucket_gapfill
678c488fcdbc9931c271361d0e4997a2b60e6eddf19Sven Klemm<sven@timescale.com>Sun Aug 21 18:56:45 2022 +0200Allow bucketing by month, year, century in time_bucketThis patch allows bucketing by month for time_bucket with date, timestamp or timestamptz. When bucketing by month the interval must only contain month components. When using origin together with bucketing by month only the year and month components are honoured. To bucket by month we get the year and month of a date and convert that to the nth month since origin. This allows us to treat month bucketing similar to int bucketing. During this process we ignore the day component and therefore only support bucketing by full months.
67982fc2cac699901749084c96c5f38ebf07e5e428aDmitry Simonenko<dmitry@timescale.com>Mon Aug 22 17:49:57 2022 +0300Fix rename for distributed hypertableFix ALTER TABLE RENAME TO command execution on a distributed hypertable, make sure data node list is set and command is executed on the data nodes. Fix #4491
68090cace417e86d995d7c28356d9ded2dbbf6c035dDmitry Simonenko<dmitry@timescale.com>Mon Aug 22 17:19:43 2022 +0300Load TSL library on compressed_data_out callA call to `compressed_data_out` from a replication worker would produce a misleading error saying that your license is "timescale" and you should upgrade to "timescale" license, even if you have already upgraded. As a workaround, we try to load the TSL module it in this function. It will still error out in the "apache" version as intended. We already had the same fix for `compressed_data_in` function.
681c643173b8b440b1d1fe6170be60907d428953f13gayyappan<gayathri@timescale.com>Thu Aug 18 11:43:55 2022 -0400Filter out osm chunks from chunks information viewModify timescaledb_information.chunks view to filter out osm chunks. We do not want user to invoke chunk specific operations on OSM chunks.
6820ffb7dadedcf2fa7bf83a22cc7196e8db6672336Sven Klemm<sven@timescale.com>Fri Aug 19 08:53:59 2022 +0200Improve windows package testChange the windows package test to use explicit postgres versions and test both minimum and maximum supported postgres minor version.
6833e03afb5ba1cac271d906b75fa3ad5b8e493a886Sven Klemm<sven@timescale.com>Fri Aug 19 11:17:24 2022 +0200Fix ABI testRecent CI settings refactoring made in commit 0c6f4e24 broke the ABI test. This patch fixes the test and adds setting for the minimum ABI compatible version.
684210246135eb66fff5f498f2201da026ab3e9e45fSven Klemm<sven@timescale.com>Fri Aug 19 13:18:50 2022 +0200Make cron test use latest supported PG version
6851f6d69720d1efd53ec42df5fca5e54a85898a5c6Sven Klemm<31455525+svenklemm@users.noreply.github.com>Thu Aug 18 09:20:38 2022 +0200Add link to forum to READMEThis also replaces appveyor badge with link to Windows GitHub actions.
686324201bb7fab6ecd7dc46766368c3ee65ebc7194Sven Klemm<sven@timescale.com>Thu Aug 18 09:14:50 2022 +0200Enable Windows workflow in nightly CI runEnable the Windows CI workflow in nightly runs. In nightly runs the CI run will also test release configuration in addition to the debug configuration run on PRs. This patch also removes the hard coded postgres version numbers from the workflow and reads it from ci settings.
6876beda28965dc980a4555165b3d6a1ee368a2547bgayyappan<gayathri@timescale.com>Thu Aug 4 23:53:30 2022 -0400Modify chunk exclusion to include OSM chunksOSM chunks manage their ranges and the timescale catalog has dummy ranges for these dimensions. So the chunk exclusion logic cannot rely on the timescaledb catalog metadata to exclude an OSM chunk.
688847919a05f014f7ff2d7e6ccd27c316ad8ba64cfgayyappan<gayathri@timescale.com>Wed Aug 3 16:49:29 2022 -0400Add osm_chunk field to chunk catalog tableSetting this field to true indicates that this is an OSM chunk.
6898f920b393a6cfbe45428221af49e16214a4155dfFabrízio de Royes Mello<fabriziomello@gmail.com>Wed Aug 17 18:44:57 2022 -0300Add missing gitignore entryPull request #4416 introduced a new template SQL test file but missed to add the properly gitgnore entry to ignore generated test files.
6904c9e89c80e5dc8576ded919d934e91beb4638bbaSven Klemm<sven@timescale.com>Fri Aug 12 16:15:51 2022 +0200Migrate windows tests to GitHub ActionsThis patch changes our windows test to run in GitHub actios instead of appveyor. This allows us to drop appveyor and have all CI workflows in one place. This also improves our windows testing as appveyor was only running on PG12 and this patch changes the windows tests to run on all supported PG versions. This patch also changes the windows tests to use the same configuration as the other tests. Since our test infrastructure heavily relies on shell scripting the test runner cannot run natively on Windows. We use WSL instead to get a unix environment to execute the test runner.
69130785726168aed99706a56a6327959c5618841edSven Klemm<sven@timescale.com>Mon Aug 15 20:50:46 2022 +0200Fix regresschecklocal-tCommit 05dd4787d1 changed regresscheck to run with multiple configurations but did not make similar adjustments to regresschecklocal-t.
692b5a16c4e0ba21c714c8838ffa22e200ff06886b8Joshua Lockerman<josh@timescale.com>Tue Aug 16 14:56:02 2022 -0400Fix telemetry initializationWe cannot rely on the planner initializing the shared hashmap reference since there's no guarantee we'll actually run SPI code in the BGW before we marshal the request. This commit adds initialization checking to `ts_function_telemetry_read()` itself to ensure it will always read from an initialized state if possible. As this code run very infrequently, it currently checks every time and does not skip if it once saw a lack of entries. This is unlikely to matter. It would be nice to test this more explicitly, but that will likely have to wait until we have better reporting about BGW internals. For now I've relied on manual testing. Look at the telemetry report for the DB with UUID `d412018f-a435-492f-9ab6-b09d480ab1c1` received at timestamp `2022-08-16 18:56:53+00` for an example.
6935c96d25058e26874376f0d5d473469438234c7f1Sven Klemm<sven@timescale.com>Mon Aug 15 17:51:23 2022 +0200Clean up multinode databases in testsNot cleaning up created databases will prevent multiple regresschecklocal runs against the same instance cause it will block recreating the test users as they are still referenced in those databases.
6949c6433e6edf3ba7fa4ea9207220da3e0db8e87e8Markos Fountoulakis<markos@timescale.com>Tue Aug 16 19:10:07 2022 +0300Handle TRUNCATE TABLE on chunksMake truncating a uncompressed chunk drop the data for the case where they reside in a corresponding compressed chunk. Generate invalidations for Continuous Aggregates after TRUNCATE, so as to have consistent refresh operations on the materialization hypertable. Fixes #4362
695fc865de6e0d3890b0e4c8cae5db24942fcee1304Fabrízio de Royes Mello<fabriziomello@gmail.com>Tue Aug 16 15:05:28 2022 -0300Change usage of scanint8 to pg_strtoint64PostgreSQL 15 changed `scanint8` to `pg_strtoint64`, so added it to the compatibility layer and use just of pg_strtoint64 in source code. postgres/postgres@cfc7191dfea330dd7a71e940d59de78129bb6175
696e97fa59839e20108840e3ee206ca2f4a69333f39Fabrízio de Royes Mello<fabriziomello@gmail.com>Tue Aug 16 12:21:13 2022 -0300Remove unused header fileThe Postgres header utils/int8.h is not necessary and it was removed in version 15 by commit postgres/postgres@cfc7191dfea330dd7a71e940d59de78129bb6175
697d3d30c054766c5f1a3e9e978e383d8d28314efaeMarkos Fountoulakis<markos@timescale.com>Tue Aug 16 17:51:57 2022 +0300Fix heap buffer overflowFix heap buffer overflow when C-strings are shorter than NameData types. Fixes #4571
698d256758fd771e603d81ef99431daaa541de033d3Sven Klemm<sven@timescale.com>Tue Aug 16 08:21:35 2022 +0200Disable local line in pg_hba.conf on WindowsWindows does not support unix domain socket connections so we comment out `local` lines in pg_hba.conf. On PG12 on Windows this will prevent server start otherwise.
699060cd893270f206cff1fa547801ef4786125c2d7Markos Fountoulakis<markos@timescale.com>Tue Aug 16 12:37:42 2022 +0300Fix identical branchesThe same code is executed because the 'then' and 'else' branches are identical. Discovered by Coverity CID 380009.
700f92fe0cdd449008e758923f77979505516a35d26Sven Klemm<sven@timescale.com>Mon Aug 15 14:30:50 2022 +0200Make test settings explicitOur tests assume timezone to be US/Pacific and will fail with different values.
7017bd25e093165c3b354b7bbcac4c5ed60fd58ffe6Sven Klemm<sven@timescale.com>Tue Aug 16 07:41:46 2022 +0200Explicitly set hash table memory contextWe require hash_create to have an explicit memory context so they are not accidentally created in TopMemoryContext leading to memory leaks if unintended.
702ee4423c18181846d30d8910a02ff13ffeb79323aSven Klemm<sven@timescale.com>Fri Aug 12 09:29:12 2022 +0200Fix coccinelle hash_create scriptPreviously the hash_create coccinelle script would not detect hash_create calls that declared the return variable in the same statement or that used the return value of hash_create as return value.
7038c5a7597659669793a91bae6f3538bd721f29f45Sven Klemm<sven@timescale.com>Mon Aug 15 18:45:20 2022 +0200Add missing ORDER BY clauses to cagg_policy test
70403defb33ef1d54ac7585e1eb6ee6caabaf4b27dcJoshua Lockerman<josh@timescale.com>Thu Aug 11 14:43:11 2022 -0400Fix telemetry BGW memory leakApplies the same fix as PR 4534 to the hash table created in the telemetry background worker.
705a3cfc091e89962e8860faf5a1db651d349dec5acJoshua Lockerman<josh@timescale.com>Wed Aug 10 10:18:41 2022 -0400Re-enable telemetry testsThey should be functioning after 2.7.2
706a6cda9c9f051b8526a94dabeeb3f2055bf9072cbSven Klemm<sven@timescale.com>Mon Aug 15 10:28:19 2022 +0200Fix chunk_utils_internal testChange chunk_utils_internal test to not use oid but instead use the role name. Using the oid can lead to failing tests when oid assignment is different especially when run with regresschecklocal-t.
707131773a902580ffefebd7a6807b29dc4627807bcSven Klemm<sven@timescale.com>Thu Aug 11 17:57:24 2022 +0200Reset compression sequence when group resetsThe sequence number of the compressed tuple is per segment by grouping and should be reset when the grouping changes to prevent overflows with many segmentby columns.
7080c6f4e24587bfb7ab56642a6df75172ee4472845Sven Klemm<sven@timescale.com>Thu Aug 11 11:12:52 2022 +0200Centralize CI settingsThis patch adds a new settings file for common github action settings. Instead of repeating latest pg versions in every github workflow we can read the settings from this central file.
7091c4c2bfd8ad5e69459775e92b2792d3b4043be76Sven Klemm<sven@timescale.com>Mon Aug 15 10:01:28 2022 +0200Bump pgspot version used in CI to 0.3.3Use pgspot 0.3.3 in CI and remove the obsolote check for 2.6.1.
71029937fd57c86f02465820fed85552d9a61d75051Sven Klemm<sven@timescale.com>Thu Aug 11 10:10:58 2022 +0200Bump PG version used in CI to 14.5,13.8 and 12.12
711500c2259992ca6ea166ae7cd698e0dfcf76f77acFabrízio de Royes Mello<fabriziomello@gmail.com>Fri Aug 5 15:19:24 2022 -0300Handle properly default privileges on CAggsIf a default privilege is configured and applied to a given Continuous Aggregate during it creation just the user view has the ACL properly configured but the underlying materialization hypertable no leading to permission errors. Fixed it by copying the privileges from the user view to the materialization hypertable during the Continous Aggregate creation. Fixes #4555
71216fdb6ca5e3a42c120a45c7dc635e03c12f4b2e9Rafia Sabih<rafia.sabih@gmail.com>Thu Jul 7 21:07:54 2022 +0200Checks for policy validation and compatibilityAt the time of adding or updating policies, it is checked if the policies are compatible with each other and to those already on the CAgg. These checks are: - refresh and compression policies should not overlap - refresh and retention policies should not overlap - compression and retention policies should not overlap Co-authored-by: Markos Fountoulakis <markos@timescale.com>
713088f688780d2c015cc3e807573381acc7f2f2839Rafia Sabih<rafia@timescale.com>Mon May 9 14:55:07 2022 +0300Miscellaneous-Add infinity for refresh window range Now to create open ended refresh policy use +/- infinity for end_offset and star_offset respectivly for the refresh policy. -Add remove_all_policies function This will remove all the policies on a given CAgg. -Remove parameter refresh_schedule_interval -Fix downgrade scripts -Fix IF EXISTS case Co-authored-by: Markos Fountoulakis <markos@timescale.com>
714bca65f46975f61e36e2ce57dc1ae7d80d6cccf05Rafia Sabih<rafia.sabih@gmail.com>Wed May 4 15:56:14 2022 +05301 step CAgg policy managementThis simplifies the process of adding the policies for the CAggs. Now, with one single sql statements all the policies can be added for a given CAgg. Similarly, all the policies can be removed or modified via single sql statement only. This also adds a new function as well as a view to show all the policies on a continuous aggregate.
715be429eb3d9419440c56f33f7e32422ebd697fe29Sven Klemm<sven@timescale.com>Thu Aug 11 19:43:02 2022 +0200Regenerate SSL certsThe SSL certs used for testing expired today. This patch adds new certificates that last for 100 years.
71695cc330e0cd7d81778864601b89082b32212ebf1gayyappan<gayathri@timescale.com>Mon Aug 8 17:49:25 2022 -0400Add inherited check constraints to OSM chunkWhen a table is added to an inheritance hierrachy, PG checks if all check constraints are present on this table. When a OSM chunk is added as a child of a hypertable with constraints, make sure that all check constraints are replicated on the child OSM chunk as well.
717d843fdd3235d03fe104bc01ccc7918d188c315fbSven Klemm<sven@timescale.com>Mon Aug 8 20:59:05 2022 +0200Disable build_info test on appveyorThe build_info seems to be very flaky on appveyor since a couple days and often timing out instead of completing successfully. This patch temporarily disables that test on appveyor.
718a6107020e6e90387d390115de347224f58961178Sven Klemm<sven@timescale.com>Fri Aug 5 14:54:20 2022 +0200Fix segfaults in compression code with corrupt dataSanity check the compression header for sane algorithm before using it as index into an array. Previously this would result in a segfault and could happen with corrupted compressed data.
719ea7a9db97258f8804c956f75d1d72055f0f352daFabrízio de Royes Mello<fabriziomello@gmail.com>Mon Aug 8 10:36:07 2022 -0300Add primnodes.h to ts_get_node_name functionIn partitioning.c the function `resolve_function_argtype` deal with some primitive nodes in order to resolve the argument type for hashing functions. Refactoring the code a bit and added the primitive nodes (primnodes.h) to the `ts_get_node_name` and improve the error message of `resolve_function_argtype` showing the name of the node type instead of the code when an unsupported node type is detected.
7205c129be60fc0d23d9903b44953511b28c67a5ba7Fabrízio de Royes Mello<fabriziomello@gmail.com>Sun Aug 7 15:20:57 2022 -0300Fix partitioning functionsWhen executing `get_partition_{hash|for_key}` inside an IMMUTABLE function we're getting the following error: `ERROR: unsupported expression argument node type 112` This error is because the underlying `resolve_function_argtype` was not dealing with `T_Param` node type. Fixed it by dealing properly with `T_Param` node type returning the `paramtype` for the argument type. Fixes #4575
721d35ea0f997bf815f652c2a4713924e1b51709012Fabrízio de Royes Mello<fabriziomello@gmail.com>Sun Aug 7 13:04:00 2022 -0300Fix assertion in GRANT .. ON ALL TABLES IN SCHEMAWhen working on a fix for #4555 discovered that executing `{GRANT|REVOKE} .. ON ALL TABLES IN SCHEMA` in an empty schema lead to an assertion because we change the way that command is executed by collecting all objects involved and processing one by one. Fixed it by executing the previous process utility hook just when the list of target objects is not empty. Fixes #4581
72213df260089b50c79ed590eee19228f66eb540de2Sven Klemm<sven@timescale.com>Wed Aug 3 07:54:55 2022 +0200Dont run isolation tests on PG 12.0 and 13.2The output format of the isolation tester got changed by pg upstream and backported to earlier versions. This means PG versions before the backport have different output format then latest PG version. We used to add all the isolation tests to the IGNORE list for those PG versions but that is error prone and often forgotten when new isolation tests are added. This patch skips the isolation test on PG versions with incompatible output format.
723ce94cf126614e305a1bb4bd0f905cfedefb7fe17Alexander Kuzmenkov<akuzmenkov@timescale.com>Tue Aug 2 18:01:42 2022 +0300Use non-blocking data node connections for COPYThis PR switches the postgres connections to data nodes to non-blocking mode for the duration of the COPY. Other operations on these connections are unaffected. It serves as a preparation for working with multiple connections simultaneously. No functional changes are introduced, but it's done as a separate PR to simplify review and debugging/bisect in case we introduce an error.
72417844a4087a69ec51aa75ef8b815d0109c019a40Sven Klemm<sven@timescale.com>Tue Aug 2 18:41:20 2022 +0200Fix ABI test git errorsThe most recent versions of the postgres docker image no longer contain git by default. The version available also contains a fix for the git vulnerability that changed the git behaviour to check file ownership. Since we bind mount the source checkout into the build container the user of the checkout is unlikely to match the user inside the container. This patch configures git to skip the owner check for the bind-mounted directory. https://github.blog/2022-04-12-git-security-vulnerability-announced/
725bbfdcaccd5807751a8753d5c814ddf44fcd89bb2Sven Klemm<sven@timescale.com>Tue Aug 2 18:42:57 2022 +0200Fix cmake when build directory not child of source directoryWhen the build directory was not a child of the source directory fetching the git information about the current commit would fail leading to this information not being included in the executable which in turn resulted in failing tests.
726d639cd89858e214709055ec7a5df498e3357e7afJan Nidzwetzki<jan@timescale.com>Tue Aug 2 08:30:12 2022 +0200Change the stalebot close message.GitHub issues that are closed by a collaborator (or the stalebot) cannot be re-opened by the issue author. This commit changes the close message of the stale bot to reflect this.
727025bda6a81e63db42c34287802a35bc11b1001c3Erik Nordström<erik@timescale.com>Thu Apr 28 08:07:09 2022 +0200Add stateful partition mappingsAdd a new metadata table `dimension_partition` which explicitly and statefully details how a space dimension is split into partitions, and (in the case of multi-node) which data nodes are responsible for storing chunks in each partition. Previously, partition and data nodes were assigned dynamically based on the current state when creating a chunk. This is the first in a series of changes that will add more advanced functionality over time. For now, the metadata table simply writes out what was previously computed dynamically in code. Future code changes will alter the behavior to do smarter updates to the partitions when, e.g., adding and removing data nodes. The idea of the `dimension_partition` table is to minimize changes in the partition to data node mappings across various events, such as changes in the number of data nodes, number of partitions, or the replication factor, which affect the mappings. For example, increasing the number of partitions from 3 to 4 currently leads to redefining all partition ranges and data node mappings to account for the new partition. Complete repartitioning can be disruptive to multi-node deployments. With stateful mappings, it is possible to split an existing partition without affecting the other partitions (similar to partitioning using consistent hashing). Note that the dimension partition table expresses the current state of space partitions; i.e., the space-dimension constraints and data nodes to be assigned to new chunks. Existing chunks are not affected by changes in the dimension partition table, although an external job could rewrite, move, or copy chunks as desired to comply with the current dimension partition state. As such, the dimension partition table represents the "desired" space partitioning state. Part of #4125
72849b6486dad4458dbab5ead98bd9304208639762cSven Klemm<sven@timescale.com>Mon Aug 1 09:52:19 2022 +0200Change get_git_commit to return full commit hashThis patch changes get_git_commit to always return the full hash. Since different git versions do not agree on the length of the abbreviated hash this made the length flaky. To make the length consistent change it to always be the full hash.
72965b5dc900f0ea5e2a76b3a592a4fc25126da6d2bDmitry Simonenko<dmitry@timescale.com>Mon Aug 1 10:36:11 2022 +0300Support add_dimension() with existing dataThis change allows to create new dimensions even with existing chunks. It does not modify any existing data or do migration, instead it creates full-range (-inf/inf) dimension slice for existing chunks in order to be compatible with newly created dimension. All new chunks created after this will follow logic of the new dimension and its partitioning. Fix: #2818
730336f4b513f27fb2be6e041cdb3e4c289bf1adf9fSven Klemm<sven@timescale.com>Sun Jul 31 17:43:04 2022 +0200Fix hash_create calls without HASH_CONTEXT flagThis patch fixes callsites that set an explicit memory context in the control structure but do not specify the HASH_CONTEXT flag leading to the hash table being created in TopMemoryContext. This patch also changes call sites that want to create the hash table in TopMemoryContext to be explicit about this. Additionally this patch adds a coccinelle script to detect these errors and prevent adding similar code in the future.
73128440b79008230ef8c50da2f8d4640456bba8e02Fabrízio de Royes Mello<fabriziomello@gmail.com>Mon Jun 13 17:25:59 2022 -0300Enable ORDER BY on Continuous AggregatesUsers often execute TopN like queries over Continuous Aggregates and now with the release 2.7 such queries are even faster because we remove the re-aggregation and don't store partials anymore. Also the previous PR #4430 gave us the ability to create indexes direct on the aggregated columns leading to performance improvements. But there are a noticable performance difference between `Materialized-Only` and `Real-Time` Continuous Aggregates for TopN queries. Enabling the ORDER BY clause in the Continuous Aggregates definition result in: 1) improvements of the User Experience that can use this so commom clause in SELECT queries 2) performance improvements because we give the planner a chance to use the MergeAppend node by producing ordered datasets. Closes #4456
732eccd6df7821ed94400f8693300ac29f5ef6ebf58Sven Klemm<sven@timescale.com>Mon Jul 18 08:10:05 2022 +0200Throw better error message on incompatible row fetcher settingsWhen a query has multiple distributed hypertables the row-by-by fetcher cannot be used. This patch changes the fetcher selection logic to throw a better error message in those situations. Previously the following error would be produced in those situations: unexpected PQresult status 7 when starting COPY mode
7334ab158d729cb8b1495c9024b6027e6d40022d86eRafia Sabih<rafia.sabih@gmail.com>Tue Jul 19 19:31:08 2022 +0200Fix gitcommit.h generationThe commands for generating gitcommit.h need to be executed on every make run and not on cmake run to detect branch switches, commit changes or local modifications. That's why we add the commands in a custom target and run them on every make run. We do the generation part in a temporary file and only overwrite the actual file when the content is different to not trigger unnecessary recompilations.
73408fb8e44894bcae0b0d9b5ccf9349c725fc250e0Alexander Kuzmenkov<akuzmenkov@timescale.com>Thu Jul 28 12:51:23 2022 +0300Add chunks to baserel cache on chunk exclusionThis speeds up the planning by avoiding the repeated lookup of the chunk metadata.
735008c6cf37187ed706e3abab67305f60721fd0caeSven Klemm<sven@timescale.com>Wed Jul 27 11:06:34 2022 +0200Fix dump_meta_data for windowsThe dump_meta_data sql script used an external call to date to get the current data which does not work on windows. This patch changes the script to use now() instead to get the current time and date. Fixes #3674
7366db09c7f2e7aa2000776062fd57244793e3fba92Sven Klemm<sven@timescale.com>Thu Jul 28 07:12:41 2022 +0200Fix timescaledb_post_restore GUC handlingIn the session timescaledb_post_restore() was called the value for timescaledb.restoring might not be changed because the reset_val for the GUC was still on. We have to use explicit SET in this session to adjust the GUC.
737a584263179ce7c9ffbf3700fa3323a831963c8d4Rafia Sabih<rafia.sabih@gmail.com>Thu Jul 21 19:46:15 2022 +0200Fix alter column for compressed tableEnables adding a boolean column with default value to a compressed table. This limitation was occurring due to the internal representation of default boolean values like 'True' or 'False', hence more checks are added for this. Fixes #4486
7388a308deb85d14fa6bb48bfb1262ba0d1e5e4c2cdSven Klemm<sven@timescale.com>Tue Jul 26 22:25:38 2022 +0200Add a generic memory leak test to CIUnlike the existing memory leak test which tests a single INSERT of 100.000.000 rows in a single transaction, this runs 1000000 SELECT, 10K UPDATE and 50K INSERT queries in the same backend.
7395fd13d3875ee9b1338c23460055632f760308cccJan Nidzwetzki<jan@timescale.com>Tue Jul 26 10:11:06 2022 +0200Trigger bug board assignment on issue commentSo far, issues were added to the bug board when they are labeled; issues that are not on the board and receive a response were not automatically added. This patch extends the workflow trigger; all bug issues that receive a response are also assigned to the board.
740990824a38365a2b811c858a790ebe093934c540dSven Klemm<sven@timescale.com>Mon Jul 25 09:48:58 2022 +0200Remove unused function and macroThis patch removes ts_chunk_add_foreign_table_as_chunk function which never had an implementation added and the ASSERT_IS_NULL_OR_VALID_CHUNK macro which has no user.
7417608cb8719ecf717fa8eba11f1e74efed00eccd4Sven Klemm<sven@timescale.com>Mon Jul 25 09:30:04 2022 +02002.7.2 Post-releaseAdd 2.7.2 to update tests and adjust downgrade script generation for 2.7.2.
7423ea06f4984b4141dba4209ad2d4e431f149a3f55Sven Klemm<sven@timescale.com>Mon Jul 25 09:43:32 2022 +0200Remove ubuntu 21.10 (impish) from package testsUbuntu 21.10 is EOL and we no longer build packages for it.
743661a6507edd0ec9c9c14b9317a6178aa4fd866b5Sven Klemm<sven@timescale.com>Mon Jul 25 09:47:01 2022 +0200Fix coccinelle CI actionSwitch coccinelle CI action to ubuntu 22.04 because 21.10 is EOL and stopped working.
744851fffb1ae723e899d25147fc2dca0f325528d90Sven Klemm<sven@timescale.com>Thu Jul 21 10:36:16 2022 +0200Release 2.7.2This release is a patch release. We recommend that you upgrade at the next available opportunity. Among other things this release fixes several memory leaks, handling of TOASTed values in GapFill and parameter handling in prepared statements. **Bugfixes** * #4517 Fix prepared statement param handling in ChunkAppend * #4522 Fix ANALYZE on dist hypertable for a set of nodes * #4526 Fix gapfill group comparison for TOASTed values * #4527 Handle stats properly for range types * #4532 Fix memory leak in function telemetry * #4534 Use explicit memory context with hash_create * #4538 Fix chunk creation on hypertables with non-default statistics **Thanks** * @3a6u9ka, @bgemmill, @hongquan, @stl-leonid-kalmaev and @victor-sudakov for reporting a memory leak * @hleung2021 and @laocaixw for reporting an issue with parameter handling in prepared statements
74590c7c652b19a46c07c2a7f63dc1efc9a0d39f18dSven Klemm<sven@timescale.com>Thu Jul 21 23:22:31 2022 +0200Fix chunk creation on hypertables with non-default statisticsWhen triggering chunk creation on a hypertable with non-default statistics targets by a user different from the hypertable owner the chunk creation will fail with a permission error. This patch changes the chunk table creation to run the attribute modification as the table owner. Fixes #4474
746ce9672aee3643eba503fb58ebc5262b6ccdaac98Sven Klemm<sven@timescale.com>Fri Jul 22 06:29:54 2022 +0200Fix dist_copy_long test on macOSOn macOS zcat expects the file to end in .Z appending that extension when the supplied filename does not have it. Leading to the following error for the dist_copy_long test: zcat: can't stat: data/prices-10k-random-1.tsv.gz (data/prices-10k-random-1.tsv.gz.Z): No such file or directory This patch changes the dist_copy_long test to use the shell to read the file instead and use input redirection so zcat never sees the filename.
7476b0a9937c59d4648297ee753e12b2445e50e14cdgayyappan<gayathri@timescale.com>Thu Jul 7 18:14:19 2022 -0400Fix attach_osm_table_chunkAdd chunk inheritance when attaching a OSM tabel as a chunk of the hypertable
748ba41a92d9ea966304102406390f58f6dfc45e374Sven Klemm<sven@timescale.com>Thu Jul 21 18:59:17 2022 +0200Bump macOS version used in CI to 11macOS 10.15 is deprecated as github action environment and will be unsupported by end of august. This PR switches our CI to use macOS 11 environment instead. https://github.com/actions/virtual-environments/issues/5583
7491f6b0240a361f70d87769c61011edb27080462d7Alexander Kuzmenkov<akuzmenkov@timescale.com>Thu Jul 21 15:53:15 2022 +0300Add a distributed COPY test with more dataUse data sets with 10k and 100k rows with a variety of partitioning settings. This may help to catch some rare corner cases.
750296601b1d7aba7f23aea3d47c617e2d6df81de3eAlexander Kuzmenkov<akuzmenkov@timescale.com>Tue Jun 28 17:49:23 2022 +0300Synchronize chunk cache sizesSpecifically, flush the chunk multi-insert states when the number of it reaches the size of the chunk cache. Otherwise, the chunks corresponding to the multi-insert states go out of cache and have to be looked up again when the multi-insert state is flushed, which leads to a performance hit.
7517c841b8d924b017cf65c3e3ce631a686bd7afa00Sven Klemm<sven@timescale.com>Wed Jul 20 23:13:10 2022 +0200Use explicit memory context with hash_createThis changes the hash_create calls in the function cache and in the cagg code to use explicit memory context. Without this hash_create will create the hash table in TopMemoryContext potentially leading to memory leaks.
7524ed116b6f6aef5d913df1cce9b80b8eb96af351dDmitry Simonenko<dmitry@timescale.com>Thu Jul 21 11:57:02 2022 +0300Fix ANALYZE on dist hypertable for a set of nodesMake sure ANALYZE can be run on a specific set of data nodes assigned to the distributed hypertable Fix #4508
753ca3c85ba1e31c29276e8af505da56dc3b272a022Konstantina Skovola<konstantina@timescale.com>Wed Jul 20 21:39:05 2022 +0300Remove CODEOWNERS file to activate pull-reviewIn #4525 a workflow was introduced for running pull-review to automate reviewer assignment based on code ownership. However the CODEOWNERS file was not removed. As reviewers will be assigned based on it if it exists, it prevents the pull-review workflow from taking effect. This commit removes CODEOWNERS to allow pull-review to do the reviewer assignment.
75447d6a226f572611b31d393fc54ec2c965515590aSven Klemm<sven@timescale.com>Wed Jul 20 19:36:13 2022 +0200Fix memory leak in function telemetryhash_create will create the hash table in TopMemoryContext unless explicitly requested to create in different memory context. The function telemetry code did not explicitly request a different context leading to a memory leak.
75563a80eec0d23aae3be48bbca4df33f945b3a4a58Nikhil Sontakke<nikhil@timescale.com>Tue Jul 19 19:12:37 2022 +0530Handle stats properly for range typesFor range types, the operator entry in statistics table is invalid. Also, certain range types don't have "VALUES" but only have "NUMBERS" entries.
7560e9dd3c70bf9dc5fc8f92a9efda171a880696957Konstantina Skovola<konstantina@timescale.com>Wed Jul 20 08:55:30 2022 +0300Add config file and workflow for pull-reviewThis commit adds a workflow for running pull-review in the serverless mode, using docker container CLI.
757d5619283f3a9d04b926227be2cdf87db8104191aSven Klemm<sven@timescale.com>Tue Jul 19 13:04:48 2022 +0200Fix gapfill group comparisonThe gapfill mechanism to detect an aggregation group change was using datumIsEqual to compare the group values. datumIsEqual does not detoast values so when one value is toasted and the other value is not it will not return the correct result. This patch changes the gapfill code to use the correct equal operator for the type of the group column instead of datumIsEqual.
7580d175b262e3f34f790318e1c4ea28eae104d6b77Sven Klemm<sven@timescale.com>Mon Jul 18 07:16:19 2022 +0200Fix prepared statement param handling in ChunkAppendThis patch fixes the param handling in prepared statements for generic plans in ChunkAppend making those params usable in chunk exclusion. Previously those params would not be resolved and therefore not used for chunk exclusion. Fixes #3719
759cfac68ec3d8ed80f65b35f594d6c83b0b7002faeSven Klemm<sven@timescale.com>Fri Jul 15 09:21:02 2022 +0200Ignore compression_chunk_race test in 12.0 and 13.2The isolation tester in earlier PG versions is lacking features we rely on in our tests so the results of isolation tests are ignored when testing on the earliest version of a major pg version.
76091c3820d4e693ed0eec5e75ca74300f73a7bd83cJan Nidzwetzki<jan@timescale.com>Mon Jul 18 07:46:12 2022 +0200Activate a stalebot to close issuesIn #4499, a stalebot configuration was introduced. According to the configuration, the stalebot runs in dry mode. The output of a dry mode run was analyzed and issues with an outdated "need-more-info" label have been cleaned up. So, the stalebot can now be activated.
761597b71881ad20f8498938c918e23aa0abe280532Sven Klemm<sven@timescale.com>Sun Jul 17 13:44:49 2022 +0200Fix assertion hit in row_by_row_fetcher_closeWhen executing multinode queries that initialize row-by-row fetcher but never execute it the node cleanup code would hit an assertion checking the state of the fetcher. Found by sqlsmith.
762d55ceb34c311fe1f8de0f6ad90e32199307e8895Sven Klemm<sven@timescale.com>Fri Jul 15 12:31:41 2022 +0200Fix unaligned pointer accessThe sanitizer found unaligned pointers. On amd64 this is not a problem but other platforms like arm are more strict regarding pointer alignment.
76393bad0098d14bd9be6f6c984ab487efc508ca6a4Jan Nidzwetzki<jan@timescale.com>Thu Jul 7 10:59:50 2022 +0200Introduce a stalebot to close issuesThis PR introduces a configuration for the 'actions/stale' stalebot, which is used to automatically flag and close stale issues after a few days of inactivity. Note: The configuration runs in dry-mode to test the behavior of the bot on our repository first.
7645670378e03ce8db6030fe3fe836f6b1b9cde6fcaMats Kindahl<mats@timescale.com>Thu Jul 7 12:54:04 2022 +0200Post-release fixes for 2.7.1
765daa46222ca6eb4894532bf99f2f899895d6c7e1bMats Kindahl<mats@timescale.com>Wed Jun 29 14:16:19 2022 +0200Release 2.7.1
766fdb12f7abe72950e61f20956d781a9fa9c2966afNikhil Sontakke<nikhil@timescale.com>Tue Jul 5 21:04:41 2022 +0530Handle timescaledb versions aptly in multinodeThe current check where we deem a DN incompatible if it's on a newer version is exactly the opposite of what we want it to be. Fix that and also add relevant test cases.
7670c03ed954d0933b107319178cd5b04a592c4f1d2Nikhil Sontakke<nikhil@timescale.com>Wed Jul 6 18:56:40 2022 +0530Ignore telemetry test for nowTemporarily ignore to allow the release of 2.7.1
768335f298ef756a2e7cb11f4a4fb0f866b853e9ba5Fabrízio de Royes Mello<fabriziomello@gmail.com>Tue Jul 5 14:59:34 2022 +0200Segfault when executing IMMUTABLE functionsExecuting an IMMUTABLE function that has parameters and exception handling block multiple times in the same transaction causes a null pointer segfault when try to reset a non-initialized ts_baserel_info. Fixed it by preventing to reset a non-initialized `ts_baserel_info`. Fixes #4489
769a608d7db614c930213dee8d6a5e9d26a0259da61Jan Nidzwetzki<jan@timescale.com>Wed Jun 29 15:12:46 2022 +0200Fix race conditions during chunk (de)compressionThis patch introduces a further check to compress_chunk_impl and decompress_chunk_impl. After all locks are acquired, a check is made to see if the chunk is still (un-)compressed. If the chunk was (de-)compressed while waiting for the locks, the (de-)compression operation is stopped. In addition, the chunk locks in decompress_chunk_impl are upgraded to AccessExclusiveLock to ensure the chunk is not deleted while other transactions are using it. Fixes: #4480
7701bbb6059cba0e75872325fe1e88ffdc8d25d4383Alexander Kuzmenkov<akuzmenkov@timescale.com>Thu Jun 30 11:18:58 2022 +0300Add more tests for distributed INSERT and COPYMore interleavings of INSERT/COPY, and test with slow recv() to check waiting.
77107c8ed6af3fa01efa8e3943711c5456834acdf4eMats Kindahl<mats@timescale.com>Mon Jul 4 09:58:59 2022 +0200Add workflow to move issue to triageAdd workflow to automatically add all issues opened or labeled to the bug board for triage.
7726c20e74674a88164c77e9d6b14dd50aa71d65752gayyappan<gayathri@timescale.com>Fri Jun 24 10:41:29 2022 -0400Block drop chunk if chunk is in frozen stateA chunk in frozen state cannot be dropped. drop_chunks will skip over frozen chunks without erroring. Internal api , drop_chunk will error if you attempt to drop a chunk without unfreezing it. This PR also adds a new internal API to unfreeze a chunk.
773dd4bc4c24601ca39b43f49d4cde32a218f42b8bdJoshua Lockerman<josh@timescale.com>Thu Jun 2 16:11:44 2022 -0400Add telemetry about replicationThis commit adds telemetry about replication status to our telemetry gatherer. It adds a new sub object `replication` containing two fields: - `is_wal_receiver` is a boolean which is true if-and-only-if the current cluster has a `wal_receiver`. - `num_wal_senders` is the number of `wal_senders` that the current cluster has.
7748bf6c887a93d2c013f84647248182d46607a91f3Nikhil Sontakke<nikhil@timescale.com>Fri Jun 24 13:19:31 2022 +0530Better superuser handling for move_chunkThe current code was assuming the bootstrap superuser for the actual move chunk operation. However, we can make it further flexible by using the logged in credentials if those happen to have superuser privileges.
7750b76a8e5c37a9d0b3d1f9d82c74548c187966a36Sven Klemm<sven@timescale.com>Fri Jun 24 19:12:46 2022 +0200Remove travis configWe migrated all our CI jobs to GitHub actions quite a while ago but never removed the travis config file even though we were not using it anymore.
77679bf4f53b144ed25569b19b76d0aafbbcc17a15fgayyappan<gayathri@timescale.com>Tue Jun 21 17:14:43 2022 -0400Add api to associate a hypertable with custom jobsThis PR introduces a new SQL function to associate a hypertable or continuous agg with a custom job. If this dependency is setup, the job is automatically deleted when the hypertable/cagg is dropped.
777bd3d2ef884e4a475735567e880f7a524455163c8Konstantina Skovola<konstantina@timescale.com>Thu Jun 23 14:20:41 2022 +0300Make reproduction steps field mandatory
778131f58ee602af8dcdc4b901587cb72beb3f51d2egayyappan<gayathri@timescale.com>Thu Apr 28 17:51:27 2022 -0400Add internal api for foreign table chunkAdd _timescaledb_internal.attach_osm_table_chunk. This treats a pre-existing foreign table as a hypertable chunk by adding dummy metadata to the catalog tables.
7796c38c60b9782797b538129ba92f61268b4da42c6Markos Fountoulakis<markos@timescale.com>Thu Jun 23 10:59:24 2022 +0300Repair numeric partial state on the flyThe numeric format changed between PG13 and PG14 to include infinities. As a result the serialized partial state of numeric aggregates also changed format. If a user that has stored partials (e.g. by using Continuous Aggregates) upgrades to PG14 then the partial state deserialization will lead to errors due to the mismatch with the PG14 code. Repair the deserialization process on the fly by appending zeroed plus-infinity and minus-infinity counts for the numeric aggregate state to use. Fixes #4427
78093e9d421931a50d443da02c078f1e8ae93388517Alexander Kuzmenkov<akuzmenkov@timescale.com>Mon Jun 20 11:33:32 2022 +0300Use COPY protocol in row-by-row fetcherThis gives about 2x speedup for bulk data transfer queries.
781e3b2fbdf1513ee8b2db111a3a7c1c0f5d42b1b26Nikhil Sontakke<nikhil@timescale.com>Tue Jun 21 20:21:31 2022 +0530Fix empty bytea handlng with distributed tablesThe "empty" bytea value in a column of a distributed table when selected was being returned as "null". The actual value on the datanodes was being stored appropriately but just the return code path was converting it into "null" on the AN. This has been handled via the use of PQgetisnull() function now. Fixes #3455
782db6447378624aa09745ce0c7762205e12fa33a76Sven Klemm<sven@timescale.com>Tue Jun 21 08:15:19 2022 +0200Use PG 14.4 in update testSwitch update/downgrade test to use 14.4. This has been split off the CI PR switching the rest of CI to 14.4 because it usually takes more then a week for the upstream docker images to become available.
783f400c75b79db73d49245728139ef0c26df3d4551Jacob Champion<jchampion@timescale.com>Mon Jun 20 11:18:35 2022 -0500Tweak commit-msg hook's line character limitsThe commit-msg hook was counting the end-of-line characters in the 50- and 72-character limit, so commit messages had to be wrapped slightly shorter in order to avoid the hook complaint. Strip the EOL characters during the check instead. Since we use universal newline handling during the file read, stripping LF ('\n') should be enough to handle both Windows and Unix development environments.
784bab5cc101d451f160f409d5848eab053908ca04dJacob Champion<jchampion@timescale.com>Mon Jun 20 10:52:49 2022 -0500Update commit-msg hook to Python 3This git hook is copied automatically during CMake, and breaks commits immediately afterwards if Python 2 isn't installed. Since Python 2 has been end-of-life for a while now, take this chance to upgrade.
7851221977c9c922accab2255507113bfa83d854216Jacob Champion<jchampion@timescale.com>Mon Jun 20 10:48:06 2022 -0500Inspect pg_config.h for SSL supportWe parse apart the output of `pg_config --configure` to see whether or not OpenSSL is enabled. This is a bit brittle; it has broken in the past with the change from --with-openssl to --with-ssl, and upstream is currently testing a change to the build system (Meson, which doesn't rely on autotools during configuration) that is likely to further interfere with this approach. As an alternative, we can just look at the header files to get this information. USE_OPENSSL is not defined in pg_config.h if SSL support is not compiled in.
78679aa0f637834066f4e7e470bd49bb629bab9fdd7Dmitry Simonenko<dmitry@timescale.com>Tue Jun 21 13:38:27 2022 +0300Do not allow dist ddl during create extensionThis change fixes logic for the extension loading check, by moving it before the distributed_ddl guc check.
78702d4aefb85340dcafea6729141bac033fe3f3ef1Sven Klemm<sven@timescale.com>Sun Jun 12 15:50:07 2022 +0200Fix flaky data_node_bootstrap testCopy collation and chartype before releasing syscache since we need them past the lifetime of the current context.
7885c69adfb7e0fcda27d89c1b98eee2f9f94639e5dAlexander Kuzmenkov<akuzmenkov@timescale.com>Tue Jun 21 10:56:09 2022 +0300Add more tests for errors on data nodesUse a data type with faulty send/recv functions to test various error handling paths.
7891a9d775a2c88cee3bd8bb4cf1ddd47cb670a31f3Nikhil Sontakke<nikhil@timescale.com>Tue Jun 14 17:29:54 2022 +0530Fix perms in copy/move chunkWe mandate that a superuser or a user with REPLICATION privileges can invoke copy_chunk or move_chunk procedures. Internally, many stages are carried out to complete the activity and different stages need different user permissions. To keep things uniform we now switch to the bootstrap superuser in each stage. Care is taken to ensure that the original hypertable ownership is retained on the new chunk post the move operation.
790048d86e7e7a73f30002eeb9f85b25d84c6206cf7Sven Klemm<sven@timescale.com>Fri Jun 17 21:51:35 2022 +0200Fix duplicate header guardThe compression code had 2 files using the same header guard. This patch renames the file with floating point helper functions to float_utils.h and renames the other file to compression/api since that more clearly reflects the purpose of the functions.
7915cfedda1d0ab379b9745d39a04a8c66293e055f5Sven Klemm<sven@timescale.com>Mon Jun 20 07:33:32 2022 +0200Bump pgspot version used in CI to 0.3.2
792cb096757fa8abe8eea4d4f1959f641e385ba71eaSven Klemm<sven@timescale.com>Thu Jun 16 06:48:17 2022 +0200Bump Postgres version used in CI to 14.4Make CI use just released PG 14.4. We skip the version bump for the update script as docker images with 14.4 are nowhere to be seen.
7931fbd4116f9c4ce5724d32ca68a205b69624eff28Pavel Borisov<pashkin.elfe@gmail.com>Wed Jun 15 20:24:50 2022 +0400Fix tests to be resilient to possible PG planner changes.
79442f197e5799b06c7f33198f79a48531c582cdc7bFabrízio de Royes Mello<fabriziomello@gmail.com>Wed Jun 15 12:01:07 2022 -0300Explicit constraint names in schema definitionIn `src/ts_catalog/catalog.c` we explicit define some constraints and indexes names into `catalog_table_index_definitions` array, but in our pre-install SQL script for schema definition we don't, so let's be more explicit here and prevent future surprises.
795ed55654a32c2b542419bcb57da14f0bda9c55652Nikhil Sontakke<nikhil@timescale.com>Thu Jun 16 17:23:42 2022 +0530Retain hypertable ownership on attach_data_nodeIf a superuser is used to invoke attach_data_node on a hypertable then we need to ensure that the object created on this data node has the same original ownership permissions. Fixes #4433
796d83db1578cec5d3b7393ad0ddd744f416441b805Konstantina Skovola<konstantina@timescale.com>Fri Jun 17 09:32:09 2022 +0300Redirect CI failures report to new channel
79719b3f67b9c5cf92184ba1fce3495df2cc2947e11Erik Nordström<erik@timescale.com>Fri Jun 3 13:58:44 2022 +0200Drop remote data when detaching data nodeAdd a parameter `drop_remote_data` to `detach_data_node()` which allows dropping the hypertable on the data node when detaching it. This is useful when detaching a data node and then immediately attaching it again. If the data remains on the data node, the re-attach will fail with an error complaining that the hypertable already exists. The new parameter is analogous to the `drop_database` parameter of `delete_data_node`. The new parameter is `false` by default for compatibility and ensures that a data node can be detached without requiring communicating with the data node (e.g., if the data node is not responding due to a failure). Closes #4414
79856945b37b8920cb7590dd61dc3d8a625e7d650a2Alexander Kuzmenkov<akuzmenkov@timescale.com>Wed Jun 1 14:01:40 2022 +0300Enable ON CONFLICT ON CONSTRAINT for hypertablesIt now works since we started to rely on Postgres' arbiter index inference.
7991784e83d77bc3004c83af73a0fe6de8307f2583cSven Klemm<sven@timescale.com>Sun Jun 12 11:13:10 2022 +0200Fix segfault in subscription_execAdd a check for NULL input to subscription_exec as the function currently segfaults on NULL input. Found by sqlsmith.
80007c5f7281c0256a57e45e459cf15c944963801adFabrízio de Royes Mello<fabriziomello@gmail.com>Thu Jun 9 09:59:55 2022 -0300Create index on Continuous AggregatesTimescale 2.7 released a new version of Continuous Aggregate (#4269) that allows users efectivelly create and use indexes in the materialization hypertable. The boring part of it is that users should discover what is the associated materialization hypertable to issue a `CREATE INDEX` statement. Improved it by allowing users to easily create indexes in the materialization hypertable by simple executing a `CREATE INDEX` direct in the Continuous Aggregate. Example: `CREATE INDEX name_of_the_index ON continuous_agregate (column);`
8011ac06c71c2bbfd0f878d0078ab9ab01367302c1cSven Klemm<sven@timescale.com>Mon Jun 13 08:35:16 2022 +0200Refactor make_partfunc_callRefactor make_partfunc_call to only accept fnoid and rettype instead of PartitioningFunc which also gets rid of a coverity warning about that parameter being passed by value instead of reference because that parameter was longer than 128 bytes.
802308ce8c47bf36dcb38a729bb6afbe05eaeb4ce9eSven Klemm<sven@timescale.com>Sat Jun 11 10:05:06 2022 +0200Fix various misspellings
803eb9f466582762e00ae2aefdece09d658903dfc44Luigi Servini<39734184+lservini@users.noreply.github.com>Mon May 9 16:38:44 2022 +0200Update dump_meta_data.sqlAdded `c.dropped is false ` for table _timescaledb_catalog.chunk to skip dropped chunks in the size calculation.
804f72a277577a76678b8f903230a76567cdbd19718Fabrízio de Royes Mello<fabriziomello@gmail.com>Wed Jun 8 13:54:21 2022 -0300Fix continuous aggregates deprecated testsPrevious pull request #4269 introduced new format for Continuous Aggregates and we also added regression tests for the `deprecated` version to make sure it will keep working until we decide to completely deprecate and remove the old version. Unfortunately for some deprecated continous aggregates regression tests we miss to set properly the flag `timescaledb.finalized=false`. Fixed it by properly setting the `timecaledb.finalized=false` during the continuous aggregate creation.
805c6dc0caf1deee6510b6bddd6a0395f0a7368d89fRajakavitha Kodhandapani<krajakavitha@gmail.com>Tue Jun 7 15:40:58 2022 +0530Update README.mdfixes: https://github.com/timescale/docs/issues/1162
8063c56d3ecebbf476293ff43ded142bc9e5087f6deAlexander Kuzmenkov<akuzmenkov@timescale.com>Thu May 26 10:53:48 2022 +0300Faster lookup of chunks by pointDon't keep the chunk constraints while searching. The number of candidate chunks can be very large, so keeping these constraints is a lot of work and uses a lot of memory. For finding the matching chunk, it is enough to track the number of dimensions that matched a given chunk id. After finding the chunk id, we can look up only the matching chunk data with the usual function. This saves some work when doing INSERTs.
807216ea65937455dc2194b155e0713093f14a39f96Sven Klemm<sven@timescale.com>Mon May 23 23:01:46 2022 +0200Enable chunk exclusion for space dimensions in UPDATE/DELETEThis patch transforms constraints on hash-based space partitions to make them usable by postgres constraint exclusion. If we have an equality condition on a space partitioning column, we add a corresponding condition on get_partition_hash on this column. These conditions match the constraints on chunks, so postgres' constraint exclusion is able to use them and exclude the chunks. The following transformations are done: device_id = 1 becomes ((device_id = 1) AND (_timescaledb_internal.get_partition_hash(device_id) = 242423622)) s1 = ANY ('{s1_2,s1_2}'::text[]) becomes ((s1 = ANY ('{s1_2,s1_2}'::text[])) AND (_timescaledb_internal.get_partition_hash(s1) = ANY ('{1583420735,1583420735}'::integer[]))) These transformations are not visible in EXPLAIN output as we remove them again after hypertable expansion is done.
808ce59820678075875f8db3871caee28b99c635bddSven Klemm<sven@timescale.com>Mon Jun 6 14:57:53 2022 +0200Fix removal of constified constraintsCommit dcb7dcc5 removed the constified intermediate values used during hypertable expansion but only did so completely for PG14. For PG12 and PG13 some constraints remained in the plan.
809b6a974e7f3c7439c1ef423ea64431ce2a907e068Konstantina Skovola<konstantina@timescale.com>Mon May 23 18:48:09 2022 +0300Add schedule_interval to policiesAdd a parameter `schedule_interval` to retention and compression policies to allow users to define the schedule interval. Fall back to previous default if no value is specified. Fixes #3806
81096202a99bdf19f1b459c29d3e12ab42ecf9bc6a5Sven Klemm<sven@timescale.com>Tue May 31 11:56:43 2022 +0200Adjust code to PG15 pg_database changesPG15 changes the type of collate and ctype from name to text. https://github.com/postgres/postgres/commit/54637508
8111ef515eb7a5ca0c00f78c552ba9f7c20b67423a5Sven Klemm<sven@timescale.com>Thu Jun 2 05:55:33 2022 +0200Add shmem_request_hookThis patch consolidates all shared memory requests in a shmem_request_hook. While there are no strict requirements when to request shared memory for PG < 15 in PG 15 it has to happen in the shmem_request_hook otherwise the request will be blocked. https://github.com/postgres/postgres/commit/4f2400cb
812f059e00fad24f7438bb4a275b42e56522bebf8a3Konstantina Skovola<konstantina@timescale.com>Fri May 27 15:39:31 2022 +0300Create composite index on segmentby columnsPreviously we created one index per segmentby column, of the form `(col, _ts_meta_sequence_num)`. Compressed data is ordered by segmentby, then by orderby within the segments and lastly by the sequence number of the batch. So if segmentby columns are missing from the index, that index cannot be used to produce ordered output, requiring an extra sort step. A composite index containing all segmentby columns removes the additional sort step and gives better plans. Fixes #4314
8138f9975d7be856df984763ed837e6b17b36768b4dErik Nordström<erik@timescale.com>Mon May 30 16:08:45 2022 +0200Fix crash during insert into distributed hypertableFor certain inserts on a distributed hypertable, e.g., involving CTEs and upserts, plans can be generated that weren't properly handled by the DataNodeCopy and DataNodeDispatch execution nodes. In particular, the nodes expect ChunkDispatch as a child node, but PostgreSQL can sometimes insert a Result node above ChunkDispatch, causing the crash. Further, behavioral changes in PG14 also caused the DataNodeCopy node to sometimes wrongly believe a RETURNING clause was present. The check for returning clauses has been updated to fix this issue. Fixes #4339
81465b0dda97b11224e79f3aa7580b714337718308cErik Nordström<erik@timescale.com>Wed Jun 1 17:17:50 2022 +0200Fix CI coredump handlingThe CI task for getting coredumps after crashes of a 32-bit build didn't handle a variable correctly. Fix to avoid errors.
815cae1f16367ca734b7eca32f7add2f19cc957d537Sven Klemm<sven@timescale.com>Tue May 31 09:19:11 2022 +0200Use our implementation of find_em_expr_for_rel for PG15+PG13 added an implementation of find_em_expr_for_rel to postgres core code. Which is removed again in PG15. This patch adjusts our macros to deal with the removal in PG15. https://github.com/postgres/postgres/commit/f3dd9fe1
816f28131cff5b23ede1a316b5d81452918bc815fd9Konstantina Skovola<konstantina@timescale.com>Thu May 26 14:39:13 2022 +0300Don't ask for orderby column if default already setWhen enabling compression on a hypertable, the orderby option can be omitted, which will set the default value of "time DESC". However previously, when executing the same command twice not setting orderby, the second time we would get an error that orderby was previously set and must be specified. For example when executing `alter table set (timescaledb.compress, timescaledb.segmentby = '..')` The reason for that error was that it's unclear if no orderby means leave as is, or if it means set the default value. But in the case where orderby is already set to the default value, there is no ambiguity and both cases are equivalent, so the default value can be reset without giving an error. Fixes #4331
817ed948b17721a45301604433c1fd8572ed3fa1901Alexander Kuzmenkov<akuzmenkov@timescale.com>Wed Jun 1 15:26:29 2022 +0300Don't force clang-tidy onIf the compiler is gcc, clang-tidy might not recognize some of its flags and error out. It will be enabled by default if the compiler is clang.
818533e849c574934eb8f00e254a6467376391622bbMats Kindahl<mats@timescale.com>Tue May 24 10:47:57 2022 +0200Pass parameters to workers as a structNon-functional change. Parameters to workers were passed in as a serialized string, which then needs to be serialized and deserialized using dedicated functions. This commit refactors code to pass parameters to workers as a struct, which is then just copied into the `bgw_extra` field of `BackgroundWorker`. The struct contains simple values and can therefore be copied using memcpy(3c).
8195c0110cbbf644ec79b2d2b0249eb3e112c081c4bAlexander Kuzmenkov<akuzmenkov@timescale.com>Fri May 6 14:14:48 2022 +0300Mark partialize_agg as parallel safePostgres knows whether a given aggregate is parallel-safe, and creates parallel aggregation plans based on that. The `partialize_agg` is a wrapper we use to perform partial aggregation on data nodes. It is a pure function that produces serialized aggregation state as a result. Being pure, it doesn't influence parallel safety. This means we don't need to mark it parallel-unsafe to artificially disable the parallel plans for partial aggregation. They will be chosen as usual based on the parallel-safety of the underlying aggregate function.
8201d0670e703862b284c241ab797404f851b25b5dfJan Nidzwetzki<jan@timescale.com>Tue May 31 10:33:38 2022 +0200Fix flaky copy test by generating fixed test dataThe copy test is flaky because some test data is generated dynamically based on the current date. This patch changes the data generation to a time series with fixed dates.
8211fbe2eb36f3ff4b12023549b76c8c3df0b8a79b9Sven Klemm<sven@timescale.com>Sat May 28 13:40:10 2022 +0200Support intervals with month component when constifying now()When dealing with Intervals with month component timezone changes can result in multiple day differences in the outcome of these calculations due to different month lengths. When dealing with months we add a 7 day safety buffer. For all these calculations it is fine if we exclude less chunks than strictly required for the operation, additional exclusion with exact values will happen in the executor. But under no circumstances must we exclude too much cause there would be no way for the executor to get those chunks back.
8222715b5564a3be4bb9c3fdb29f81a5c3fb3c0aae6Sven Klemm<sven@timescale.com>Sun May 29 15:08:55 2022 +0200Replace pg_atoi with pg_strtoint16/32PG 15 removes pg_atoi, so this patch changes all callers to use pg_strtoint16/32. https://github.com/postgres/postgres/commit/73508475
82312574dc8ecda70d60a3ee0cf4a8489aa23bccb8fSven Klemm<sven@timescale.com>Thu May 26 13:34:40 2022 +0200Support intervals with day component when constifying now()The initial patch to use now() expressions during planner hypertable expansion only supported intervals with no day or month component. This patch adds support for intervals with day component. If the interval has a day component then the calculation needs to take into account daylight saving time switches and thereby a day would not always be exactly 24 hours. We mitigate this by adding a safety buffer to account for these dst switches when dealing with intervals with day component. These calculations will be repeated with exact values during execution. Since dst switches seem to range between -1 and 2 hours we set the safety buffer to 4 hours. This patch also refactors the tests since the previous tests made it hard to tell the feature was working after the constified values have been removed from the plans.
824a6b5f9002cf4f3894aa8cbced7f862a73784cadaAlexander Kuzmenkov<akuzmenkov@timescale.com>Fri May 13 15:49:00 2022 +0300More clear clang-tidy optionsEnable a closed list of checks and treat everything as errors.
825ecf34132c69e1709cd393eab43b5fcbfd7c201dbAlexander Kuzmenkov<akuzmenkov@timescale.com>Fri May 13 19:25:18 2022 +0300Fix clang-tidy warning `readability-redundant-control-flow`
826e75274ee7c6eef1dafc9b4f4d9f71e8e88f76813Alexander Kuzmenkov<akuzmenkov@timescale.com>Fri May 13 18:22:46 2022 +0300Fix clang-tidy warning `bugprone-argument-comment`
827a3ef0384655d57200e83ad7b13c91a31177b97c1Alexander Kuzmenkov<akuzmenkov@timescale.com>Fri May 13 15:46:58 2022 +0300Fix clang-tidy warning `bugprone-macro-parentheses`
8287aec25d69e45292569fbe27364c2f68d269d416eSven Klemm<sven@timescale.com>Wed May 25 20:16:46 2022 +0200Adjust coccinelle and shellcheck CI configCurrently coccinelle and shellcheck get run an additional time for every merged commit to master. This patch adjusts the config so they are only run on pull request or on push to prerelease_test instead of push to any branch, similar to how all the other workflows are set up.
829c35e9bf611bf52459b1771ac66c0a71a4afe1ad0Joshua Lockerman<josh@timescale.com>Mon Apr 11 12:45:01 2022 -0400Function telemetryThis commit contains extends our telemetry system with function call telemetry. It gathers function call-counts from all queries, and send back counts for those functions that are built in or from our related extensions.
83034bf69544453f0a941f53aa5f2878426bfa5e353Mats Kindahl<mats@timescale.com>Wed May 25 13:39:16 2022 +0200Add initializer to auto variableCompilers are not smart enough to check that `conn` is initialized inside the loop so not initializing it gives an error. Added an initializer to the auto variable to get rid of the error.
831f0556dc9026342152bf6c34a7d495d5e0b410ee3Sven Klemm<sven@timescale.com>Wed May 25 10:59:33 2022 +0200Skip 001_extension test on PG13.2 in CIThe extension test uses the background_psql function which is not present in the 13.2 PostgresNode module. This function is only available in PG 13.5+. https://github.com/postgres/postgres/commit/a9d0a540
8320b6a09f027c521dc543b2b3bd3394af593702659Sven Klemm<sven@timescale.com>Wed May 25 08:10:45 2022 +0200Add support for SKIPS to provecheckThis patch adds support for skipping individual tests in a provecheck run similar to what we have for our regression checks.
833dcb7dcc5064a7f843d435482d5c0cf643e7f9021Sven Klemm<sven@timescale.com>Mon May 23 06:06:58 2022 +0200Remove constified now() constraints from planCommit 35ea80ff added an optimization to enable expressions with now() to be used during plan-time chunk exclusion by constifying the now() expression. The added constified constraints were left in the plan even though they were only required during the hypertable explansion. This patch marks those constified constraints and removes them once they are no longer required.
834d249954be0407d358ef12590e9a92f2f9926269aJan Nidzwetzki<jan@timescale.com>Fri May 20 12:30:50 2022 +0200Improved buffer management in the copy operatorThe multi-buffer copy optimization creates a multi-insert buffer per ChunkInsertState. However, chunks can be closed. When ts_chunk_dispatch_get_chunk_insert_state is called for a closed chunk again, a new ChunkInsertState is returned. So far, also a new multi-insert buffer has been created. Therefore, multiple batch operations could be executed per chunk, which reduces the efficiency of the optimization. This patch introduces an HTAB that maps from the chunk_id to the multi-insert buffer. Even when a chunk is closed, all tuples for a chunk are stored in the same buffer.
835cf9b6267941964fb134c1e2122b91c473a81f7e9Sven Klemm<sven@timescale.com>Tue May 24 10:42:19 2022 +0200Post-Release 2.7.0Adjust version.config and add 2.7.0 to update/downgrade test.
8360a682095632ed4c553703e6d27fc7bad6da71c59Sven Klemm<sven@timescale.com>Wed May 18 12:09:10 2022 +0200Release 2.7.0This release adds major new features since the 2.6.1 release. We deem it moderate priority for upgrading. This release includes these noteworthy features: * Optimize continuous aggregate query performance and storage * The following query clauses and functions can now be used in a continuous aggregate: FILTER, DISTINCT, ORDER BY as well as [Ordered-Set Aggregate](https://www.postgresql.org/docs/current/functions-aggregate.html#FUNCTIONS-ORDEREDSET-TABLE) and [Hypothetical-Set Aggregate](https://www.postgresql.org/docs/current/functions-aggregate.html#FUNCTIONS-HYPOTHETICAL-TABLE) * Optimize now() query planning time * Improve COPY insert performance * Improve performance of UPDATE/DELETE on PG14 by excluding chunks This release also includes several bug fixes. If you are upgrading from a previous version and were using compression with a non-default collation on a segmentby-column you should recompress those hypertables. **Features** * #4045 Custom origin's support in CAGGs * #4120 Add logging for retention policy * #4158 Allow ANALYZE command on a data node directly * #4169 Add support for chunk exclusion on DELETE to PG14 * #4209 Add support for chunk exclusion on UPDATE to PG14 * #4269 Continuous Aggregates finals form * #4301 Add support for bulk inserts in COPY operator * #4311 Support non-superuser move chunk operations * #4330 Add GUC "bgw_launcher_poll_time" * #4340 Enable now() usage in plan-time chunk exclusion **Bugfixes** * #3899 Fix segfault in Continuous Aggregates * #4225 Fix TRUNCATE error as non-owner on hypertable * #4236 Fix potential wrong order of results for compressed hypertable with a non-default collation * #4249 Fix option "timescaledb.create_group_indexes" * #4251 Fix INSERT into compressed chunks with dropped columns * #4255 Fix option "timescaledb.create_group_indexes" * #4259 Fix logic bug in extension update script * #4269 Fix bad Continuous Aggregate view definition reported in #4233 * #4289 Support moving compressed chunks between data nodes * #4300 Fix refresh window cap for cagg refresh policy * #4315 Fix memory leak in scheduler * #4323 Remove printouts from signal handlers * #4342 Fix move chunk cleanup logic * #4349 Fix crashes in functions using AlterTableInternal * #4358 Fix crash and other issues in telemetry reporter **Thanks** * @abrownsword for reporting a bug in the telemetry reporter and testing the fix * @jsoref for fixing various misspellings in code, comments and documentation * @yalon for reporting an error with ALTER TABLE RENAME on distributed hypertables * @zhuizhuhaomeng for reporting and fixing a memory leak in our scheduler
83726da1b503547a63157e7d974be5b3cdba6e4ac4fSven Klemm<sven@timescale.com>Fri May 20 15:34:59 2022 +0200Show warning for caggs with numericPostgres changes the internal state format for numeric aggregates which we materialize in caggs in PG14. This will invalidate the affected columns when upgrading from PG13 to PG14. This patch adds a warning to the update script when we encounter this configuration.
8384f58132d37d6a60c3b087d5c34a787228cadbf11Sven Klemm<sven@timescale.com>Sun May 22 07:27:01 2022 +0200Fix PG13.2 isolation testsThe deadlock_recompress_chunk isolation test uses syntax not supported by earlier versions of the isolation tester leading to a parse failure when processing that file on PG13.2. This patch skips that particular test on PG13.2.
83994ca9c66f420db92ba44384aa10361b39e235b86Sven Klemm<sven@timescale.com>Fri May 20 21:09:47 2022 +0200Ignore telemetry isolation test on PG13.2Commit 7b9d8673 added an isolation test for telemetry but did not add it to the ignore list for earlier postgres versions. PG14 changed the output format for isolation tests which got backported to PG12 and PG13 which makes the output of earlier PG12 and PG13 different from the latest one so we ignore isolation tests on those earlier versions.
840aa0b36d5bafd30934a7539aa02d5eebc767d6532Sven Klemm<sven@timescale.com>Fri May 20 17:54:45 2022 +0200Skip telemetry test on PG12.0With recent refactorings the telemetry test seems to trigger the same use-after-free bug that got triggered by tablespace test so we skip that test on PG12.0 as well.
841b845f9423b2cb2905d78b67a2f6671a169748b2eSven Klemm<sven@timescale.com>Fri May 20 13:32:02 2022 +0200Skip tablespace test on PG12.0The tablespace test causes a segfault on PG12.0 due to an upstream bug in the event trigger handling.
8427b9d86735861b925def2bff34f58ea7dbc01038dErik Nordström<erik@timescale.com>Thu May 12 12:53:03 2022 +0200Fix crash and other issues in telemetry reporterMake the following changes to the telemetry reporter background worker: - Add a read lock to the current relation that the reporter collects stats for. This lock protects against concurrent deletion of the relation, which could lead to errors that would prevent the reporter from completing its report. - Set an active snapshot in the telemetry background process for use when scanning a relation for stats collection. - Reopen the scan iterator when collecting chunk compression stats for a relation instead of keeping it open and restarting the scan. The previous approach seems to cause crashes due to memory corruption of the scan state. Unfortunately, the exact cause has not been identified, but the change has been verified to work on a live running instance (thanks to @abrownsword for the help with reproducing the crash and testing fixes). Fixes #4266
84346c95c426c909bf0ffef68a86c1b3724aabcd576Sven Klemm<sven@timescale.com>Fri May 20 13:04:11 2022 +0200Ignore pg_dump test on appveyorOn appveyor the pg_dump is flaky and seems to fail every other time. This patch makes appveyor ignore the result of that test.
844b7472c82ce907490e776d53c76c261db92f855adSven Klemm<sven@timescale.com>Fri May 20 12:41:29 2022 +0200Remove dead codeRemove noop ternary operator in cagg_rebuild_view_definition. We return if finalized is true on line 2475 so the NIL would never be reached in the ternary operator. Found by coverity.
8458c5c7bb4ad6eff5a8c650447c5e7b625389ad40fSven Klemm<sven@timescale.com>Thu May 19 20:53:59 2022 +0200Filter out chunk ids in shared testsMultinode queries use _timescaledb_internal.chunks_in to specify the chunks from which to select data. The chunk id in regresscheck-shared is not stable and may differ depending on execution order leading to flaky tests.
846eab4efa323c760e57e3748dfd89bbcf077ab00acSven Klemm<sven@timescale.com>Thu May 19 14:21:53 2022 +0200Move metrics_dist1 out of shared_setupThe table metrics_dist1 was only used by a single test and therefore should not be part of shared_setup but instead be created in the test that actually uses it. This reduces executed time of regresscheck-shared when that test is not run.
8479b91665162df58e8fe40ca80ad269eed3fe328b2Erik Nordström<erik@timescale.com>Wed May 18 11:56:10 2022 +0200Fix crashes in functions using AlterTableInternalA number of TimescaleDB functions internally call `AlterTableInternal` to modify tables or indexes. For instance, `compress_chunk` and `attach_tablespace` act as DDL commands to modify hypertables. However, crashes occur when these functions are called via `SELECT * INTO FROM <function_name>` or the equivalent `CREATE TABLE AS` statement. The crashes happen because these statements are considered process utility commands and therefore sets up an event trigger context for collecting commands. However, the event trigger context is not properly set up to record alter table statements in this code path, thus causing the crashes. To prevent crashes, wrap `AlterTableInternal` with the event trigger functions to properly initialize the event trigger context.
84854d6b41e65729ed28cb84f44cb390ba917a228f2Dmitry Simonenko<dmitry@timescale.com>Thu May 19 15:52:12 2022 +0300Fix move chunk cleanup logicAdd a new stage "complete" in the "chunk_copy_operation" to indicate successful move/copy chunk operations. Make the "cleanup_copy_chunk_operation" procedure more robust and make it only delete chunk operation entries from the catalog without doing any other unwanted cleanup if called on successful operations.
8498375b9aa536a619a5ac2644e0dae3c25880a4eadJan Nidzwetzki<jan@timescale.com>Wed May 18 18:02:38 2022 +0200Fix a crash in the copy multi-buffer optimizationThis patch solves a crash in the multi-buffer copy optimization, which was introduced in commit bbb2f414d2090efd2d8533b464584157860ce49a. This patch handles closed chunks (e.g., caused by timescaledb.max_open_ chunks_per_insert) properly. The problem is addressed by: 1) Re-reading the ChunkInsertState before the data is stored, which ensures that the underlying table is open. 2) A TSCopyMultiInsertBuffer is deleted after the data of the buffer is flushed. So, operations like table_finish_bulk_insert are executed and the associated chunk can properly be closed.
85043c8e51510b274a648f6919d183d44cfa6d7ce6dSven Klemm<sven@timescale.com>Thu May 19 08:03:50 2022 +0200Fix Var handling for Vars of different level in constify_nowThis patch fixes the constify_now optimization to ignore Vars of different level. Previously this could potentially lead to an assertion failure cause the varno of that varno might be bigger than the number of entries in the rangetable. Found by sqlsmith.
8515193af739624224b8ef288ec2c71bf78ab08b6bdSven Klemm<sven@timescale.com>Wed May 18 18:34:55 2022 +0200Test attnum stays consistent in updateThis patch adds a test for attnum consistency to our update scripts. When attnum between fresh install and updated install is different the updated installation will not be able to correctly process affected catalog tables.
852f1575bb4c31c2ad3d35a361bcf9c991ee7a37911Dmitry Simonenko<dmitry@timescale.com>Wed May 18 18:45:10 2022 +0300Support moving compressed chunks between data nodesThis change allows to copy or move compressed chunks between data nodes by including compressed chunk into the chunk copy command stages.
85311c6813b1d56a0d896b430a98493d7b82c6152ddSven Klemm<sven@timescale.com>Wed May 18 12:59:42 2022 +0200Fix flaky regresscheck-sharedWhile we do filter out chunk ids and hypertable ids from the test output, the output was still unstable when those ids switch between single and double digit as that changes the length of the query decorator in EXPLAIN output. This patch removes this decorator entirely from all shared test output.
854f266f5cf564fcc5509b91493a39eb201c6f5914aFabrízio de Royes Mello<fabriziomello@gmail.com>Wed May 11 19:36:58 2022 -0300Continuous Aggregates finals formFollowing work started by #4294 to improve performance of Continuous Aggregates by removing the re-aggregation in the user view. This PR get rid of `partialize_agg` and `finalize_agg` aggregate functions and store the finalized aggregated (plain) data in the materialization hypertable. Because we're not storing partials anymore and removed the re-aggregation, now is be possible to create indexes on aggregated columns in the materialization hypertable in order to improve the performance even more. Also removed restrictions on types of aggregates users can perform with Continuous Aggregates: * aggregates with DISTINCT * aggregates with FILTER * aggregates with FILTER in HAVING clause * aggregates without combine function * ordered-set aggregates * hypothetical-set aggregates By default new Continuous Aggregates will be created using this new format, but the previous version (with partials) will be supported. Users can create the previous style by setting to `false` the storage paramater named `timescaledb.finalized` during the creation of the Continuous Aggregate. Fixes #4233
855ddd02922c9607b4d81185f7c7e6af8d424ea0328Nikhil Sontakke<nikhil@timescale.com>Mon May 9 18:46:10 2022 +0530Support non-superuser move chunk operationsThe non-superuser needs to have REPLICATION privileges atleast. A new function "subscription_cmd" has been added to allow running subscription related commands on datanodes. This function implicitly upgrades to the bootstrapped superuser and then performs subscription creation/alteration/deletion commands. It only accepts subscriptions related commands and errors out otherwise.
8564988dac27349251591595622baa6180c662d59b2Sven Klemm<sven@timescale.com>Wed May 18 10:59:36 2022 +0200Fix sqlsmith CI workflowCommit 3b35da76 changed the setup script for regresscheck-shared to no longer be usable directly by the sqlsmith workflow. This patch set TEST_DBNAME at the top of the script so it is easier to use the script outside of regression check environment.
857747b532be6bfa3e93decdcb6f89c9432e5e58b48Sven Klemm<sven@timescale.com>Wed May 18 04:14:51 2022 +0200Bump pg version in update testBump PG versions to 12.11, 13.7 and 14.3 in update tests. The update test was skipped with the previous PG version bump because upstream docker images were not yet available which we rely on in the update test.
858d1ed09ce98d5f9a6a849e681536ebdc0ef168981Sven Klemm<sven@timescale.com>Wed May 18 07:26:03 2022 +0200Fix build failure on PG12.0Building against PG12.0 failed with test_utils.c:99:5: error: expected ‘;’ before ‘errmsg’ because the errmsg argument was not in parens.
85935ea80ffdffcdcf3c81af7881c509f33bbeb9924Sven Klemm<sven@timescale.com>Mon May 16 13:59:26 2022 +0200Enable now() usage in plan-time chunk exclusionThis implements an optimization to allow now() expression to be used during plan time chunk exclusions. Since now() is stable it would not normally be considered for plan time chunk exclusion. To enable this behaviour we convert `column > now()` expressions into `column > const AND column > now()`. Assuming that time always moves forward this is safe even for prepared statements. This optimization works for SELECT, UPDATE and DELETE. On hypertables with many chunks this can lead to a considerable speedup for certain queries. The following expressions are supported: - column > now() - column >= now() - column > now() - Interval - column > now() + Interval - column >= now() - Interval - column >= now() + Interval Interval must not have a day or month component as those depend on timezone settings. Some microbenchmark to show the improvements, I did best of five for all of the queries. -- hypertable with 1k chunks -- with optimization select * from metrics1k where time > now() - '5m'::interval; Time: 3.090 ms -- without optimization select * from metrics1k where time > now() - '5m'::interval; Time: 145.640 ms -- hypertable with 5k chunks -- with optimization select * from metrics5k where time > now() - '5m'::interval; Time: 4.317 ms -- without optimization select * from metrics5k where time > now() - '5m'::interval; Time: 775.259 ms -- hypertable with 10k chunks -- with optimization select * from metrics10k where time > now() - '5m'::interval; Time: 4.853 ms -- without optimization select * from metrics10k where time > now() - '5m'::interval; Time: 1766.319 ms (00:01.766) -- hypertable with 20k chunks -- with optimization select * from metrics20k where time > now() - '5m'::interval; Time: 6.141 ms -- without optimization select * from metrics20k where time > now() - '5m'::interval; Time: 3321.968 ms (00:03.322) Speedup with 1k chunks: 47x Speedup with 5k chunks: 179x Speedup with 10k chunks: 363x Speedup with 20k chunks: 540x
86001c6125de66b142a4a7c676c10c04a182c5f8575Sven Klemm<sven@timescale.com>Sat May 14 07:20:22 2022 +0200Reduce repetitions in workflowsDerive postgres major version from full version so we don't have to specify both in matrix.
86154f56af3efba2a3735a406ccb0211584055ee440Sven Klemm<sven@timescale.com>Sat May 14 16:38:13 2022 +0200Support wildcards in IGNORESAdd support for wildcards in IGNORES for regression tests.
862a7c8641e04ca01d9e3a7973a7b3c817a430004ddSven Klemm<sven@timescale.com>Tue May 17 14:00:07 2022 +0200Bump postgres versions used in CIBump postgres versions used in CI to 14.3, 13.7 and 12.11.
863952f536636523e98a51c2133cfaaa99a2e2d3e06Nuno Santos<nunofilipesantos@gmail.com>Fri Feb 11 16:45:31 2022 +0000Add security policy to repositoy
86479d1d3cb3eec221bfe0fe52d9fd5a70c7369d45fKonstantina Skovola<konstantina@timescale.com>Mon May 16 11:51:23 2022 +0300Add GUC "bgw_launcher_poll_time"This GUC permits configuring the TIMEOUT parameter for the background worker launcher in the loader. Fixes #4217
865047d6b175bac4839e90861d25fc25b1446b54bd2Fabrízio de Royes Mello<fabriziomello@gmail.com>Mon May 16 11:47:08 2022 -0300Revert "Pushdown of gapfill to data nodes"This reverts commit eaf3a38fe9553659e515fac72aaad86cf1a06d1e.
8664083e48a1cf62b99e0bc6e40e1ecd454ef5752ecFabrízio de Royes Mello<fabriziomello@gmail.com>Mon May 16 11:39:53 2022 -0300Revert "Add missing gitignore entry"This reverts commit 57411719fb1f5e4d5863089bb4b840abea3bc3db.
867557023c3a7c5edf6e45c0f6003b75796fdab4b7aFabrízio de Royes Mello<fabriziomello@gmail.com>Mon May 16 11:35:36 2022 -0300Revert "Ignore flaky "dist_gapfill_pushdown" test"This reverts commit cf83b3b9c2d899fa0156d5c94dc4848b7584e3c9.
8683b35da7607072de2d7e8fa29eca80a6258bb6026Alexander Kuzmenkov<akuzmenkov@timescale.com>Wed May 11 19:15:32 2022 +0300More tests for errors when fetching from data nodesAdd a special function that allows to inject these errors.
86908a3fca2879a962187ff16709ed6ffadb1d2c057Jan Nidzwetzki<jan@timescale.com>Mon May 16 08:06:43 2022 +0200PostgreSQL license file reference addedThis patch adds a reference to the PostgreSQL license file.
87016d4b3e0b2570622a546625c9a86b9b1752b91b8Sven Klemm<sven@timescale.com>Sun May 15 16:29:31 2022 +0200Restructure planner codeThis patch moves the apache licensed planner code into it's own subdirectory.
871c6c64c4021bb475cb488e0c2043b0a8df40baf7bAlexander Kuzmenkov<akuzmenkov@timescale.com>Thu May 12 21:58:12 2022 +0300Remove unused memory allocation in tuplefactoryIt's in a temporary context, so not a memory leak, but it's just not needed. In passing, clean up the tuple factory error handling code, again.
87292f7e5d36164c1fd955c8b9ef5ed5cd4837ae026Nikhil Sontakke<nikhil@timescale.com>Thu May 5 18:57:35 2022 +0530Support op_id in copy/nove chunk APIAllow users to specify an explicit "operation_id" while carrying out a copy/move operation. If it's specified then that is used as the identifier for the copy/move operation. Otherwise, am implicit id as before gets created and used.
8731d504d5153e757207dc57441fa93a96a0b2a4957Mats Kindahl<mats@timescale.com>Thu May 12 14:28:03 2022 +0200Remove printouts from signal handlersIn #4199 existing calls of `ereport` were replaced with calls of `write_stderr` to eliminate the use of signal-unsafe calls, in particular calls to `malloc`. Unfortunately, `write_stderr` contains a call to `vfprintf`, which allocates memory as well, occationally causing servers that are shutting down to become unresponsive. Since the existing signal handlers just called `die` after printing out a useful message, this commit fixes this by using `die` as a signal handler. Fixes #4200
874356dfa8eb1df807e20af7691d4c0dcb5312f3be5Fabrízio de Royes Mello<fabriziomello@gmail.com>Thu May 12 10:05:10 2022 -0300Refactor upgrade/downgrade setup sql test scriptsThe setup scripts for upgrade/downgrade tests of Continuous Aggregates has too many duplicated code for pre-2.0 tests. Refactor it a bit removing the duplicated code by using `\if \else \endif` psql meta-commands. Also added a properly `round` function to all functions that returns `float8` in SQL scripts because in rare cases it lead to flaky tests. This is part of #4269.
875103b0f53bc2722ef00b2f3f3ee049199e65e34f0Sven Klemm<sven@timescale.com>Thu May 12 11:53:48 2022 +0200Bump pgspot version used in CI to 0.3.0
876efce68ce0de1789b928306933495a9fe731d5c0aSven Klemm<sven@timescale.com>Thu May 12 07:56:57 2022 +0200Remove _PG_fini functions_PG_fini is meant to be the hook to run code on module unload but this code is not working and has not been working for over 12 years because upstream does not support it. https://github.com/postgres/postgres/commit/ab02d702ef08343fba30d90fdf7df5950063e8c9
877bbb2f414d2090efd2d8533b464584157860ce49aJan Nidzwetzki<jan@timescale.com>Thu May 5 09:28:00 2022 +0200Multi-buffer copy optimization backportThis commit backports the Postgres multi-buffer / bulk insert optimization into the timescale copy operator. If the target chunk allows it (e.g., if no triggers are defined on the hypertable or the chunk is not compressed), the data is stored in in-memory buffers first and then flushed to the chunks in bulk operations. Implements: #4080
8785d56b1cdbcff50c868b067f156d6a7a77d7dda6fgayyappan<gayathri@timescale.com>Wed Apr 6 11:57:33 2022 -0400Add api _timescaledb_internal.drop_chunkAdd an internal api to drop a single chunk. This function drops the storage and metadata associated with the chunk. Note that chunk dependencies are not affected. e.g. Continuous aggs are not updated when this chunk is dropped.
879b32ccd03631e40056bdee876db7e524251597225lijunlong<lijunlong@openresty.com>Tue May 10 05:29:20 2022 -0400bugfix: memory leak when call list_qsort.
880c73c5a74b9d40491958c069fd2d6f671845afaddAlexander Kuzmenkov<akuzmenkov@timescale.com>Wed May 11 10:25:09 2022 +0300Avoid extra projection when scanning a compressed chunkWe don't have to project the result of the underlying scan of DecompressChunk, because the latter can selectively decompress the resulting columns anyway. The projection slows down the things especially when we use JIT, when the projection has to be compiled for each chunk. To avoid this unnecessary work, use the physical targetlist for compressed scan if we can. This commit rewrites the function that determines what we have to decompress, and makes it use the targetlist generated by the planner, instead of building it from scratch. Then we can give it the physical targetlist when possible.
881a0e25d9e2447abf17984dd12e5ca6ba04c68f475Sven Klemm<sven@timescale.com>Wed May 11 01:56:37 2022 +0200Remove Ubuntu 21.04 from packages testsUbuntu 21.04 is EOL since january so we no longer need to support and test it.
8829f4dcea30135d1e36d1c452d631fc8b8743b3995gayyappan<gayathri@timescale.com>Thu Apr 7 17:10:47 2022 -0400Add _timescaledb_internal.freeze_chunk APIThis is an internal function to freeze a chunk for PG14 and later. This function sets a chunk status to frozen. Operations that modify the chunk data (like insert, update, delete) are not supported. Frozen chunks can be dropped. Additionally, chunk status is cached as part of classify_relation.
883e81e32fe5c56c39b67f2b24942deed26c0552388Fabrízio de Royes Mello<fabriziomello@gmail.com>Mon May 9 10:37:30 2022 -0300Telemetry Stats for CAggs finals formIntroduced by #4294 and #4269 PRs the default implementation of Continuous Aggregates get rid of `chunk_id` in the materialization hypertable and `partialize_agg`/`finalize_agg` aggregate functions. A new counter named `num_caggs_finalized` was added to telemetry report in this PR to count the number of Continuos Aggregates created in this new format.
884bb241ffcd18b9f3c279e35a0873e0d91f82670c0Sven Klemm<sven@timescale.com>Mon May 9 06:41:22 2022 +0200Add missing ignores for dist_gapfill_pushdownThe patch to ignore result of dist_gapfill_pushdown missed some places that overwrite installcheck_args.
885958489fedbae1905eacbde18e3ea6a2b55358921Sven Klemm<sven@timescale.com>Mon May 9 06:28:50 2022 +0200Disable downgrade test for ubuntu jammyubuntu jammy only has 1 timescaledb version packaged at the moment so downgrade is not possible.
8861e8d37b54ebfed36ff117f208064f37c8916a0f3Fabrízio de Royes Mello<fabriziomello@gmail.com>Fri Apr 29 16:03:36 2022 -0300Remove `chunk_id` from materialization hypertableFirst step to remove the re-aggregation for Continuous Aggregates is to remove the `chunk_id` from the materialization hypertable. Also added new metadata column named `finalized` to `continuous_cagg` catalog table in order to store information about the new following finalized version of Continuous Aggregates that will not need the partials anymore. This flag is important to maintain backward compatibility with previous Continuous Aggregate implementation that requires the `chunk_id` to refresh data properly.
8876e26a1187a1a6c89156deb387ab425a8b10866bbAlexander Kuzmenkov<akuzmenkov@timescale.com>Mon Apr 25 17:53:16 2022 +0300Use binary format in row-by-row fetcherThe general idea is to have two types of fetcher: "fast" and "general purpose". We use the row-by-row fetcher as the "fast" one. This commit removes support of text protocol in this fetcher, because it's only needed for some niche types that don't have a binary serialization, and is also slower than binary one. Because the row-by-row fetcher now only understands binary protocol, we must check that the binary serialization is actually available for the participating data types. If not, we have to revert to using the cursor fetcher unless row-by-row was explicitly requested by the user. This happens at execution time, precisely, at creation of TupleFactory, because that's when we look up the conversion functions. The rest of the commit is removing the text protocol support from row-by-row, plus EXPLAIN changes (we don't know the fetcher type at the planning stage anymore, so not showing it).
888ede62330ee7c83500d57e03be38d3a736114ad55James Guthrie<jguthrie@timescale.com>Thu May 5 18:24:50 2022 +0200Run apt package tests against Ubuntu 22.04 (Jammy Jellyfish)
889b48a727b77d306f8298479ca19b6810297faaaf7Konstantina Skovola<konstantina@timescale.com>Wed May 4 18:44:44 2022 +0300Fix refresh window cap for cagg refreshFixes #4252
890e7076f3be1dbd228b8dafe75e1e90ada6c18b667Sven Klemm<sven@timescale.com>Wed May 4 14:19:58 2022 +0200Remove unused function prototypesCommit 01c724b9 added some prototypes to extension.h but did not add an implementation. This patch removes the unused prototypes.
8919b5b86c490bf314b9a709a5e0cdbc9fe525ca444Alexander Kuzmenkov<akuzmenkov@timescale.com>Mon May 2 18:52:55 2022 +0300Make the test remote_copy stable by adding ORDER BYsCurrently it depends on the (unspecified) order in which the original rows were inserted.
8929b63f4aadd98a7ee57f504a1f6bb80037c772785Sven Klemm<sven@timescale.com>Wed Apr 27 13:16:09 2022 +0200Add more descriptive comment to our CI workflows
893cf83b3b9c2d899fa0156d5c94dc4848b7584e3c9Konstantina Skovola<konstantina@timescale.com>Fri Apr 29 11:44:00 2022 +0300Ignore flaky "dist_gapfill_pushdown" testThis is a *temporary* change to our workflows to ignore the test because it is flaky and requires many jobs to be restarted before a commit can be merged. Does not address the issue that causes the flakiness, which needs to be investigated.
894a4081516cae24f17eeb6241c758d84d90db3d4f6Sven Klemm<sven@timescale.com>Mon May 2 07:16:55 2022 +0200Append pg_temp to search_pathPostgres will prepend pg_temp to the effective search_path if it is not present in the search_path. While pg_temp will never be used to look up functions or operators unless explicitly requested pg_temp will be used to look up relations. Putting pg_temp in search_path makes sure objects in pg_temp will be considered last and pg_temp cannot be used to mask existing objects.
8959012e2a20d16d5219dde6260127c39cc748b8f87Alexander Kuzmenkov<akuzmenkov@timescale.com>Thu Apr 28 12:08:37 2022 +0300Do not create a memory context for each ChunkFor some reason, we create a MemoryContext for each Chunk. This context then is almost never used. Just don't do this.
8964f67ed0656be4168b43b2bb465b5c1c426b1853eSven Klemm<sven@timescale.com>Fri Apr 29 00:15:45 2022 +0200Fix unqualified type reference in time_bucketThis was not caught earlier and is not currently caught by CI because the check for unqualified casts is currently only in main branch of pgspot and not yet in the tagged version we use as part of PR checks.
89797078dde057cf24f0e93176cf72806d3321a2294Alexander Kuzmenkov<akuzmenkov@timescale.com>Fri Apr 22 14:15:18 2022 +0300Enable DecompressChunk node to skip some input columnsNo functional change. This refactoring adds explicit output attnos to the metadata of column decompression, enabling DecompressChunk node to skip some input columns of the compressed scan. This is ultimately needed to support physical targetlists in compressed scan.
898687e7c7233d898c08aa3b1a461b0b7296beb0a3eKonstantina Skovola<konstantina@timescale.com>Thu Apr 21 14:22:58 2022 +0300Fix option "timescaledb.create_group_indexes"Previously this option was ignored when creating a continuous aggregate, even when explicitly set to true. Fixes #4249
8993e042bd9dc3389bd476e4f9a1bd9c14571b438e7gayyappan<gayathri@timescale.com>Wed Apr 20 13:57:43 2022 -0400Fix compress_chunk error messageWhen we have a hypertable with a cagg defined on it, a call to the compress_chunk with the hypertable's chunk returns an unexpected status error. Fix the error message to return "compression not enabled"
900aaffc1d5a69e5242067dd7ce81e5096e3765ec85Mats Kindahl<mats@timescale.com>Fri Apr 22 19:10:45 2022 +0200Set null vector for insert into compressed tableAs part of inserting into a compressed table, the tuple is materialized, which computes the data size for the tuple using `heap_compute_data_size`. When computing the data size of the tuple, columns that are null are not considered and are just ignored. Columns that are dropped are, however, not explicitly checked and instead the `heap_compute_data_size` rely on these columns being set to null. When reading tuples from a compressed table for insert, the null vector is cleared, meaning that it by default is non-null. Since columns that are dropped are not explicitly processed, they are expected to have a defined value, which they do not have, causing a crash when an attempt to dereference them are made. This commit fixes this by setting the null vector to all null, and the code after will overwrite the columns with proper null bits, except the dropped columns that will be considered null. Fixes #4251
901e3f0fbfeff052c72897c527f6cb71c5e83ee4a39Mats Kindahl<mats@timescale.com>Mon Apr 25 13:36:13 2022 +0200Disable 001_extension test on PG12PostgreSQL code for PG12 does not have the method `background_psql` available in `PostgresNode` class for use in TAP testing, causing the test `001_extension` to fail. Fixes #4226
9029fda658075d28b83a5f77fa523f66281648643baSven Klemm<sven@timescale.com>Sat Apr 23 21:34:22 2022 +0200Fix flaky remote_connection testPostgres changed the connection error reporting in the stable branches of PG12, PG13 and PG14 leading to our snapshot tests always failing. This patch removes the checks that now fail with the upstream change. https://github.com/postgres/postgres/commit/ae27b1ac
903a1e76d2e84a0b5c53bf8864f51c7cc365be2e231Alexander Kuzmenkov<akuzmenkov@timescale.com>Thu Apr 21 16:56:05 2022 +0300Follow-up for compressed chunk collation #4236Add a changelog message and add a check for broken chunks to the update script.
904730a72880ee4af60b1380c8bd145800fa0d5b133Alexander Kuzmenkov<akuzmenkov@timescale.com>Thu Apr 21 11:22:31 2022 +0300NFC. Don't add whole row var to compressed scan tlistNo functional change. Construction a whole row var with compressed columns doesn't make sense. It has to be constructed from decompressed columns by projection of DecompressChunk node.
905368e9bb702574a9fc4de9dbdf712432e12668b64Sven Klemm<sven@timescale.com>Thu Apr 21 14:05:36 2022 +0200Add pgspot to CIAdd pgspot to check our installation scripts for following best practices.
906d137c1aa831b9178cae94d3a91b41ab2a3601f7dSven Klemm<sven@timescale.com>Fri Apr 22 09:34:31 2022 +0200Fix unsafe procedure creation in update scriptpost_update_cagg_try_repair was created with `CREATE OR REPLACE` instead of CREATE. Additionally the procedure was created in the public schema. This patch adjusts the procedure to be created with `CREATE` and in a timescaledb internal schema. Found by pgspot.
907ebd232c4fc64c1d59fa75b0707a9317bf0a00ef9Sven Klemm<sven@timescale.com>Fri Apr 22 11:11:16 2022 +0200Ignore spelling fixes in git blameThis patch adds the spelling fix commit to the git blame ignore list and adds a thank you to the changelog for the author. The git blame change couldnt be done in the spelling PR because it references the commit hash.
90868aec9593c0f37dddbaa4f2e2b34a9ba3f5b11d9Josh Soref<jsoref@users.noreply.github.com>Mon Mar 14 11:11:06 2022 -0400Fix various misspellingsThis patch fixes various misspellings of committed, constraint and insufficient in code, comments and documentation.
909b0695e788a7589189b334fb4c72a1176c33ba326Fabrízio de Royes Mello<fabriziomello@gmail.com>Wed Apr 20 16:17:14 2022 -0300Fix flaky distributed grant testsCommit 9b180915 introduce some tests that are a bit flaky because are checking a DEBUG message from Postgres catcache rehashing. Fixed it by teaching our test runner to ignore this Postgres DEBUG message.
910eeb9d133170140540eb41ee8dfb54ebc769b7781Alexander Kuzmenkov<akuzmenkov@timescale.com>Thu Apr 21 13:27:26 2022 +0300Avoid compiling extra projection when constifying the tableoid columnIf we didn't constify anything, no need to recompile the projection. It can be costly if we're using JIT.
911a2c39b9afedc705513725a9a56b2c5c832e6e13fSven Klemm<sven@timescale.com>Thu Apr 21 04:03:45 2022 +0200Fix logic bug in init_privs queryThe query to get the list of saved privileges during extension upgrade had a bug and only applying the classoid restriction for a subset of the entries when it should have been applied to all returned rows leading to a failure during extension update when init privileges for other classoids existed on any of the relevant objects.
912fca865ced948b8cd605fc8dad55a2d0311984b1eSven Klemm<sven@timescale.com>Tue Apr 19 08:49:12 2022 +0200Mark hypertable parent as dummy rel for UPDATEWhen postgres expands an inheritance tree it also adds the parent hypertable as child relation. Since for a hypertable the parent will never have any data we can mark this relation as dummy relation so it gets ignored in later steps. This is only relevant for code paths that use the postgres inheritance code as we don't include the hypertable as child when expanding the hypertable ourself. This is similar to 3c40f924 which did the same adjustment for DELETE. This patch also moves the marking into get_relation_info_hook so it happens a bit earlier and prevents some additional cycles.
9136d40c30d10ef43e8428bd6b3a1415bc5c282ea3aSven Klemm<sven@timescale.com>Wed Apr 20 13:45:12 2022 +0200Fix DELETE statement trigger on hypertables for PG14Commit 3c40f924 accidently broke DELETE statement triggers on PG14 that were only defined on the hypertable itself. This patch fixes the issue and also makes the trigger test no longer pg version specific.
9140f70ae87bfb32122e94978b1d12ccb0ccea58ff4Sven Klemm<sven@timescale.com>Tue Apr 19 04:45:31 2022 +0200Fix flaky truncate testChange truncate test to ignore warnings about potentially orphaned files when dropping the test database. This seems to happen quite frequently on appveyor causing the test to be flaky.
9153c40f924bedbffeb32236c51d0aecdcaa442368aSven Klemm<sven@timescale.com>Mon Apr 18 13:08:00 2022 +0200Mark hypertable parent as dummy relWhen postgres expands an inheritance tree it also adds the parent hypertable as child relation. Since for a hypertable the parent will never have any data we can mark this relation as dummy relation so it gets ignored in later steps. This is only relevant for code paths that use the postgres inheritance code as we don't include the hypertable as child when expanding the hypertable ourself.
9160ab2d39f25d75bec08e724acc9ee5a457b51882eAlexander Kuzmenkov<akuzmenkov@timescale.com>Thu Apr 14 19:13:09 2022 +0300Set correct collation for segmentby columns of compressed chunksWe don't do this currently, so some queries return the wrong ordering of rows if there is an index on the compressed chunk. The fix only works for the newly created chunks. We could add a migration that corrects the old compressed chunks, but it seems to be too heavy and not to lend itself well to automation -- we'll have to recreate the indexes if there are any. So the old chunks continue to return a wrong result.
917472a68726c04f608421626dfef239be199e8b380Sven Klemm<sven@timescale.com>Sun Apr 17 19:51:30 2022 +0200Make hook prefixes consistentReplace the timescale_ prefix on hooks to timescaledb_ because the latter is the correct prefix and to be consistent with names of our other hooks.
918fae7e7cfdc51bf0fb5487e96c1a2029b0dca9546Sven Klemm<sven@timescale.com>Sun Apr 17 19:47:17 2022 +0200Don't export local reorder functionChange reorder_rel function to not be exported and also removes the timescale_ function name prefix from local functions.
919fab16f3798d7219532f9c5a6587b52073b0489d5Markos Fountoulakis<markos@timescale.com>Mon Apr 18 11:31:01 2022 +0300Fix segfault in Continuous AggregatesAdd the missing variables to the finalization view of Continuous Aggregates and the corresponding columns to the materialization table. Cover the case of targets that contain Aggref nodes and Var nodes that are outside of the Aggref nodes at the same time. Stop rebuilding the Continuous Aggregate view with ALTER MATERIALIZED VIEW. Attempt to repair the view at post-update time instead, and fail gracefully if it is not possible to do so without raw hypertable schema or data modifications. Stop rebuilding the Continuous Aggregate view when switching realtime aggregation on and off. Instead, manipulate the User View by either: 1. removing the UNION ALL right-hand side and the WHERE clause when disabling realtime aggregation 2. adding the Direct View to the right of a UNION ALL operator and defining WHERE clauses with the relevant watermark checks when enabling realtime aggregation Fixes #3898
920f3ad916912e640b2a3eb006c2a0d49783f63c8c9Markos Fountoulakis<markos@timescale.com>Thu Apr 14 15:19:49 2022 +0300Fix Coverity defect 376602Fix the potential NULL pointer dereference in ts_dimension_slice_scan_iterator_get_by_id().
921ca6122e01a12938a4049b193aa422c3477008a7cSven Klemm<sven@timescale.com>Sun Apr 17 23:18:54 2022 +0200Fix downgrade test git failureDue to a security vulnerability in git recent git versions now check ownership of files and error out if it doesnt match current user. Since we bind mount the source checkout into the build container the user of the checkout is unlikely to match the user inside the container. This patch configures git to skip the owner check for the bind-mounted directory. https://github.blog/2022-04-12-git-security-vulnerability-announced/
922bb6dc173a0e23981404746a032e487cfd16f73fbFabrízio de Royes Mello<fabriziomello@gmail.com>Fri Apr 8 17:10:12 2022 -0300Set PG14 as default scripts versionSet latest PG14 as the default Postgres version for scripts and some minor fixes.
923bdaa4607d4fa2322e65f779a24f3fa42f47b5b52Sven Klemm<sven@timescale.com>Mon Apr 11 21:46:57 2022 +0200Post release 2.6.1Add 2.6.1 to update and downgrade tests.
924731a39a1226e31efb2d1715156ba2ea2cade3195Konstantina Skovola<konstantina@timescale.com>Fri Apr 8 14:59:58 2022 +0300Fix TRUNCATE error as non-owner on hypertableStop throwing error "must be owner of hypertable" when a user with TRUNCATE privilege on the hypertable attempts to TRUNCATE. Previously we had a check that required TRUNCATE to only be performed by the table owner, not taking into account the user's TRUNCATE privilege, which is sufficient to allow this operation. Fixes #4183
92557411719fb1f5e4d5863089bb4b840abea3bc3dbFabrízio de Royes Mello<fabriziomello@gmail.com>Fri Apr 8 17:01:46 2022 -0300Add missing gitignore entryPull request #4033 introduced a new template SQL test file but missed to add the properly gitgnore entry to ignore generated test files.
9264d47271ad3c365a87c74b911ab16bdf13c0846bdRafia Sabih<rafia.sabih@gmail.com>Tue Apr 5 13:02:29 2022 +02002.6.1 (2022-04-11) This release is patch release. We recommend that you upgrade at the next available opportunity.**Bugfixes** * #3974 Fix remote EXPLAIN with parameterized queries * #4122 Fix segfault on INSERT into distributed hypertable * #4142 Ignore invalid relid when deleting hypertable * #4159 Fix ADD COLUMN IF NOT EXISTS error on compressed hypertable * #4161 Fix memory handling during scans * #4186 Fix owner change for distributed hypertable * #4192 Abort sessions after extension reload * #4193 Fix relcache callback handling causing crashes **Thanks** * @abrownsword for reporting a crash in the telemetry reporter * @daydayup863 for reporting issue with remote explain
927eaf3a38fe9553659e515fac72aaad86cf1a06d1eRafia Sabih<rafia.sabih@gmail.com>Fri Jan 28 10:00:11 2022 +0100Pushdown of gapfill to data nodesAllow the calls of time_bucket_gapfill to be executed at the data nodes for improved query performance. With this, time_bucket_gapfill is pushed to data nodes in the following conditions, 1. when only one data node has all the chunks 2. when space dimension does not overlap across data nodes 3. when group-by matches space dimension
9281b2926c07626280245efddde3fe4103c79d85a2eMats Kindahl<mats@timescale.com>Wed Apr 6 17:30:18 2022 +0200Do not modify aggregation state in finalizeThe function `tsl_finalize_agg_ffunc` modified the aggregation state by setting `trans_value` to the final result when computing the final value. Since the state can be re-used several times, there could be several calls to the finalization function, and the finalization function would be confused when passed a final value instead of a aggregation state transition value. This commit fixes this by not modifying the `trans_value` when computing the final value and instead just returns it (or the original `trans_value` if there is no finalization function). Fixes #3248
929ae50a534852277dc0e2affaaeeedcdac7203b41eSven Klemm<sven@timescale.com>Wed Apr 6 11:04:58 2022 +0200Add chunk exclusion for UPDATE for PG14Currently only IMMUTABLE constraints will exclude chunks from an UPDATE plan, with this patch STABLE expressions will be used to exclude chunks as well. This is a big performance improvement as chunks not matching partitioning column constraints don't have to be scanned for UPDATEs. Since the codepath for UPDATE is different for PG < 14 this patch only adds the optimization for PG14. With this patch the plan for UPDATE on hypertables looks like this: Custom Scan (HypertableModify) (actual rows=0 loops=1) -> Update on public.metrics_int2 (actual rows=0 loops=1) Update on public.metrics_int2 metrics_int2_1 Update on _timescaledb_internal._hyper_1_1_chunk metrics_int2 Update on _timescaledb_internal._hyper_1_2_chunk metrics_int2 Update on _timescaledb_internal._hyper_1_3_chunk metrics_int2 -> Custom Scan (ChunkAppend) on public.metrics_int2 (actual rows=0 loops=1) Output: '123'::text, metrics_int2.tableoid, metrics_int2.ctid Startup Exclusion: true Runtime Exclusion: false Chunks excluded during startup: 3 -> Seq Scan on public.metrics_int2 metrics_int2_1 (actual rows=0 loops=1) Output: metrics_int2_1.tableoid, metrics_int2_1.ctid Filter: (metrics_int2_1."time" = length(version()))
930ff945a7a9449ee3b2b6c1b7cb78f8fa87dbdaa4eAlexander Kuzmenkov<akuzmenkov@timescale.com>Mon Apr 4 12:50:22 2022 +0300Data node scan doesn't support system columns: move this check to an appropriate placeBefore, we would complain that we don't support fetching the system columns with per-data node queries enabled, but still execute the code that fetches it. Don't do this and complain earlier.
931a064fd3b483abdd01d1d1b6f86b6a4cc1e6e6b98Konstantina Skovola<konstantina@timescale.com>Mon Apr 4 14:23:58 2022 +0300Add logging for retention policyAlso remove unused code from compression_api. The function policy_compression_get_verbose_log was unused. Moved it to policy_utils and renamed to policy_get_verbose_log so that it can be used by all policies.
932f2e43900c9248bb869d30496af9a703915f5c01dKonstantina Skovola<konstantina@timescale.com>Mon Apr 4 09:22:23 2022 +0300Update changelog for 4159
933a4b151b024ea6398595041dbb2660f27c3465790Dmitry Simonenko<dmitry@timescale.com>Mon Apr 4 09:40:36 2022 +0300Fix owner change for distributed hypertableAllow ALTER TABLE OWNER TO command to be used with distributed hypertable. Fix #4180
9344ee8872177908f3ae48be1491cb098fae577e54dAlexander Kuzmenkov<akuzmenkov@timescale.com>Thu Mar 31 17:49:31 2022 +0300Use virtual tuples in row-by-row fetcherWe needlessly form/deform the heap tuples currently. Sometimes we do need this when we have row marks and need a ctid (UPDATE RETURNING), but not in this case. The implementation has three parts: 1. Change data fetcher interface to store a tuple into given slot instead of returning a heap tuple. 2. Expose the creation of virtual tuple in tuple factory. 3. Use these facilities in row-by-row fetcher. This gives some small speedup. It will become more important in the future, as other parts of row-by-row fetcher are optimized.
935e16908ccd73f212ce75ed646d8fa9b72a37c65bcSven Klemm<sven@timescale.com>Fri Apr 1 09:51:39 2022 +0200Ignore bulk formatting changes in git blameThis patch adds a .git-blame-ignore-revs that contains a list of commits with bulk formatting changes to be ignored with git blame. This file will be used by GitHub but to use it locally you need to tell git about it eg. with the following command: `git config blame.ignoreRevsFile .git-blame-ignore-revs`
936a154ae56e969a73e1431d6c0a1cac4989f4163acKonstantina Skovola<konstantina@timescale.com>Thu Mar 31 23:26:55 2022 +0300Fix ADD COLUMN IF NOT EXISTS error on compressed hypertableStop throwing exception with message "column of relation already exists" when running the command ALTER TABLE ... ADD COLUMN IF NOT EXISTS ... on compressed hypertables. Fix #4087
937972afe0096149001d204e87f8cc6addea008df52Erik Nordström<erik@timescale.com>Fri Mar 25 14:48:35 2022 +0100Add TAP tests for extension stateAdd a TAP test that checks that the extensions state is updated across concurrent sessions/backends when the extension is "dropped" or "created".
93801c724b9be2ca0eb04d30b043152f051c9b7ea36Erik Nordström<erik@timescale.com>Thu Mar 24 09:31:52 2022 +0100Fix relcache callback handling causing crashesFix a crash that could corrupt indexes when running VACUUM FULL pg_class. The crash happens when caches are queried/updated within a cache invalidation function, which can lead to corruption and recursive cache invalidations. To solve the issue, make sure the relcache invalidation callback is simple and never invokes the relcache or syscache directly or indirectly. Some background: The extension is preloaded and thus have planner hooks installed irrespective of whether the extension is actually installed or not in the current database. However, the hooks need to be disabled as long as the extension is not installed. To avoid always having to dynamically check for the presence of the extension, the state is cached in the session. However, the cached state needs to be updated if the extension changes (altered/dropped/created). Therefore, the relcache invalidation callback mechanism is (ab)used in TimescaleDB to signal updates to the extension state across all active backends. The signaling is implemented by installing a dummy table as part of the extension and any invalidation on the relid for that table signals a change in the extension state. However, as of this change, the actual state is no longer determined in the callback itself, since it requires use of the relcache and causes the bad behavior. Therefore, the only thing that remains in the callback after this change is to reset the extension state. The actual state is instead resolved on-demand, but can still be cached when the extension is in the installed state and the dummy table is present with a known relid. However, if the extension is not installed, the extension state can no longer be cached as there is no way to signal other backends that the state should be reset when they don't know the dummy table's relid, and cannot resolve it from within the callback itself. Fixes #3924
9399c46a5d5c6e2d5020db5c07de52b2fc15e0e4131Mats Kindahl<mats@timescale.com>Thu Mar 24 12:46:22 2022 +0100Abort sessions after extension reloadIf a session is started and loads (and caches, by OID) functions in the extension to use them in, for example, a `SELECT` query on a continuous aggregate, the extension will be marked as loaded internally. If an `ALTER EXTENSION` is then executed in a separate session, it will update `pg_extension` to hold the new version, and any other sessions will see this as the new version, including the session that already loaded the previous version of the shared library. Since the pre-update session has loaded some functions from the old version already, running the same queries with the old named functions will trigger a reload of the new version of the shared library to get the new functions (same name, but different OID), but since this has already been loaded in a different version, it will trigger an error that GUC variables are re-defined. Further queries after that will then corrupt the database causing a crash. This commit fixes this by recording the version loaded rather than if it has been loaded and check that the version did not change after a query has been analyzed (in the `post_analyze_hook`). If the version changed, it will generate a fatal error to force an abort of the session. Fixes #4191
940915bd032bda0e99c276c719595b0bf92e2e8ce43Konstantina Skovola<konstantina@timescale.com>Fri Mar 18 13:22:37 2022 +0200Fix spelling errors and omissions
94181b71b685ce56388e0851c4362de36781cfcc646Mats Kindahl<mats@timescale.com>Tue Mar 29 18:16:11 2022 +0200Remove signal-unsafe calls from signal handlersFunctions `elog` and `ereport` are unsafe to use in signal handlers since they call `malloc`. This commit removes them from signal handlers. Fixes #4200
942347b45f109e0a7ce642377715b931fe900333e2fSven Klemm<sven@timescale.com>Tue Feb 1 00:32:51 2022 +0100Add chunk exclusion for DELETE for PG14Currently only IMMUTABLE constraints will exclude chunks from a DELETE plan, with this patch STABLE expressions will be used to exclude chunks as well. This is a big performance improvement as chunks not matching partitioning column constraints don't have to be scanned for DELETEs. Additionally this improves usability of DELETEs on hypertables with some chunks compressed. Previously you weren't able to do DELETE on those hypertables which had non-IMMUTABLE constraints. Since the codepath for DELETE is different for PG < 14 this patch only adds the optimization for PG14. With this patch the plan for DELETE on hypertables looks like this: Custom Scan (HypertableModify) (actual rows=0 loops=1) -> Delete on metrics (actual rows=0 loops=1) Delete on metrics metrics_1 Delete on _hyper_5_8_chunk metrics Delete on _hyper_5_11_chunk metrics Delete on _hyper_5_12_chunk metrics Delete on _hyper_5_13_chunk metrics Delete on _hyper_5_14_chunk metrics_2 -> Custom Scan (ChunkAppend) on metrics (actual rows=1 loops=1) Chunks excluded during startup: 4 -> Seq Scan on metrics metrics_1 (actual rows=0 loops=1) Filter: ("time" > (now() - '3 years'::interval)) -> Bitmap Heap Scan on _hyper_5_14_chunk metrics_2 (actual rows=1 loops=1) Recheck Cond: ("time" > (now() - '3 years'::interval)) Heap Blocks: exact=1 -> Bitmap Index Scan on _hyper_5_14_chunk_metrics_time_idx (actual rows=1 loops=1) Index Cond: ("time" > (now() - '3 years'::interval))
943935684c83a4de3f82dabf1d2aa0ae7bae3a18ca2Alexander Kuzmenkov<akuzmenkov@timescale.com>Wed Mar 9 19:31:28 2022 +0300Cache whether a rel is a chunk in classify_relationUse a per-query hash table for this. This speeds up the repeated calls to classify_relation by avoiding the costly chunk lookup.
944ae79ba6eb4d13a2f4bd6140bc2db5ea8e192385cAlexander Kuzmenkov<akuzmenkov@timescale.com>Tue Mar 15 18:41:40 2022 +0300Scan less chunk metadata when planning ForeignModifyInstead of loading the entire Chunk struct, just look up the data nodes.
945fb8dec9fa4f60141680801fba9919bec6f47f877Rafia Sabih<rafia.sabih@gmail.com>Wed Feb 2 15:51:34 2022 +0100Update comments to Postgresql standard style
946c1cf067c4f63c5a40fd61a1782b3422d11336090Erik Nordström<erik@timescale.com>Tue Feb 22 19:03:43 2022 +0100Improve restriction scanning during hypertable expansionImprove the performance of metadata scanning during hypertable expansion. When a hypertable is expanded to include all children chunks, only the chunks that match the query restrictions are included. To find the matching chunks, the planner first scans for all matching dimension slices. The chunks that reference those slices are the chunks to include in the expansion. This change optimizes the scanning for slices by avoiding repeated open/close of the dimension slice metadata table and index. At the same time, related dimension slice scanning functions have been refactored along the same line. An index on the chunk constraint metadata table is also changed to allow scanning on dimension_slice_id. Previously, dimension_slice_id was the second key in the index, which made scans on this key less efficient.
947966c5eb2c2007374371b3880a33c06d8446a2724Nikhil Sontakke<nikhil@timescale.com>Thu Mar 17 14:02:31 2022 +0530Fix remote EXPLAIN with parameterized queriesIn certain multi-node queries, we end up using a parameterized query on the datanodes. If "timescaledb.enable_remote_explain" is enabled we run an EXPLAIN on the datanode with the remote query. EXPLAIN doesn't work with parameterized queries. So, we check for that case and avoid invoking a remote EXPLAIN if so. Fixes #3974 Reported and test case provided by @daydayup863
948e101b3ea60760f1091fa19634c1c15982d4768ddSven Klemm<sven@timescale.com>Fri Mar 18 16:24:40 2022 +0100Set minimum required cmake version to 3.10cmake > 3.10 is not packaged for some of the platforms we build packages eg old ubuntu and debian version. Currently we modify the CMakeLists.txt in those build environments and set the minimum version to 3.10 already, which proofes that timescaledb builds fine with cmake 3.10.
949566a4ff104924c99ef452e7feccaee2ad31fc47dSven Klemm<sven@timescale.com>Fri Mar 18 05:33:35 2022 +0100Route UPDATE through HypertableModifyRoute UPDATE on Hypertables through our custom HypertableModify node. This patch by itself does not make any other changes to UPDATE but is the foundation for other features regarding UPDATE on hypertables.
950846878c6bb93fd8481af0d8a547e12897b7f4876Erik Nordström<erik@timescale.com>Wed Mar 16 11:10:29 2022 +0100Ensure scan functions use long-lived memory contextPostgreSQL scan functions might allocate memory that needs to live for the duration of the scan. This applies also to functions that are called during the scan, such as getting the next tuple. To avoid situations when such functions are accidentally called on, e.g., a short-lived per-tuple context, add a explicit scan memory context to the Scanner interface that wraps the PostgreSQL scan API.
951b954c00fa8136c87870302ad0297e704f280e2c7Erik Nordström<erik@timescale.com>Fri Mar 11 17:46:05 2022 +0100Fix memory handling during scansScan functions cannot be called on a per-tuple memory context as they might allocate data that need to live until the end of the scan. Fix this in a couple of places to ensure correct memory handling. Fixes #4148, #4145
952a759b2b2b9b855975f48d71e6bdf7af1cbf8c917Sven Klemm<sven@timescale.com>Thu Mar 17 11:32:23 2022 +0100Show number of chunks excluded in ConstraintAwareAppend EXPLAINThis patch changes the ConstraintAwareAppend EXPLAIN output to show the number of chunks excluded instead of the number of chunks left. The number of chunks left can be seen from other EXPLAIN output while the actual number of exclusions that happened can not. This also makes the output consistent with output of ChunkAppend.
953ce3e04a9ec945f8734cc5cdd0a258e8130d5c210Fabrízio de Royes Mello<fabriziomello@gmail.com>Tue Mar 15 15:25:46 2022 -0300Rename forgotten `master` branch name references
954332dffeebc72cf16afbde802e2f19aead9bd7836Fabrízio de Royes Mello<fabriziomello@gmail.com>Mon Mar 14 14:10:14 2022 -0300Rename `master` branch to `main`Following what many communities already did we agreed in renaming the `master` branch to `main`. Resources: - https://sfconservancy.org/news/2020/jun/23/gitbranchname/ - https://postgr.es/m/20200615182235.x7lch5n6kcjq4aue@alap3.anarazel.de Closes #4163
955077b2edbc556bbcfb104992effdb6fe6dd89cc3bSven Klemm<sven@timescale.com>Tue Mar 15 15:22:14 2022 +0100Change ChunkAppend file organizationThis patch changes the organization of the ChunkAppend code. It removes all header files except chunk_append/chunk_append.h. It also merges exec.c and explain.c to remove unnecessary function exports, since the code from explain.c was only used by exec.c
956cc89f1dc847bf825b5502d72769b931e3502373fSven Klemm<sven@timescale.com>Tue Mar 15 13:14:43 2022 +0100Remove duplicate contain_param functionsThis patch exports the contain_param function in planner.c and changes ChunkAppend to use that version instead of having two implementations of that function.
957f00bdadf0c4d7465411fe7f349a19953ca401498Erik Nordström<erik@timescale.com>Mon Mar 14 13:47:43 2022 +0100Trigger Sqlsmith tests manually or by push to branchAdd workflow events to allow manually running Sqlsmith tests or when pushing to the 'sqlsmith' branch. This is useful when submitting PRs that one wants to run extra checks on, including Sqlsmith.
958ab6b90caff19e0193ceb58ba298280daf03a6adbSven Klemm<sven@timescale.com>Mon Mar 14 11:44:05 2022 +0100Reference CVE ID in CHANGELOGThe CVE ID was already referenced in the commit introducing the fix but not in the CHANGELOG.
959f5fd06cabb044a4b7f1fba694aeb9b1fbec87afcMats Kindahl<mats@timescale.com>Fri Mar 4 15:10:09 2022 +0100Ignore invalid relid when deleting hypertableWhen running `performDeletion` is is necessary to have a valid relation id, but when doing a lookup using `ts_hypertable_get_by_id` this might actually return a hypertable entry pointing to a table that does not exist because it has been deleted previously. In this case, only the catalog entry should be removed, but it is not necessary to delete the actual table. This scenario can occur if both the hypertable and a compressed table are deleted as part of running a `sql_drop` event, for example, if a compressed hypertable is defined inside an extension. In this case, the compressed hypertable (indeed all tables) will be deleted first, and the lookup of the compressed hypertable will find it in the metadata but a lookup of the actual table will fail since the table does not exist. Fixes #4140
960f82df7ca4a6e6521daeb02f83db1548e7ed380aeDmitry Simonenko<dmitry@timescale.com>Fri Mar 11 10:25:38 2022 +0200Allow ANALYZE command on a data node directlyAllow execution of VACUUM/ANALYZE commands on a data node without enabling timescaledb.enable_client_ddl_on_data_nodes GUC Fix #4157
9618f56ced825c2a1df543ac1c7646707c10f400202Sven Klemm<sven@timescale.com>Mon Mar 7 17:51:59 2022 +0100Add workflow for running sqlsmithsqlsmith is a random SQL query generator and very useful for finding bugs in our implementation as it tests complex queries and thereby hits codepaths and interactions between different features not tested in our normal regression checks.
96206d837559484c21165cb3429dfdd91c8606973f3Sven Klemm<sven@timescale.com>Tue Mar 8 11:15:22 2022 +0100Enhance extension function testThis patch changes the extension function list to include the signature as well since functions with different signature are separate objects in postgres. This also changes the list to include all functions. Even though functions in internal schemas are not considered public API they still need be treated the same as functions in other schemas with regards to extension upgrade/downgrade. This patch also moves the test to regresscheck-shared since we do not dedicated database to run these tests.
96333bbdccdcd7ad805c3463ba6426dea0510497ed1Fabrízio de Royes Mello<fabriziomello@gmail.com>Mon Mar 7 11:12:46 2022 -0300Refactor function `hypertable_local_size`Reorganize the code and fix minor bug that was not computing the size of FSM, VM and INIT forks of the parent hypertable. Fixed the bug by exposing the `ts_relation_size` function to the SQL level to encapsulate the logic to compute `heap`, `indexes` and `toast` sizes.
96418afcfd62f3c7235c839eb15235c2318fbeec85cFabrízio de Royes Mello<fabriziomello@gmail.com>Thu Mar 3 15:14:18 2022 -0300Refactor function `ts_relation_size`Current implementation iterate over fork types to calculate the size of each one by calling `pg_relation_size` PostgreSQL function and other calls to calculate indexes and table size (six function calls). Improving it by halving PostgreSQL function calls to calculate the size of the relations (now three function calls).
965e9fb9acbbbe2c7da2c3769fb7374dda9a7d8ad11Markos Fountoulakis<markos@timescale.com>Thu Mar 3 11:47:36 2022 +0200Fix regressions found in nightly CIAdd concurrent_query_and_drop_chunks to ignore-list and fix C compiler warning.
96615d33f0624595470cdb3b417deecefe8c12639ebMats Kindahl<mats@timescale.com>Thu Nov 25 10:18:10 2021 +0100Add option to compile without telemetryAdd option `USE_TELEMETRY` that can be used to exclude telemetry from the compile. Telemetry-specific SQL is moved, which is only included when extension is compiled with telemetry and the notice is changed so that the message about telemetry is not printed when Telemetry is not compiled in. The following code is not compiled in when telemetry is not used: - Cross-module functions for telemetry. - Checks for telemetry job in job execution. - GUC variables `telemetry_level` and `telemetry_cloud`. Telemetry subsystem is not included when compiling without telemetry, which requires some functions to be moved out of the telemetry subsystem: - Metadata handling is moved out of the telemetry module since it is used not only with telemetry. - UUID functions are moved into a separate module instead of being part of the telemetry subsystem. - Telemetry functions are either added or removed when updating from a previous version. Tests are updated to: - Not use telemetry functions to get UUID or Metadata and instead use the moved UUID and metadata functions. - Not include telemetry information in tests that do not require it. - Configuration files do not set telemetry variables when telemetry is not compiled in. - Replaced usage of telemetry functions in non-telemetry tests with other sources of same information. Fixes #3931
967642a745767c925a12b4b68359c69ff496a276bacSven Klemm<sven@timescale.com>Wed Mar 2 12:30:16 2022 +0100Fix arm64 apt package testThis patch changes the workflow to run apt-get update before installing any packages in case the local package database is outdated and references packages no longer available.
968b909d4857db23ed38b0cb4a825cefe76f0ef7401Mats Kindahl<mats@timescale.com>Thu Feb 24 14:49:10 2022 +0100Fixes to smoke update testsSmoke tests where missing critical files and some tests had changed since last run and did not handle update smoke tests, so fixing all necessary issues.
96914deea6bd59c3afa81a4469012911d265242a49aErik Nordström<erik@timescale.com>Fri Feb 18 17:05:18 2022 +0100Improve chunk scan performanceChunk scan performance during querying is improved by avoiding repeated open and close of relations and indexes when joining chunk information from different metadata tables. When executing a query on a hypertable, it is expanded to include all its children chunks. However, during the expansion, the chunks that don't match the query constraints should also be excluded. The following changes are made to make the scanning and exclusion more efficient: * Ensure metadata relations and indexes are only opened once even though metadata for multiple chunks are scanned. This avoids doing repeated open and close of tables and indexes for each chunk scanned. * Avoid interleaving scans of different relations, ensuring better data locality, and having, e.g., indexes warm in cache. * Avoid unnecessary scans that repeat work already done. * Ensure chunks are locked in a consistent order (based on Oid). To enable the above changes, some refactoring was necessary. The chunk scans that happen during constraint exclusion are moved into separate source files (`chunk_scan.c`) for better structure and readability. Some test outputs are affected due to the new ordering of chunks in append relations.
97032c1e3aef293bcece63550e09c3dd3496368a687Erik Nordström<erik@timescale.com>Thu Feb 10 16:42:56 2022 +0100Allow control of relation open/close in ScannerMake the Scanner module more flexible by allowing optional control over when the scanned relation is opened and closed. Relations can then remain open over multiple scans, which can improve performance and efficiency. Closes #2173
9710f351ff6128e9765f993fe5ed713bd274a3fd2a7Erik Nordström<erik@timescale.com>Thu Feb 10 15:55:28 2022 +0100Simplify Scanner by embedding internal stateAs part of adding a scan iterator interface on top of the Scanner module (commit 8baaa98), the internal scanner state that was previously private, was made public. Now that it is public, it makes more sense to make it part of the standard user-facing `ScannerCtx` struct, which also simplifies the code elsewhere.
97291820e26f663eb2210080092b75a290a491424f6Sven Klemm<sven@timescale.com>Wed Feb 23 17:33:45 2022 +0100Improve planner error messages regarding nodesChange error messages when unexpected nodes are encountered to actually show the node name instead of the node id.
9733f303c7d42da6e76f610bfb67d017134318cf7edSven Klemm<sven@timescale.com>Wed Feb 23 13:19:34 2022 +0100Refactor tsl_debug_append_pathThis patch splits the node name logic from the child path logic to allow getting a string representation for any postgres node. This adds a new function: const char * ts_get_node_name(Path *path) This patch doesn't add any new callers to the function but it will be used in subsequent patches to produce more user friendly error messages when unexpected node types are encountered during planning.
97457368dd98ecba8290008e36c578534612b9e7533Dmitry Simonenko<dmitry@timescale.com>Tue Feb 22 13:27:14 2022 +0300Fix RENAME TO/SET SCHEMA on distributed hypertableThis PR fixes ON_END logic for distributed DDL execution by removing old leftover check, which marked those commands as unsupported. Fix: #4106
975a4648b11b4979ecc2d5d393585a7ce1a812dff0aSven Klemm<sven@timescale.com>Wed Feb 23 02:59:19 2022 +0100Fix segfault on INSERT in distributed hypertablesWhen inserting in a distributed hypertable with a query on a distributed hypertable a segfault would occur when all the chunks on the query would get pruned.
97658fd0c5cef56e638f8ed03204c399c0e76e9a164Sven Klemm<sven@timescale.com>Sun Feb 20 22:12:34 2022 +0100Test APT ARM64 packagesAdd tests for ARM64 Debian and Ubuntu packages
97737190e8a8aaaecd3a906b092c54527ca987e02e5Alexander Kuzmenkov<akuzmenkov@timescale.com>Mon Feb 21 13:20:47 2022 +0300Cache chunk data when performing chunk exclusionWe cache the Chunk structs in RelOptInfo private data. They are later used to estimate the chunk sizes, check which data nodes they belong to, et cetera. Looking up the chunks is expensive, so this change speeds up the planning.
9780f7ab056c23f6a5b214858885123d40b4a42065eDmitry Simonenko<dmitry@timescale.com>Mon Feb 21 11:11:28 2022 +0300Move copy/move chunk tests to separate fileFix flaky data_node test by moving tests associated with copy/move chunk functionality into a separate test file/groupand with increased background workers (using max_bgw_8.conf). Issue: #4047
979eedaaecc46966c75983f34e269fb28f7c8ae7277Aleksander Alekseev<aleksander@timescale.com>Wed Feb 16 16:38:24 2022 +0300Custom origin's support in CAGGsThis patch allows using custom origin's in CAGGs, for instance: time_bucket_ng('7 days', day, '2000-01-03' :: date) AS bucket For weekly buckets this allows the user to choose what should be considered the beginning of the week - Sunday or Monday. Also by shifting the origin one second forward or backward user can tweak the inclusiveness of the buckets. This works for date's, timestamp's and timestamptz's. The bucket size is considered variable-sized in all these cases. CAGGs on top of distributed hypertables, compressed hypertables and compressed distributed hypertables are supported as well. Additionally, this patch does several small refactorings. Firstly, it makes sure that experimental features of CAGGs will be tested in both Debug and Release builds. This was previously overlooked. Secondly, it renames the tests so that a person who is working on experimental features in CAGGs will be able to easily execute all the related tests: `TESTS='exp_cagg_*' make installcheck` Last but not least the patch refactors is_valid_bucketing_function() and renames it to function_allowed_in_cagg_definition(). The reason to do it in this patch is that otherwise, the logic of the function gets rather confusing which complicates code review. fix
98045cf7f1fa1e2c00afde506bfada625af9d7d4eb3Sven Klemm<sven@timescale.com>Sat Feb 12 18:05:20 2022 +0100Document requirements for statements in sql filesSince we now lock down search_path during update/downgrade there are some additional requirements for writing sql files.
981f29340281e47a4bade690e0b81c1ef6f18507834Alexander Kuzmenkov<akuzmenkov@timescale.com>Thu Feb 17 19:32:58 2022 +0300Post release 2.6.0
982df49c2b4cbba831cbd6c8d5e4f88a7a7b781c3acSven Klemm<sven@timescale.com>Thu Feb 17 21:26:52 2022 +0100Fix non-debug build with older cmakeOn non-debug builds we might end up with an empty list of tests when generating the schedule. On older cmake versions < 3.14 trying to sort an empty list will produce an error, so we check for empty list here.
9839e7fbf7f6982bad80cd0129d38dcf6273baad2a2Alexander Kuzmenkov<akuzmenkov@timescale.com>Mon Feb 14 12:19:41 2022 +0300Release 2.6.0This release is medium priority for upgrade. We recommend that you upgrade at the next available opportunity. This release adds major new features since the 2.5.2 release, including: Compression in continuous aggregates Experimental support for timezones in continuous aggregates Experimental support for monthly buckets in continuous aggregates It also includes several bug fixes. Telemetry reports are switched to a new format, and now include more detailed statistics on compression, distributed hypertables and indexes. **Features** * #3768 Allow ALTER TABLE ADD COLUMN with DEFAULT on compressed hypertable * #3769 Allow ALTER TABLE DROP COLUMN on compressed hypertable * #3943 Optimize first/last * #3945 Add support for ALTER SCHEMA on multi-node * #3949 Add support for DROP SCHEMA on multi-node **Bugfixes** * #3808 Properly handle max_retries option * #3863 Fix remote transaction heal logic * #3869 Fix ALTER SET/DROP NULL contstraint on distributed hypertable * #3944 Fix segfault in add_compression_policy * #3961 Fix crash in EXPLAIN VERBOSE on distributed hypertable * #4015 Eliminate float rounding instabilities in interpolate * #4019 Update ts_extension_oid in transitioning state * #4073 Fix buffer overflow in partition scheme **Improvements** Query planning performance is improved for hypertables with a large number of chunks. **Thanks** * @fvannee for reporting a first/last memory leak * @mmouterde for reporting an issue with floats and interpolate
984fc5341c47bc7af4163aa2acc0fae5c10f2881238Alexander Kuzmenkov<akuzmenkov@timescale.com>Wed Feb 16 20:37:33 2022 +0300Increase psql verbosity to see error line numbers in remote_connection test
9852bc3efa44ed50e6d3cffd6ed3276a473650df33dErik Nordström<erik@timescale.com>Wed Feb 16 11:17:07 2022 +0100Add missing OS-information in telemetrySome telemetry fields were removed by mistake as part of an earlier refactoring. Add back the missing fields that provide information about the operating system.
986a956faaa16db96b6feda50c5d454fbcc7adc2562Sven Klemm<sven@timescale.com>Tue Feb 15 22:27:24 2022 +0100Set search_path again after COMMITSET LOCAL is only active until end of transaction so we set search_path again after COMMIT in functions that do transaction control. While we could use SET at the start of the function we do not want to bleed out search_path to caller.
987264540610e02f7f46d3213c103b66b07c1ce12c5gayyappan<gayathri@timescale.com>Mon Feb 7 13:59:37 2022 -0500Fix tablespace for compressed chunk's indexWhen a hypertable uses a non default tablespace, based on attach_tablespace settings, the compressed chunk's index is still created in the default tablespace. This PR fixes this behavior and creates the compressed chunk and its indexes in the same tablespace. When move_chunk is executed on a compressed chunk, move the indexes to the specified destination tablespace. Fixes #4000
98872d03e6f7d30cc4794c9263445f14199241e2eb5Sven Klemm<sven@timescale.com>Sat Feb 12 17:02:03 2022 +0100Remove search_path modifications from reverse-devResetting search_path in reverse-dev was necessary before the release of 2.5.2 as the previous timescaledb version scripts didn't handle locked down search_path. We can remove setting search_path too as the downgrade script includes pre-update.sql which locks down search_path.
98965ffa44711d3bc0d58563ff8179706819095d27cSven Klemm<sven@timescale.com>Sat Feb 12 02:55:54 2022 +0100Bump postgres versions used in CI to 14.2, 13.6, 12.10
990531f7ed8b16e4d1a99021d3d2b843bbc939798e3Sven Klemm<sven@timescale.com>Thu Feb 10 19:32:22 2022 +0100Don't use pg_temp in update scriptsScripts run under pgextwlist cannot use pg_temp so we replace pg_temp usage in update scripts with _timescaledb_internal.
991ee9b9ad318719b715caeebd20875692e80ff82dcAleksander Alekseev<aleksander@timescale.com>Fri Feb 11 00:21:25 2022 +0300time_bucket_ng() bugfixtime_bucket_ng() may return wrong results for monthly buckets with overwritten origin. As an example: time_bucket_ng('1 month', '2001-01-01' :: date, origin => '2000-06-01') ... returns 2000-01-01 instead of 2001-01-01. In fact, our tests showed this but we overlooked the fact that the results are incorrect. The reason is that the month of the origin is not accounted for when calculating the resulting year. This patch fixes this. Also it updates linux-32bit-build-and-test.yaml workflow due to todays 14.2/13.6/12.10 releases. "Memoize" test doesn't pass on 14.2 thus the patch adds it to the list of skipped tests. The patch doesn't rename the checks because we list "PG14.1 Debug linux-i386" etc as required checks on GitHub. This will be addressed in the follow-up patches.
992d3d0b8d94323af01f2a83316c3d7e67ee1181a98Markos Fountoulakis<markos@timescale.com>Thu Feb 10 07:33:18 2022 +0200Fix memcpy in force_group_by_push_down
993c56b33d2e778fbf5975cfadfae3748df218d6731Sven Klemm<sven@timescale.com>Thu Feb 10 00:16:52 2022 +0100Fix openssl detection for PG14PG14 introduced an alternative way to specify for postgres to be built with openssl support. --with-ssl=openssl may be used instead of --with-openssl. This patch adjusts our openssl check to detect both versions. https://github.com/postgres/postgres/commit/fe61df7f82
99485e3307dd130c61b8dab20b6551ca66a1703dd6bSven Klemm<sven@timescale.com>Thu Feb 10 10:59:22 2022 +0100Adjust pg_md5_hash compat macro to upstream changesThe API for pg_md5_hash was changed for PG15 which was initially backported to the PG14 branch but that commit was later reverted to not introduce an ABI breakage for extensions. https://github.com/postgres/postgres/commit/ad5b6f24 https://github.com/postgres/postgres/commit/b69aba74
995c07fe1f88374a68707e54121c983b27fd59e5a20Sven Klemm<sven@timescale.com>Wed Feb 9 23:52:34 2022 +0100Post Release 2.5.2Add 2.5.2 to update/downgrade scripts
996f0d163603c1797442e2acffc31ce135a0d38b820Sven Klemm<sven@timescale.com>Wed Feb 9 19:47:10 2022 +0100Release 2.5.2This release contains bug fixes since the 2.5.1 release. This release is high priority for upgrade. We strongly recommend that you upgrade as soon as possible. **Bugfixes** * #3900 Improve custom scan node registration * #3911 Fix role type deparsing for GRANT command * #3918 Fix DataNodeScan plans with one-time filter * #3921 Fix segfault on insert into internal compressed table * #3938 Fix subtract_integer_from_now on 32-bit platforms and improve error handling * #3939 Fix projection handling in time_bucket_gapfill * #3948 Avoid double PGclear() in data fetchers * #3979 Fix deparsing of index predicates * #4015 Eliminate float rounding instabilities in interpolate * #4020 Fix ALTER TABLE EventTrigger initialization * #4024 Fix premature cache release call * #4037 Fix status for dropped chunks that have catalog entries * #4069 Fix riinfo NULL handling in ANY construct * #4071 Fix extension installation privilege escalation * #4073 Fix buffer overflow in partition scheme **Thanks** * @carlocperez for reporting crash with NULL handling in ANY construct * @erikhh for reporting an issue with time_bucket_gapfill * @fvannee for reporting a first/last memory leak * @kancsuki for reporting drop column and partial index creation not working * @mmouterde for reporting an issue with floats and interpolate * Pedro Gallegos for reporting a possible privilege escalation during extension installation Security: CVE-2022-24128
9978a33a79e0c489ddc15f252e710dab61aa96c4e82Markos Fountoulakis<markos@timescale.com>Wed Feb 9 18:35:19 2022 +0200Fix buffer overflow in partition schemeReallocate the partitioning attributes arrays when forcing GROUP BY aggregates down. Fixes #4050
9986dddfaa54e8f29e3ea41dab2fe7d9f3e37cd3aaeSven Klemm<sven@timescale.com>Tue Feb 8 20:02:55 2022 +0100Lock down search_path in install scriptsThis patch locks down search_path in extension install and update scripts to only contain pg_catalog, this requires that any reference in those scripts is fully qualified. Additionally we add explicit create commands to all update scripts for objects added to the public schema. This change will make update scripts fail if a function with identical signature already exists when installing or upgrading instead reusing the existing object.
999c8b8516e466c2bb7d2ae6a4b0b2e8e60b24b24a2Sven Klemm<sven@timescale.com>Tue Feb 8 19:55:28 2022 +0100Fix extension installation privilege escalationTimescaleDB was vulnerable to a privilege escalation attack in the extension installation script. An attacker could precreate objects normally owned by the extension and get those objects used in the installation script since the script would only try to create them if they did not already exist. Thanks to Pedro Gallegos for reporting the problem. This patch changes the schema, table and function creation to fail and abort the installation when the object already exists instead of using the existing object. Security: CVE-2022-24128
10007fb3feb60d72fef164940b5dd6d26ef1201e4988Erik Nordström<erik@timescale.com>Wed Feb 9 08:34:18 2022 +0100Use proper types in telemetry JSONMany fields in the generated telemetry JSON output values as strings instead of using integer or boolean types. Change those fields to use the type that match the original data.
10015af9f45488d51027804cac16362811f71a89bb64Erik Nordström<erik@timescale.com>Tue Feb 8 09:57:23 2022 +0100Add extra telemetry for continuous aggregatesAdd the following telemetry fields for continuous aggregates: * The number of continuous aggregates created on distributed hypertables * The number of continuous aggregates using real-time aggregation
1002e19fffc1482cf0a532ab252ac440bf52f9d8bf96Nikhil Sontakke<nikhil@timescale.com>Wed Feb 9 13:07:44 2022 +0530Fix riinfo NULL handling in ANY constructIf the ANY construct contains a singleton NULL then the logic in "dimension_values_create_from_array" barfs causing a crash. Fix it appropriately in the caller "hypertable_restrict_info_add_expr" function.
1003454d32539ce47c1775c136e68a615d3453ee3ac1Aleksander Alekseev<aleksander@timescale.com>Tue Feb 8 12:33:30 2022 +0300Fix "nm: unknown argument -defined-only" error on MacOSOn MacOS Monterey with LLVM 13.0.1 when executing export_prefix_check.sh we get an error: /usr/local/opt/llvm/bin/nm: error: : unknown argument '-defined-only', did you mean '--defined-only'? This patch adds a better check of which flag does `nm` expect.
1004418d71c2fef7978ec6350669fb01d2d076039d8fErik Nordström<erik@timescale.com>Fri Feb 4 11:40:39 2022 +0100Rename telemetry testAll TSL-related telemetry testing was moved into the `telemetry_community` test, which has a name that is no longer accurate (given that it tests non-community features). Rename this test to `telemetry_stats`, which also doesn't conflict with the non-TSL `telemetry` test.
1005e56b95daec0f9fbf55d99b984d6236c1bbd4358cErik Nordström<erik@timescale.com>Fri Jan 28 08:38:08 2022 +0100Add telemetry stats based on type of relationRefactor the telemetry function and format to include stats broken down on common relation types. The types include: - Tables - Partitioned tables - Hypertables - Distributed hypertables - Continuous aggregates - Materialized views - Views and for each of these types report (when applicable): - Total number of relations - Total number of children/chunks - Total data volume (broken into heap, toast, and indexes). - Compression stats - PG stats, like reltuples The telemetry function has also been refactored to return `jsonb` instead of `text`. This makes it easier to query and manipulate the resulting JSON format, and also gives cleaner output. Closes #3932
10067f05448d2af964264cd9bde9624a05522e786e31Erik Nordström<erik@timescale.com>Thu Jan 27 17:14:26 2022 +0100Add rescan support to internal ScannerThis change adds rescan support to the internal Scanner module. When scanning TimescaleDB catalog data, it is sometimes useful to be able to restart an index scan without having to close and reopen the scanned relation.
10077d413809916035d1f3e4dfb3210878dbd1b34744Alexander Kuzmenkov<akuzmenkov@timescale.com>Thu Feb 3 18:35:51 2022 +0300Fix double initialization of TsFdwRelInfoThis doesn't cause any problems except degrading the performance. The TsFdwRelInfo is initialized twice for hypertable on access node: 1) when using it for chunk size estimation in `estimate_chunk_size`, 2) when expanding the distributed hypertable in `tsl_set_rel_pathlist` callback. The initialization has to happen inside the TSL module, this is why we can't easily move it up the call graph to, say, `import/ts_set_append_rel_size`, which is FDW-agnostic. As a fix, just accept that TimescaleDBPrivate structure can be allocated already, and don't discard the previous one.
1008c9d24703a86a63933b3d64ef5a9681ef6f714230Aleksander Alekseev<aleksander@timescale.com>Mon Jan 31 15:24:54 2022 +0300Make add_continuous_aggregate_policy() work with variable-sized bucketsVariable-sized buckets don't work with CAGG policies: SELECT add_continuous_aggregate_policy('conditions_summary_policy', start_offset => INTERVAL '65 days', end_offset => INTERVAL '1 day', schedule_interval => INTERVAL '1 hour'); ERROR: bucket width is not defined for a variable bucket This patch fixes it and adds corresponding tests. Reported by Miranda Auhl <miranda@timescale.com>
1009b330dd94e13746069ec21d8cdcd2e43ade17f01dSven Klemm<sven@timescale.com>Sun Feb 6 18:06:03 2022 +0100Fix privilege check in extension_load_without_preloadThe privilege check in extension_load_without_preload used is_member_of_role which does not respect the inherit flag of roles instead of has_privs_of_role. For additional context: https://www.postgresql.org/message-id/flat/CAGB
10102BVh5RpzZroX-RKLXYWyTidpWX6
10113DqcbMoVWERotAWh-_CeUQ
101240mail.gmail.com#f08fc3998fad5d919c1660c6a1926158
10139b1809152d7b6c1bc3a8977889328b2f1312b4ceDmitry Simonenko<dmitry@timescale.com>Mon Feb 7 10:13:16 2022 +0300Add a way to disable dist ddl on database objectsThis change adds `timescaledb_experimental.enable_distributed_ddl` session variable which allows to enable or disable distributed DDL operations on a database objects such as SCHEMA, DATABASE or execute GRANT command. Basically everything that does not involve particular distributed hypertable associated with the command can be disabled. Affected commands: CREATE/DROP SCHEMA ALTER SCHEMA ALTER DATABASE REASSING OWNER DROP OWNED ALTER DEFAULT PRIVILEGES GRANT ON DATABASE/TABLE GRANT IN SCHEMA This change also set this variable to false by default, which disables forwarding DDL commands on database objects to data nodes. Fix: #4001
10145e50cb51dbf3543cd6ba2e44220b46ee2af137afDmitry Simonenko<dmitry@timescale.com>Mon Feb 7 09:28:55 2022 +0300Fix cmake file to run template testsRecent CMakeLists.txt related refactoring accidently missed one case with TEST_FILES variable renaming, which lead to the exclusion of template tests.
1015485af7c19fc0a9f29858211d1703d2e81d8f6588Sven Klemm<sven@timescale.com>Sun Feb 6 08:33:12 2022 +0100Fix centos 8 package testSince CentOS 8 went EOL in december last year most of the repository URLs error out now. This patch switches the test to use Rockylinux which is a drop in replacement for CentOS.
10169714e881e3422a38032bdb2e18384657fa18134dMats Kindahl<mats@timescale.com>Fri Jan 28 13:37:21 2022 +0100Increase default background workersIncreate the number of background workers since we have flaky tests as a result of groups running out of background workers. We also increate the total number of workers to 24 for the default configuration when running tests. Fixes #4023
101705dd4787d1cd287d0636cd34d9295f29dda7c769Mats Kindahl<mats@timescale.com>Fri Jan 28 13:30:32 2022 +0100Support test groups with different configurationsTo support tests with different configuration options, we split the tests into *test configurations*. Each test configuration NAME will have - A configuration template file `NAME.conf.in` that is used to run the suite of tests. - A variable `TEST_FILES_<NAME>` listing the test files available for that test suite. - A variable `SOLO_TESTS_<NAME>` that lists the tests that need to be run as solo tests. The code to generate test schedules is then factored out into a separate file and used for each configuration.
10189248de2f2a6628881aca9b73256fae1921b2ed26Markos Fountoulakis<markos@timescale.com>Tue Feb 1 13:07:50 2022 +0200Fix shellcheck warnings
1019481bf8b5a8b304c40ccba1d12fb232e8684807fdSven Klemm<sven@timescale.com>Sun Jan 30 21:03:27 2022 +0100Fix downgrade test artifact uploadThe artifact upload for the downgrade test was using the filenames of the update test and so would never upload any files.
1020e5db6a9eecdba2de76eeaee00b459fe35a556baagayyappan<gayathri@timescale.com>Thu Jan 27 16:03:24 2022 -0500Fix status for dropped chunks that have catalog entriesChunks that are dropped but preserve the catalog entries have an incorrect status when they are marked as dropped. This happens if the chunk was previously compressed and then gets dropped - the status in the catalog tuple reflects the compression status. This should be reset since the data is now dropped.
1021cf6aed71b94d473e5eb70536571d3ef0a6970222Aleksander Alekseev<aleksander@timescale.com>Mon Jan 31 12:57:24 2022 +0300Refactoring: Use consistent naming for cagg_*.sql testsRename cagg_variable_size_buckets.sql to cagg_monthly.sql. This makes the naming for the tests much more consistent. This file actually contains only tests for monthly buckets, not for all possible variable-sized buckets. CAGGs with timezones are covered in cagg_with_timezone.sql.
102222f9cf689dca8a831fee1249f141b4acff5aaf6bAlexander Kuzmenkov<akuzmenkov@timescale.com>Mon Jan 31 14:46:14 2022 +0300Don't leak Chunks in classify_relationThis function is called often, at least 4 times per chunk, so these add up. Freeing these chunks allows us to save memory. Ideally, we should fix the function not to look up the chunk anew each time. Also make a couple other tweaks that reduce memory usage for planning.
1023ae02934c6a43524b6c17b562b283bac08a2bf4beAleksander Alekseev<aleksander@timescale.com>Thu Jan 27 17:11:42 2022 +0300Timezones support in CAGGsThis patch allows using timezones in CAGGs, for instance: time_bucket_ng(bucket_size, ts, 'Europe/Moscow') Both months/years and days/hours/minutes can be used in bucket_size. The bucket size is considered variable-sized in all these cases because DST affects days/hours/minutes as well. CAGGs on top of distributed hypertables, compressed hypertables and compressed distributed hypertables are supported as well.
1024c0050a1315f9e79e593ba9f8906d6064606d5efcgayyappan<gayathri@timescale.com>Thu Jan 27 14:05:41 2022 -0500Improve error message for compress_chunkFix the error message for compress chunks so that it specifies the cagg name instead of the materialized hypertable name.
10259e16d9f4e44dff336e15c234632e4d280e68d64dSven Klemm<sven@timescale.com>Thu Jan 27 00:05:05 2022 +0100Add coccinelle scripts for detecting use-after-freeThis patch adds coccinelle scripts for detecting use-after-free bugs in relation to ts_cache_release. This will find code using the following pattern: Use of the hypertable from cache after releasing the cache and use of the dimension of the hypertable from a cache after the cache was released.
10267f5c5fd10d518916a435b8e52fb48e38b407a55egayyappan<gayathri@timescale.com>Wed Jan 26 14:39:50 2022 -0500Verify compression settings before adding policyWhen a compression policy is added for a continuous aggregate, verify that compression has been enabled, before adding a policy.
102744be03b5c6856a4d5a8ee43f606ddc5befeb263fgayyappan<gayathri@timescale.com>Tue Jan 25 14:23:12 2022 -0500Fix premature cache release callThe cache entry for a hypertable is created by calling ts_hypertable_from_tupleinfo. This sets up the ht->space structure, which in turn sets up the dimension information. These structures are allocated in the cache's memory context. The dimension information is accessed after the cache is released in ts_subtract_integer_from_now. This PR fixes this by releasing the cache before returning from the function. Fixes #4014
102864ed2db8695e471b7a2d938762b84f26ccf32b6fSven Klemm<sven@timescale.com>Mon Jan 24 21:05:39 2022 +0100Fix ALTER TABLE EventTrigger initializationWhen ALTER TABLE SET (timescaledb.compress) is executed, the compression table is created as part of this command. But when run as part of an extension installation the EventTrigger for ALTER TABLE does not get initialized leading to a segfault. Fixes #4017
1029b30d005657c5803c35ff609637644e484458f9adDmitry Simonenko<dmitry@timescale.com>Tue Jan 25 14:03:50 2022 +0300Fix crash when execute add_data_nodeOn disconnect libpq will create a result object without creating event data, which is usually done for a regular errors. This fix handles this case and forces the result object to always have have associated connection meta data. Fix: #3951
10302e725dc0e2cf6d9f715cc91278a6713f6a847b06Alexander Kuzmenkov<akuzmenkov@timescale.com>Fri Jan 14 14:54:55 2022 +0300Use cached Chunks for data node assignmentBefore assigning chunks to data nodes, we have to look up the same Chunk structs to estimate the chunk relation size. Cache them in chunk RelOptInfos to avoid the costly lookup.
103160edef6ebaa35c4961398c8ba2cf7c1be911bdbcAlexander Kuzmenkov<akuzmenkov@timescale.com>Tue Jan 11 17:37:58 2022 +0300Don't guess historical/current chunk by idsFor the chunks that don't have the ANALYZE stats, we have to estimate the number of pages and tuples in some other ways. One thing we factor in this estimation is the expected fill factor of the chunk. There are two ways we calculate the fill factor: 1. For time dimensions, by looking at whether the now() belongs to the chunks [begin, end) interval and calculating the fill factor accordingly. 2. For space dimensions, by looking at whether the chunk is one of the last chunks in the hypertable. To check (2), we used to compare the chunk ids. Turns out it didn't work correctly, because the chunk ids are global for all hypertables, and looking at them doesn't tell us anything if there are many hypertables. The code that did that was also very slow. This commit just removes this logic and considers all the chunks on space dimensions w/o the ANALYZE stats as recent chunks with fill factor of 0.5.
1032c2bfc5d17c01359621ed2ce00fb198653cda4ffaSven Klemm<sven@timescale.com>Sat Jan 22 23:49:00 2022 +0100Route delete on Hypertables through HypertableModify nodeThis patch changes DELETE handling for hypertables to have the postgres ModifyTable node be wrapped in a custom HypertableModify node. By itself this does not change DELETE handling for hypertables but instead enables subsequent patches to implement e.g. chunk exclusion for DELETE or DELETE on compressed chunks. Since PG 14 codepath for INSERT is different from previous versions this PR will only change the plan for PG14+. DELETE handling for distributed hypertables is not changed as part of this patch.
10339f64df8567abdbe6af11a9388acefb8237629ff5gayyappan<gayathri@timescale.com>Thu Jan 20 13:23:12 2022 -0500Add ts_catalog subdirectoryMove files that are related to timescaledb catalog access to this subdirectory
1034616d3b16b8e1dfca760cc4e4472f9af159bf44bdMats Kindahl<mats@timescale.com>Mon Jan 24 15:14:23 2022 +0100Update ts_extension_oid in transitioning stateWhen executing the post-update scripts we get an assertion failure and subsequent segfault because `ts_extension_oid` is still set to `InvalidOid`. This happen because `ts_extension_oid` is not set up until after the post-update state has finished, but we need to set it up already in the extension transitioning state used during post-update execution. The reason for not setting up the `ts_extension_oid` is because we cannot issue queries to the catalog, but this is possible already in the post-update stage, so we add code to set up `ts_extension_oid` already in this state. Fixes #4009
103589dceeabd4017f0843ddfc0a17bc505eb0eff895Sven Klemm<sven@timescale.com>Sun Jan 23 20:33:40 2022 +0100Make pgtest input/output dir optionalPG15 removes the input and output directory from the pg regression test files and moves those files into sql and output directories. Currently cmake errors when those directories are not present in PG_SOURCE_DIR. This patch makes those directories optional so cmake does not fail when PG_SOURCE_DIR contains the checkout of a version without these directories. https://github.com/postgres/postgres/commit/d1029bb5 https://github.com/postgres/postgres/commit/dc9c3b0f
10365c22ef3da2958a6e5eb876f984539be4d86f4defSven Klemm<sven@timescale.com>Sun Jan 23 11:38:57 2022 +0100Rename continuous aggregate testsChange the prefix for continuous aggregate tests from continuous_aggs_ to cagg_. This is similar to commit 6a8c2b66 which did this adjustment for isolation tests because we were running into length limitations for the spec name. This patch adjusts the remaining tests to be consistent with the naming used in isolation tests.
103729856fd0ace1ab0a1b27452e3b835f5971014848Sven Klemm<sven@timescale.com>Sun Jan 23 19:58:28 2022 +0100Eliminate float rounding instabilities in interpolateWhen interpolating float values the result of the calculation might be unstable for certain values when y0 and y1 are equal. This patch short circuits the formula and returns y0 immediately when y0 and y1 are identical. Fixes #1528
1038e603478e472b99c348881b22e401f31505b77985gayyappan<gayathri@timescale.com>Wed Jan 12 14:59:17 2022 -0500Support cagg trigger for distributed compressed chunksAFTER ROW triggers are not supported on inserts into compressed chunks. This change explicitly calls the cagg triggers so that continuous aggregates work as expected on inserts into compressed distributed hypertables. This fix is similar to PR 3724 that handles cagg triggers for non distrbuted hypertables.
10394ebb5b72e95f788694855fafbb4fc5de732e72a6gayyappan<gayathri@timescale.com>Wed Jan 12 17:06:57 2022 -0500Refactor ChunkInsertState structMove all compression related info into a separate struct.
104007fd9a4298bde42297c28594e1c6f8b7120677a2gayyappan<gayathri@timescale.com>Wed Jan 12 11:32:17 2022 -0500Support continuous agg trigger on copy into compressed chunksAFTER ROW triggers are not supported on compressed chunks. Directly call the continuous aggregate trigger function for copies. This fix is similar to PR 3764 that handles cagg triggers for inserts into compressed chunks.
1041afe3362778e0e950407e51291427e2b2524413f0Sven Klemm<sven@timescale.com>Tue Jan 18 11:03:31 2022 +0100Don't REVOKE in runner cleanup functionThis patch removes the REVOKEs added in commit e320679c. The REVOKEs were added to the cleanup function which gets executed for every individual test but the GRANTs only happens once during initial setup thereby creating an asymmetry. This lead to tests failing that relied on those GRANTs. This patch also makes those GRANTs only execute for PG >= 15.
10428e6d3d44abe4163cba277a364155694b808531c0Sven Klemm<sven@timescale.com>Mon Jan 17 18:45:26 2022 +0100Add support for wildcards to SKIPSThis patch adds suport for wildcards to the SKIPS environment variable similar to wildcard support in TESTS. This enables the following test invocations: -- run all tsl tests expect background worker and multinode make regresscheck-t SKIPS="*bgw* *dist*" -- run cagg tests except background worker make regresscheck-t TESTS="continuous_agg*" SKIPS="*bgw*"
10439103d697fb3cdbae3450eaa596d66df4cf289b61Aleksander Alekseev<aleksander@timescale.com>Tue Jan 11 12:06:34 2022 +0300Don't allow using buckets like '1 month 15 days' + some refactoringsThis is in fact a backport from the "Buckets with timezones" feature branch. While working on the feature a bug was discovered. We allow creating buckets like '1 month 15 days', i.e. fixed-sized + variable-sized, which is supposed to be forbidden. This patch fixes the bug and also simplifies code a little. timezone_in / timezone_out procedures are used instead of snprintf/scanf. Also, the CAggTimebucketInfo structure was changed slightly. These changes are going to be needed for timezones support anyway.
10442a2b394172109b693d2bc06c8c8df8f9ab0cd879Nikhil Sontakke<nikhil@timescale.com>Wed Jan 12 17:24:52 2022 +0530Avoid distributed chunks scan plansThe current approach to planning queries on distributed hypertables first plans a "naive" plan for scanning each remote chunk individually (the chunks are children of an append) and then that plan gets replaced by a datanode scan plan (each data node is a child in the Append). While we need to include each chunk in the planning for cost reasons (we need to know the stats for chunk rels) we need not actually create paths for scanning chunks. This unnecessary work is now avoided and we now plan datanode scans directly. Fixes #3685
1045e320679c4cc5cd9fc0f35f59fd22284fc2ecfb89Mats Kindahl<mats@timescale.com>Fri Jan 7 14:07:09 2022 +0100Remove grants on data node bootstrapStarting with PG15, default permissions on the public schema is restricted for any non-superuser non-owner. This causes test failures since tables can no longer be created without explicitly adding permissions, so we remove grant when bootstrapping the data nodes and instead grant permissions to the users in the regression tests. This keeps the default permissions on data nodes, but allow regression tests to run. Fixes #3957 Reference: https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=b073c3cc
1046342f848d90b08effa60aaa2c33ad1ceb16fcb4ceFabrízio de Royes Mello<fabriziomello@gmail.com>Fri Dec 10 10:40:10 2021 -0300Refactor invalidation log inclusionCommit 97c2578ffa6b08f733a75381defefc176c91826b overcomplicated the `invalidate_add_entry` API by adding parameters related to the remote function call for multi-node on materialization hypertables. Refactored it simplifying the function interface and adding a new function to deal with materialization hypertables on multi-node environment. Fixes #3833
1047c5796c0f1d6135729c772029d188afe8a2b69b1bSven Klemm<sven@timescale.com>Mon Jan 17 10:21:37 2022 +0100Ignore memoize test in pg14 snapshotUpstream changed the explain output for the memoize node to include an additional `Cache Mode` line. While we could adjust our test runner to always ignore that line this would prevent us from testing the cache mode in future tests. https://github.com/postgres/postgres/commit/6c32c0977783fae217b5eaa1d22d26c96e5b0085
10481f9bd81ee05e64f14db29f63b33f9d7d2ae712d7Sven Klemm<sven@timescale.com>Fri Jan 14 10:57:05 2022 +0100Adjust CI ignore lists to isolation test renamesCommit 6a8c2b66 renamed cagg tests in isolationcheck-t to have a common prefix but did not adjust the CI ignorelists to reflect that change.
104969b267071a9deab62ef204f4815c810da58b406eSven Klemm<sven@timescale.com>Fri Jan 14 14:09:34 2022 +0100Bump copyright year in license descriptionsBump year in copyright information to 2022 and adjust same scripts to reference NOTICE that didn't have the reference yet. This patch also removes orphaned test/expected/utils.out.
105028a3895235023d1271f460dbb73ee733714e3ab0Rafia Sabih<rafia.sabih@gmail.com>Tue Jan 11 20:02:39 2022 +0100Update syntactic attribute numberWhen adjusting attribute numbers of chunk index, also adjust varattnosyn which is used at the time of reconstructing index definition. Fixes #3794
1051e2d578cfac52c2f2a3fc5a1053954cdf9a6b0201Sven Klemm<sven@timescale.com>Fri Jan 14 02:20:24 2022 +0100Fix cagg_multi_dist_ht isolation testAdjust cagg_multi_dist_ht isolation test to no longer include chunk names. isolation tests that expose chunk names cannot be run by themselves or in a custom test list because chunk numbering is depending on the spec file list.
10526a8c2b666e23eac77cfb383301a29a0fbb1efe94Sven Klemm<sven@timescale.com>Thu Jan 13 12:55:00 2022 +0100Shorten isolation test spec file namesIsolation test identifiers have a length limit and when the isolationtester encounters names that are too long they get truncated. More recent versions will produce a warning when this truncation is done leading to flaky tests. Only continuous_aggs_concurrent_refresh_dist_ht.spec exceeded the truncation limit but since all the continuous_aggs isolation tests have quite long name this patch shortens the names from continuous_aggs_* to cagg_* to prevent this problem from happening to other isolation tests as well.
105322fd4d44263342ce650c1e344c2a9424f103254eSven Klemm<sven@timescale.com>Thu Jan 13 12:57:41 2022 +0100Fix compression_ddl isolation testThis patch gets rid of all hardcoded chunk names from the compression_ddl isolation test and also gets rid of chunk names from the output files. Chunk names in isolation test files are problematic as it prevents changing the order of execution of isolation test runs as the database is shared between the individual tests. Output will also differ when only a subset of the tests is run leading to flaky tests.
105410b48858e1b03f96d53f690de1501934a586148bFabrízio de Royes Mello<fabriziomello@gmail.com>Wed Jan 12 15:25:58 2022 -0300Add exception to invalidation SQL functionsPer Sven's sqlsmith run we got some assertion errors adding invalidation for hypertables and continuous aggregates. Fixed id adding the proper validation in the invalidation SQL functions to check properly the parameters `start_time` and `end_time`.
105582e3f055371b39158fbe4d1f81f412d99763e304Aleksander Alekseev<aleksander@timescale.com>Tue Jan 11 12:06:34 2022 +0300Fix the build against REL_14_STABLEThe number of arguments of pg_md5_hash() has changed in REL_14_STABLE. This patch adds a corresponding compat.h version of the procedure. https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=3a0cced8
10563b9beac5321390152843ad3df4bcc31cd3f34a2aSven Klemm<sven@timescale.com>Mon Jan 10 21:21:31 2022 +0100Adjust apt package test to match docsAdjust the APT package test to closer match the instructions used in our documentation.
10576d3f11cde0298a70c8f659c288e46d92ee273506Erik Nordström<erik@timescale.com>Tue Dec 21 18:56:56 2021 +0100Avoid double PQclear() in data fetchersThe macro `remote_result_elog` is used in the cursor and row-by-row fetchers and clears the result value using the function `PQclear()` before rethrowing its error. However, this error is later captured to clear the wrapping result value that holds a reference to the original result. To avoid this double-clearing, set the response to NULL before the error is thrown.
1058ab0f753e26a45e9a25cee3d243f431a5a15f4a91Sven Klemm<sven@timescale.com>Mon Jan 10 13:18:19 2022 +0100Sort issue template options alphabeticallyChange the bug report and enhancement issue template to have dropdown options sorted alphabetically.
10594aeb1330f379ed1e8ebbab2f93a6e73aac24e94aNikhil Sontakke<nikhil@timescale.com>Thu Jan 6 20:01:46 2022 +0530Fix crash in EXPLAIN VERBOSE on dist tableThe crash is occurring in "fdw_scan_explain" function because the fsstate passed in is NULL and we try to access the "fetcher_type" field from it in VERBOSE mode. When we are doing EXPLAIN, we short circuit the init foreign scan calls and that's why fsstate is not filled up. Fixes #3960
10604762908bc865e7c7fd27b2c52b7c82da04bd1698Markos Fountoulakis<markos@timescale.com>Mon Jan 3 14:30:39 2022 +0200Clean up dead code
10610dd4329ab1e7451e2a50f466a05515e1336edc19Aleksander Alekseev<aleksander@timescale.com>Thu Dec 23 11:43:30 2021 +0300Don't display an error message when creating an empty CAGGThis is a follow-up to 95804069, "Monthly buckets support in CAGGs". In that patch we didn't check the creation of a CAGG on top of an empty hypertable. It works, but displays "ERROR: origin must be before the given date", which is a bit misleading. This happens because 95804069 didn't modify invalidation_threshold_compute() in the same way as tsl_process_continuous_agg_viewstmt(). As a result, compute_circumscribed_bucketed_refresh_window_for_months() calls time_bucket_ng() for ts_time_get_min() argument. It doesn't work because the minimum time is 4714-11-24 BC which is before any reasonable origin, and the user sees corresponding error message. This patch fixes the problem in the same way as 95804069 did and adds a corresponding test.
1062d7eaa55a476a0a1a2d4aa2d868db27c9e5a092d6Aleksander Alekseev<aleksander@timescale.com>Thu Dec 23 12:18:17 2021 +0300Override the default ACL for public schema on PG15Since PG15, by default, non-superuser accounts are not allowed to create tables in public schema of databases they don't own. This default can be changed manually. This patch ensures that the permissions are going to be the same regardless of the used PostgreSQL version. Without this patch, none of our tests pass on PG15 because they fail with the "access denied to schema public" error. This is why runner.sh was modified. Then, some other tests keep failing because when we call create_distributed_hypertable() we create a new database on each of the data nodes, also not granting enough permissions to non-privileged users. This is what the fix of data_node.c addresses. This is not necessarily the best approach possible, but it preserves the same behavior on PostgreSQL >= 15 and PostgreSQL < 15. Maybe one day we will come up with something better (especially when there will be no need to support PG < 15) but until then the patch seems to be good enough. https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=b073c3cc
106313abd14c278418c4ccdc36630864c59486b5fdf7Alexander Kuzmenkov<akuzmenkov@timescale.com>Tue Dec 14 19:56:20 2021 +0300Use moving average to estimate chunk sizeWhen no size statistics is available for a chunk because it haven't been ANALYZEd, we have to resort to some estimates. A good way to estimate the size of the chunk is to look at the sizes of the nearby chunk. Before this commit, we would look up the ten nearby chunk for each chunk w/o statistics, which was slow. This commit adds the code to maintain exponential moving average of the recent chunk sizes in the parent RelOptInfo as we go through them, avoiding the additional lookups.
10644b3227663a8f0e189fe23a04ee44ecdfa94ab487Dmitry Simonenko<dmitry@timescale.com>Thu Dec 23 14:01:06 2021 +0300Add support for ALTER SCHEMA command on multi-nodeThis change adds support for ALTER SCHEMA RENAME TO and ALTER SCHEMA OWNER TO commands to distributed database. Issue: #3909
106524d9243f8b80db905cd864736466cd66574ccb40Dmitry Simonenko<dmitry@timescale.com>Thu Dec 23 13:33:24 2021 +0300Add support for DROP SCHEMA on multi-nodeThis PR changes logic and allows DROP SCHEMA command to be executed on each data node, even if the schema being dropped has no distributed hypertables in it. Fix: #3909
1066a7dedf89c997099ec9598a964e87cf5096c74423James Guthrie<jguthrie@timescale.com>Fri Dec 17 13:48:03 2021 +0100Fix weirdly formatted commentIt appears as though this comment had a run-in with auto-formatting which left it somewhat mangled.
1067ce73f25a87cdc54e911d7c84279be5a0dc48aa2fSven Klemm<sven@timescale.com>Mon Dec 20 00:22:17 2021 +0100Optimize first/lastThis patch optimizes how first()/last() initialize the compare function. Previously the compare function would be looked up for every transition function call but since polymorphic types are resolved at parse time for a specific aggregate instance the compare function will not change during its lifetime. Additionally this patch also fixes a memory leak when using first()/last() on pointer types. These changes lead to a roughly 2x speed improvement for first()/ last() and make the memory usage near-constant. Fixes #3935
1068b735fdcf85e06856c015191d5e47783ecca5d1a0Sven Klemm<sven@timescale.com>Mon Dec 20 09:21:12 2021 +0100Fix segfault in add_compression_policyPostgres snprintf before 89ad14cd787 will segfault on NULL char pointers. This patch changes add_compression_policy to check for NULL get_rel_name before reporting the error. https://github.com/postgres/postgres/commit/89ad14cd787
10697824b10a5ae7f4bcde5e874bc4be053e0ae357d3Erik Nordström<erik@timescale.com>Mon Dec 13 09:27:42 2021 +0100Allow changing a data node via alter serverAllow changing the name and configuration of a data node via `ALTER SERVER` since there is no `alter_data_node` command. The functions `add_data_node` and `delete_data_node` are wrappers around `CREATE SERVER` and `DROP SERVER`, respectively. They block the PostgreSQL commmands since they do additional things, like data node bootstrapping. However, there's currently no way to change a data node's configuration, and no additional functionality is required over standard `ALTER SERVER`, so we might as well allow it until a `alter_data_node` is implemented. Fixes #3915
10700deffe2b643ea9ea51d65d73d656ddbe3e2aa2a2Sven Klemm<sven@timescale.com>Sat Dec 18 05:11:41 2021 +0100Improve error handling in add_reorder_policyWhen trying to add reorder policy to internal compressed hypertable add_reorder_policy would segfault.
10711d40b2e4a621cf83d61e6849c1185f1dab43edceSven Klemm<sven@timescale.com>Sat Dec 18 02:37:16 2021 +0100Fix segfault when creating caggWhen trying to create a continuous aggregate on the internal compression hypertable a segfault would occur. This patch adds a check for this to the cagg validation logic and prevents creating cagg on the internal compressed hypertable.
1072d989e61b56bc97ea5fc014a964a3ef4d1ccf9e77Sven Klemm<sven@timescale.com>Sat Dec 18 01:40:11 2021 +0100Improve show_chunks and drop_chunks error handlingThis patch fixes a segfault when calling show_chunks on internal compressed hypertable and a cache lookup failure for drop_chunks when calling on internal compressed hypertable.
107339645d56da87521c3491efa97bafece00805d2b4Sven Klemm<sven@timescale.com>Thu Dec 16 23:16:34 2021 +0100Fix subtract_integer_from_now on 32-bit platformsThis patch fixes subtract_integer_from_now on 32-bit platforms, improves error handling and adds some basic tests. subtract_integer_from_now would trigger an assert when called on a hypertable without integer time dimension (found by sqlsmith). Additionally subtract_integer_from_now would segfault when called on a hypertable without partitioning dimensions.
1074a7608871452bd685ae8f87c3b554f929bdb9e575Sven Klemm<sven@timescale.com>Fri Dec 17 05:21:19 2021 +0100Fix projection handling in gapfillWhen getting the next tuple from the subplan gapfill would apply the projection to it which was incorrect since the subplan already did the projection and the projection for the gapfill tuple has to be done when the tuple is handed to the parent node. Fixes #3834
1075244568f23a7719283edc4f0a00c0e902b603c013Fabrízio de Royes Mello<fabriziomello@gmail.com>Fri Oct 22 09:47:56 2021 -0300Add regression tests for caggs+compressionCloses timescale/timescaledb-private#962
1076d8d392914a7e37078c7a9589ad9b0b9e3859d755gayyappan<gayathri@timescale.com>Mon Sep 27 14:42:06 2021 -0400Support for compression on continuous aggregatesEnable ALTER MATERIALIZED VIEW (timescaledb.compress) This enables compression on the underlying materialized hypertable. The segmentby and orderby columns for compression are based on the GROUP BY clause and time_bucket clause used while setting up the continuous aggregate. timescaledb_information.continuous_aggregate view defn change Add support for compression policy on continuous aggregates Move code from job.c to policy_utils.c Add support functions to check compression policy validity for continuous aggregates.
10770d285d18a01f28a7b993efa310064ae45a21b7f5gayyappan<gayathri@timescale.com>Wed Sep 22 12:53:39 2021 -0400Fix selectedCols list for materialized hypertable while creating view
107899521fef16d851a55f41b8e9d355774afe8beb8eAleksander Alekseev<aleksander@timescale.com>Fri Dec 17 11:53:30 2021 +0300Fix compilation against PG15Instead of `#if PG14` added in 519e5de21 it should have been `#if PG14_GE`.
1079da5ee6fc414e2a4c6a1dd323a1fb799a1aa4434fAlexander Kuzmenkov<akuzmenkov@timescale.com>Thu Dec 16 20:29:21 2021 +0300Add -Wundef to compiler flagsToday was another time I used `#if PG14_LT` but forgot to include compat.h, spent a good deal of time debugging this. This flag will catch references to undefined macros.
1080e0f02c8c1a86eb4e4b913f39c34f53bc410dc4d7Erik Nordström<erik@timescale.com>Tue Dec 14 18:25:36 2021 +0100Add option to drop database when deleting data nodeWhen deleting a data node, it is often convenient to be able to also drop the database on the data node so that the node can be added again using the same database name. However, dropping the database is optional since it should be possible to delete a data node even if it is no longer responding. With the new functionality, a data node's database can be dropped as follows: ```sql SELECT delete_data_node('dn1', drop_database=>true); ``` Note that the default behavior is still to not drop the database in order to be compatible with the old behavior. Enabling the option also makes the function non-transactional, since dropping a database is not transactional. Therefore, it is not possible to use this option in a transaction block. Closes #3876
108191f3edf609ac77523b982634d1fe6bebd7117662Aleksander Alekseev<aleksander@timescale.com>Wed Dec 15 16:15:59 2021 +0300Refactoring: get rid of max_bucket_widthOur code occasionally mentions max_bucket_width. However, in practice, there is no such thing. For fixed-sized buckets, bucket_width and max_bucket_width are always the same, while for variable-sized buckets bucket_width is not used at all (except the fact that it equals -1 to indicate that the bucket size is variable). This patch removes any use of max_bucket_width, except for arguments of: - _timescaledb_internal.invalidation_process_hypertable_log() - _timescaledb_internal.invalidation_process_cagg_log() The signatures of these functions were not changed for backward compatibility between access and data nodes, which can run different versions of TimescaleDB.
1082beb8527defc766543fe0e22de0250a876e35fc42Alexander Kuzmenkov<akuzmenkov@timescale.com>Fri Dec 10 17:32:30 2021 +0300Don't excessively look up the extension oidUse the one from the static variable. This improves performance by avoiding excessive catalog lookups.
1083d437c70df8320a19ee43d9b2b809f624931d35c4Sven Klemm<sven@timescale.com>Sat Dec 11 12:05:00 2021 +0100Enable downgrade test for PG14 packagesWhen initially adding the package tests for PG14 Debian, Ubuntu and RPM packages we couldn't test downgrade with the packages because there was no previous version with PG14 support. Since we now have released a 2nd version with PG14 support we can enable the downgrade test for Debian, Ubuntu and RPM packages.
10841b6d2428bbb804bc72b4aeee7763b4d9cedab178Alexander Kuzmenkov<akuzmenkov@timescale.com>Fri Dec 10 17:29:59 2021 +0300Don't do unnecessary planning for the relations proven to be emptyThis imporves performance.
10857f494077eda069502723c4e79feea8b34af21bf5Sven Klemm<sven@timescale.com>Fri Dec 10 23:56:39 2021 +0100Fix DataNodeScan plans with One-Time FilterWhen a query has a filter that only needs to be evaluated once per query it will be represented as a Result node with the filter condition on the Result node and the actual query as child of the result node. find_data_node_scan_state_child did not consider Result node as valid node to contain a DataNodeScan node leading to a `unexpected child node of Append or MergeAppend: 62` for queries that had one-time filter with a subquery.
1086958040699c4986a98fab788bafd599d24281f1d8Aleksander Alekseev<aleksander@timescale.com>Mon Dec 6 18:19:33 2021 +0300Monthly buckets support in CAGGsThis patch allows using time_bucket_ng("N month", ...) in CAGGs. Users can also specify years, or months AND years. CAGGs on top of distributed hypertables are supported as well.
10871b4780df3127565991a7a6e7436f3743663c0a6dSven Klemm<sven@timescale.com>Fri Dec 10 23:01:20 2021 +0100Fix assertion failure in cursor_fetcher_rewindThe code in cursor_fetcher_rewind asserted that there always is an associated request which is not true if EOF was reached already. Found by sqlsmith. Fixes #3786
1088babcc8e9ee05219a638ff3a46b9779fac87d1778Alexander Kuzmenkov<akuzmenkov@timescale.com>Fri Dec 10 17:26:09 2021 +0300Use function oids instead of names when transforming the sort keysThis is more explicit, and looking up the function name each time has a performance impact.
1089519e5de21ce7ee5b88fde98e1646f36c45b8e1bbDmitry Simonenko<dmitry@timescale.com>Mon Dec 13 14:29:24 2021 +0300Fix role type deparsing for GRANT commandThis change fixes GRANT command deparsing by including handling of the special role types such as: PUBLIC, CURRENT_USER, SESSION_USER and CURRENT_ROLE (PG14). Fix #3910
1090765d7375cea124f9a39ab1497a0f062eefc493d5Sven Klemm<sven@timescale.com>Mon Dec 13 02:14:24 2021 +0100Fix segfault on insert into internal compressed tableWhen trying to insert into the internal compressed hypertable timescaledb would segfault. This patch blocks direct inserts into the internal compressed hypertable through our tuple routing. Internally we don't use this code path for compression as we create chunks explicitly and insert directly into those chunks in compress_chunk. Fixes #3920
109199746ed8baee7e3e6a874a584dd72c04f947dbf6Mats Kindahl<mats@timescale.com>Wed Dec 8 17:12:32 2021 +0100Check custom scan node registrationWhen loading several different versions of shared libraries after a restart, it might attempt to register the custom scan nodes several times. This is fixed by adding a function that checks if the custom scan method was already registered and skips registering it if it was. Fixes #3901
1092fd5dc6002c1058b740e1d6695c2386341b03ede4Aleksander Alekseev<aleksander@timescale.com>Fri Dec 10 16:02:29 2021 +0300Support UPPERREL_PARTIAL_DISTINCT stage in fdw_create_upper_paths()UpperRelationKind enum was extended in the upstream and now can be UPPERREL_PARTIAL_DISTINCT as well. This patch rewrites the switch-case expression in the fdw_create_upper_paths() procedure accordingly. https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=22c4e88e
1093b208f5276f16272c8840a0a37b3e741ede453ca8Mats Kindahl<mats@timescale.com>Tue Dec 7 13:45:27 2021 +0100Remove C language recompress_chunkSince we are re-implementing `recompress_chunk` as a PL/SQL function, there is no need to keep the C language version around any more, so we remove it from the code.
10940f81a60cbb7d0aa67a575782a6c1f66c86e5f9ecAlexander Kuzmenkov<akuzmenkov@timescale.com>Fri Dec 10 14:22:10 2021 +0300Use row-by-row fetcher to enable parallel plans on data nodesThe row-by-row fetcher is more efficient, so we want to use it when we can -- that is, when the have to read only one table from the data node, without interleaving it with anything else. This patch adds an option of choosing the fetcher type automatically. It detects the simplest case of only one distributed table in the entire query, and enables row-by-row fetcher. For other cases, the cursor fetcher is used.
10957f2f7e922e3506c0de86b8507611cced7b22b722Nikhil Sontakke<nikhil@timescale.com>Fri Dec 10 15:10:58 2021 +0530Fix use-after-free crash in remote heal codeAddress sanitizer reported a crash due to a use-after-free code block. Fixed that and verified with a subsequent sanitizer local run. Fixes #3907
1096aae19319c01ceffb18d6a6eb374132e0f2678290Mats Kindahl<mats@timescale.com>Fri Dec 3 10:31:37 2021 +0100Rewrite recompress_chunk as procedureWhen executing `recompress_chunk` and a query at the same time, a deadlock can be generated because the chunk relation and the chunk index and the compressed and uncompressd chunks are locked in different orders. In particular, when `recompress_chunk` is executing, it will first decompress the chunk and as part of that lock the uncompressed chunk index in AccessExclusive mode and when trying to compress the chunk again it will try to lock the uncompressed chunk in AccessExclusive as part of truncating it. Note that `decompress_chunk` and `compress_chunk` lock the relations in the same order and the issue arises because the procedures are combined inth a single transaction. To avoid the deadlock, this commit rewrites the `recompress_chunk` to be a procedure and adds a commit between the decompression and compression. Committing the transaction after the decompress will allow reads and inserts to proceed by working on the uncompressed chunk, and the compression part of the procedure will take the necessary locks in strict order, thereby avoiding a deadlock. In addition, the isolation test is rewritten so that instead of adding a waitpoint in the PL/SQL function, we implement the isolation test by taking a lock on the compressed table after the decompression. Fixes #3846
10974cecdb50f9def569547b01bbb26118dbed377cd9Nikhil Sontakke<nikhil@timescale.com>Mon Nov 29 18:28:33 2021 +0530Fix remote txn heal logic* A few tweaks to the remote txn resolution logic * Add logic to delete a specific record in remote_txn table by GID * Allow heal logic to move on to other cleanup if one specific GID fails * Do not rely on ongoing txns while cleaning up entries from remote_txn table Includes test case changes to try out various failure scenarios in the healing function. Fixes #3219
1098ea342f139627d657b09801971dadaa77cf81b281Aleksander Alekseev<aleksander@timescale.com>Thu Dec 9 15:14:07 2021 +0300Remove the rest of Value* type usageThis is a follow-up to 8afac602. In this commit we refactored the code that used Value* type because the type was removed in the upstream. However, we missed a few places. This patch fixes it.
109919fa286200c1f7eeb866559d55c73aaa370dcb5eAleksander Alekseev<aleksander@timescale.com>Wed Dec 8 16:10:00 2021 +0300Add make_new_heap_compat() macroThe number of arguments of make_new_heap() has changed in PG15. In order to be able to compile against PostgreSQL 15 use a _compat() macro instead of the direct function call. Also, it should have been #if PG15_GE, not #if PG15 - fix this too! https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=b0483263
1100eeb1ea96ef76cbcd1468d34ee6b475c97f170ad6Aleksander Alekseev<aleksander@timescale.com>Tue Dec 7 16:05:52 2021 +0300Use compat.h version of FirstBootstrapObjectIdThe macro FirstBootstrapObjectId was renamed in the upstream. This patch adds a corresponding FirstBootstrapObjectIdCompat macro to compat.h and uses it instead of FirstBootstrapObjectId. This will allow us to compile agains PG15. https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=a49d0812
11013a83e75789358258ff7fe92f99427d21a110b506Aleksander Alekseev<aleksander@timescale.com>Mon Dec 6 17:43:00 2021 +0300Add shm_mq_send_compat() macro for compatibility with PG15There was an additional argument added to shm_mq_send() in the upstream. This patch adds a corresponding _compat() macro to be able to compile against future versions of PostgreSQL. Better handle this now than solve a bunch of problems one year later. https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=46846433
11029d4c94f971da44afb446a7d6761dd049daadc6dbDmitry Simonenko<dmitry@timescale.com>Tue Dec 7 12:37:04 2021 +0300Fix ALTER SET/DROP NULL contstraint on dist hypertableThis change adds support for ALTER TABLE SET/DROP NULL commands to the list of supported commands that can be run with distributed hypertable. Fix #3860
1103613e08a27d4234f516b6a4bb492a8d05192171a9Sven Klemm<sven@timescale.com>Mon Dec 6 20:00:36 2021 +0100Remove dead code in dist_ddl_processCommit 6424dd20 added a redundant early exit to dist_ddl_process which triggered a Coverity dead code warning. This patch refactors the code slightly to remove the redundant code and get rid of the coverity warning.
1104ad8a5e68c91a1d7bb6f92cd226578400716b0b05Dmitry Simonenko<dmitry@timescale.com>Mon Dec 6 13:03:33 2021 +0300Support CREATE SCHEMA on distributed databaseThis PR makes CREATE SCHEMA command shippable to all data nodes in the distributed database. Additional support for `GRANT ON SCHEMA` command added. Fix #3690
11051bc1993c61c61fcf4d75284f44a46d330d1c4fb8Duncan Moore<duncan@timescale.com>Thu Dec 2 23:21:54 2021 +0000Post release 2.5.1
1106a82f97dfc2b38c1ef8bb87470ad1904d0ce91db5Aleksander Alekseev<aleksander@timescale.com>Fri Dec 3 14:54:34 2021 +0300Use standard random() instead of pg_lrand48()pg_*rand48() functions family was removed in the upstream and the code that uses it will not compile against PG15. This patch replaces pg_lrand48() with standard random() function from stdlib.h. Also the patch rewrites the bgw_db_scheduler test so that the output doesn't contain any pseudo-random data.
110721d9b6a6c765a09b1f25ade8cd0f2e8cb254d3f5Sven Klemm<sven@timescale.com>Fri Dec 3 11:41:30 2021 +0100Use generic URL in windows package testChange the windows package test to use an URL with latest instead of explicit package version since this is what we use in docs.
11086424dd201293b70b1c509652bae540d90ac5ffa4Erik Nordström<erik@timescale.com>Wed Nov 24 14:21:03 2021 +0100Handle default privileges on distributed databasesStatements that alter default privileges are now by default forwarded to all data nodes. For instance: ```sql ALTER DEFAULT PRIVILEGES IN SCHEMA myschema GRANT INSERT ON TABLES TO myrole; ``` is applied across the entire cluster of data nodes. Fixes #3851
11091ff6dfe6ab2cbc2d6c655e9a00b185099f972e4bMats Kindahl<mats@timescale.com>Thu Dec 2 10:26:50 2021 +0100Fix race condition in deadlock_recompress_chunkAfter the synchronizing lock is released and the transaction is committed, both sessions are free to execute independently. This means that the query can actually start running before the recompress step has completed, which means that the order for completion is non-deterministic. We fix this by adding a marker so that the query is not reported as completed until the recompress has finished execution. Since markers in isolation tests is a recent thing, we only run the test for PostgreSQL versions with markers added. Part-Of: #3846
11102ad1eb9afea153a77260b8197489a2753de55d36Sven Klemm<sven@timescale.com>Mon Nov 29 20:55:10 2021 +0100Add package test for Ubuntu 21.10Add 21.10 to the list of tested distributions since we build packages for it.
111194dc8373943e01561577df610fcba6dda08301dbDuncan Moore<duncan@timescale.com>Tue Nov 30 22:47:40 2021 +0000Release 2.5.1
1112069cb4ed19231c439b5bb2e086a1232ef68d75feMarkos Fountoulakis<markos@timescale.com>Thu Dec 2 17:36:50 2021 +0200Fix create_distributed_restore_point memory issueSanitizer reports a heap buffer overflow in `create_distributed_restore_point` because we are not copying the restore node name. This commit fixes this by copying the string to a new name buffer.
1113320119d81ed23752dcdefc86a6ac16d8050df412Erik Nordström<erik@timescale.com>Thu Dec 2 11:40:15 2021 +0100Fix SkipScan crash due to pruned unique pathWhen SkipScan paths are added it can result in a crash if the new SkipScan dominates the PostgreSQL planned unique path. In that case, the previous unique path is pruned and freed, leading to a potential memory corruption since a pointer to the original unique path is used when looping over all subpaths to try to apply SkipScan. Thus, if the original unique path is pruned, and there are multiple subpaths, a crash will occur in the next iteration over the subpaths. The crash is fixed by making a shallow copy of the original unique path while iterating the subpaths.
1114210886e508632d858d2be5b55593f2e49780ebf5Mats Kindahl<mats@timescale.com>Wed Dec 1 20:07:02 2021 +0100Ignore deadlock_recompress_chunk in early versionThis isolation test will fail in early versions of the PG servers, just like the other isolation tests, so ignoring failures for it.
1115112107546f0be2255e7d872824b41cbc658087c1Mats Kindahl<mats@timescale.com>Wed Nov 24 17:12:46 2021 +0100Eliminate deadlock in recompress chunk policyWhen executing recompress chunk policy concurrently with queries query, a deadlock can be generated because the chunk relation and the chunk index or the uncompressed chunk or the compressed chunk are locked in different orders. In particular, when recompress chunk policy is executing, it will first decompress the chunk and as part of that lock the compressed chunk in `AccessExclusive` mode when dropping it and when trying to compress the chunk again it will try to lock the uncompressed chunk in `AccessExclusive` mode as part of truncating it. To avoid the deadlock, this commit updates the recompress policy to do the compression and the decompression steps in separate transactions, which will avoid the deadlock since each phase (decompress and compress chunk) locks indexes and compressed/uncompressed chunks in the same order. Note that this fixes the policy only, and not the `recompress_chunk` function, which still is prone to deadlocks. Partial-Bug: #3846
11168afac6029b1719e42def0374b2d498a77c06bbb8Aleksander Alekseev<aleksander@timescale.com>Mon Nov 29 17:10:54 2021 +0300Don't use Value typeValue node struct was removed in the upstream and the code that uses it will not compile against PG15. Better rewrite the code now than deal with a whole bunch of changes one year later. https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=639a86e3
1117fed8f1ac88e3438c0f7b57fb296d100224a1a016Nikhil Sontakke<nikhil@timescale.com>Thu Nov 25 12:31:34 2021 +0530Support [DROP|REASSIGN] OWNED BY in multinodeWe ship the "DROP OWNED BY" and "REASSIGN OWNED BY" queries as is to the datanodes. This assumes that the roles that are referred in these queries are present on the datanodes.
111858ad8bab663f24ec0780e4f91bb9949711b07becMarkos Fountoulakis<markos@timescale.com>Wed Nov 24 18:44:08 2021 +0200Add deparser for CreateTrigStmtAdd deparser for CreateTrigStmt to use for distributed hypertables. Fixes #3825
1119da8ce2e140cb056b7a7bfbc5b84e5b19771a1180Fabrízio de Royes Mello<fabriziomello@gmail.com>Mon Nov 15 16:23:00 2021 -0300Properly handle `max_retries` optionSurprisly we're not taking care of `max_retries` option leading us to failed jobs running forever. Fixed it by properly handle the `max_retries` option in our scheduler. Fixes #3035
11201bdd825b80370dbf3b759e635b2d174034a3d8abErik Nordström<erik@timescale.com>Fri Nov 19 10:56:31 2021 +0100Add configuration for the GitHub issue template chooserConfigure the GitHub issue template chooser to include options with links to the page about support requests, the Slack community, and documentation changes.
11217719b7fcff3150cd68f6b0c46e3460ce3c306efcErik Nordström<erik@timescale.com>Wed Nov 17 18:52:04 2021 +0100Add a pull request templateAdd a pull request template with Guidelines for a well-formed pull request and the checklist to follow in the PR process.
1122a459b327b1164df9cadc20fd248f4e71701df1e9Erik Nordström<erik@timescale.com>Thu Nov 18 10:31:12 2021 +0100Add a feature request issue templateThe feature request issue template adds a form for people to fill out so that we can ensure we get the information we need.
1123ea7ebe17de086d3596ecd7194e231602536358c0Erik Nordström<erik@timescale.com>Fri Nov 19 13:50:45 2021 +0100Add enhancement issue templateAdd an issue template for "Enhancement" requests. An enhancement is an improvement to an existing feature or functionality. The user must pick from a set of features or subsystems to improve.
112487a319810b2329d2298a5e460baa29b615dd80e0Erik Nordström<erik@timescale.com>Thu Nov 18 16:44:30 2021 +0100Update bug report issue templateConvert the bug report issue template into a form that the user has to fill out. The form allows making some fields required. Also add the "bug" and "triage" labels to all bug reports. The "triage" label can be used to find bugs that haven't been triaged, assuming the label is removed as part of the triaging process.
11259e075fa63626df32fc217fb774b7928066d97d0cErik Nordström<erik@timescale.com>Thu Nov 18 17:55:01 2021 +0100Add an issue template for reporting flaky testsTests are sometimes flaky, so add an issue template to report such tests. The template ensures the issue is labeled and has the required information we need to fix the flake.
1126387d6842cf17b713d48e23ae15b2150c3537d653Fabrízio de Royes Mello<fabriziomello@gmail.com>Mon Nov 22 17:04:50 2021 -0300Add missing gitignore entryPull request #3779 introduced a new template SQL test file but missed to add the properly gitgnore entry to ignore generated test files.
1127ab61b90f5881217c000f8d691c513c8f6861949aDmitry Simonenko<dmitry@timescale.com>Mon Nov 22 17:36:25 2021 +0300Test enabling dist compression within a procedureMake sure ALTER TABLE SET (timescaledb.compress) command properly propagated to the data nodes when executed within a procedure. This includes only test a case, actual fix was done in #3663. Fix #3705
1128bedc624c7301897b28a37d848c0f73750359a6bbSven Klemm<sven@timescale.com>Mon Nov 22 13:23:25 2021 +0100Fix homebrew test to work on macos 11In CI macos-latest currently may resolve to MacOS 10.15 or 11. But in MacOS 11 postgres seems to not be started by default leading to the package check failing because postgres is not running. This patch changes the test to start postgres which works for both MacOS environments and fixes the homebrew test on MacOS 11.
1129de24d81b47b8c1e8f543adb7b9e4899fb2b2512cSven Klemm<sven@timescale.com>Sun Nov 21 17:10:58 2021 +0100Fix snapshot pg regresscheckUpstream added a new regression test for binary compatibility check. Since we define our own types the test will fail with timescaledb installed as the test does not expect to see those additional types. This patch changes our CI to ignore result of type_sanity test. Currently those are only in REL_XX_STABLE but with release of next minor version those will enter normal tests as well. https://github.com/postgres/postgres/commit/cf3d79aa31f
11303a1ff28d3e202aaa63fd71b6104934db3b107fb6Alexander Kuzmenkov<akuzmenkov@timescale.com>Wed Nov 17 15:32:06 2021 +0300Evaluate more timestamp-related stable functions on data nodesThis commit extends the stable function whitelist with some timestamp-related functions that were not there before. They depend on timezone settings which we synchronize on data nodes, so they are safe to evaluate there.
113148cdf71da9c1f015320a085dc11d47f3c45957eaNikhil Sontakke<nikhil@timescale.com>Tue Nov 16 20:07:48 2021 +0530Fix INSERT..SELECT involving dist hypertablesIf the relation being inserted into and the relation in the SELECT are both distributed hypertables then do not use COPY. This is because we will need two connections to the same set of datanodes (one to ingest data into src table using COPY and one to SELECT from dst table) which is not supported currently in a single transaction. This restriction will be lifted in the future. Fixes #3447
11320a82e7f0ab1b406ae91230621ad7ce75c8ff3468Sven Klemm<sven@timescale.com>Wed Nov 17 18:41:24 2021 +0100Add ABI test for minimum required pg versionThis patch adds a test to detect changes in minimum required pg versions for our packages. We build timescaledb against latest postgres version and then run the tests with that library loaded into previous postgres version. This patch also changes the ABI test for maximum compatible postgres version to use the same format and removes the old ABI test code.
11330de4955ca56679470589742a8494ad78f5308b46Aleksander Alekseev<aleksander@timescale.com>Wed Nov 17 18:30:12 2021 +0300Treat clang-tidy warnings as errorsThis change makes the build fail on macos-* if clang-tidy detects any bugs. This improves our process in two ways. Firstly, currently we execute clang-tidy on macos-* but ignore the warnings. As a result we waste CPU resources. Also, somebody who uses MacOS has to fix the warnings manually while this could be done by the person who introduced corresponding changes. Secondly, running clang-tidy on a laptop is relatively expensive. This change allows to disable clang-tidy locally and speed up the development process.
11349a4c4ca992fe1c7ad762ba098e962b4e544d29d3Aleksander Alekseev<aleksander@timescale.com>Wed Nov 17 17:24:31 2021 +0300Fix reading garbage value from TSConnectionErrorclang-tidy reports that after eed2810d under certain conditions remote_connection_error_elog() macro can read from the memory that was not initialized. Make sure this can't happen.
1135a4a2c4e9d1c8e8ad585913feea885df1260d8424Markos Fountoulakis<markos@timescale.com>Thu Nov 18 14:53:24 2021 +0200Remove pointers from CAGG lists for 64-bit archsCurrently, the int64 elements are always passed by reference, which is not necessary on 64-bit architectures where it can be passed by value. Make it so they are only passed by reference for 32-bit architectures and by value for 64-bit architectures, since the element fits in a 64-bit architecture pointer.
1136103c1b25b84e93c71ee4ec88f61db32aba559dc0Dmitry Simonenko<dmitry@timescale.com>Thu Nov 18 12:02:35 2021 +0300Support GRANT/REVOKE on distributed databaseThis PR adds support for "[GRANT|REVOKE] ON DATABASE" command when executed on distributed databse. If current database is distributed, the command will be rewritten to respect each data node database name and send to each data node accordingly. Fix #3594
1137ca82a9b13569f8fb12ff85f4df052d32a682bee2Mats Kindahl<mats@timescale.com>Fri Nov 12 09:24:22 2021 +0100Fix error printout on correct security labelFor all security labels from provider `timescaledb` an error was printed, which make `pg_restore` fail because the security labels are printed to the dump. Instead, we only print an error if the security label is not of the correct format. Fixes #3760
11381df000e0dc970726a9736641590b79bb0b372823Fabrízio de Royes Mello<fabriziomello@gmail.com>Wed Nov 17 10:53:49 2021 -0300Backport PG13 typalign macros for PG12Postgres 13 introduced macros for typalign and typstorage constants in commit postgres/postgres@3ed2005ff59. For better code readability let's port `TYPALIGN_CHAR` macro for the compatibility layer. Closes #3817
11392ccba5ecc97c7e6086eab8e0be60c630d8018d4cFabrízio de Royes Mello<fabriziomello@gmail.com>Tue Nov 16 16:43:16 2021 -0300Refactor isolation tests to prevent SQL injectionDuring the developing of Continuous Aggregates for Distributed Hypertables we left some work to be done later and refator the isolation tests to prevent SQL injection was on of them. Per discussion: https://github.com/timescale/timescaledb/pull/3693#discussion_r735098888 Epic issue #3721
1140eed2810d2b913cb4784430c1f7529bc85783252eDmitry Simonenko<dmitry@timescale.com>Wed Nov 17 15:45:55 2021 +0300Fix NULL pointer evaluation in fill_result_error()Fix #3781
1141f1e103fab1fd59fb3a8ebe43ae9c084120f1ec68Alexander Kuzmenkov<akuzmenkov@timescale.com>Tue Nov 16 17:48:30 2021 +0300Fix DISTINCT ON queries for distributed hyperatblesPreviously, we would push DISTINCT ON down to the data nodes even when the pathkeys of the resulting paths on the data nodes were not compatible with the given DISTINCT ON columns. This commit disables pushdown when the sorting is not compatible. Fixes #3784
1142ecb59170d3c6c69b21f4cdad0e272a9c55dd0b00Mats Kindahl<mats@timescale.com>Wed Nov 17 10:16:21 2021 +0100Add krb5-dev dependency to alpine buildThe header file `gssapi/gssapi.h` is present in Alpine package `krb5-dev` but for some reason it was not installed prior to building, causing upgrade and downgrade test failures.
1143b78b25d3178945d73977c2f8dc2c30b4248f500bErik Nordström<erik@timescale.com>Fri Nov 12 14:33:18 2021 +0100Fail size utility functions when data nodes do not respondSize utility functions, such as `hypertable_size()`, excluded non-responding data nodes from size calculations, which led to the functions succeeding but returning the wrong size information. To avoid reporting confusing numbers, it is better to fail. This change updates the SQL queries for the relevant functions to no longer exclude non-responding data nodes and also adds a TAP test to illustrate the error when data nodes are not responding. Fixes #3713
11448a5cb543432ddeb737be1a3de01057b8f42ba906Fabrízio de Royes Mello<fabriziomello@gmail.com>Fri Oct 29 11:40:24 2021 -0300Add Postgres 14 prerequisites for compilation
1145aee832c3cbca25fe65764624844e8fde3ed2cff1Erik Nordström<erik@timescale.com>Fri Nov 12 09:34:29 2021 +0100Tweak chunk creation error messageWhen a data node tries to create a chunk itself, and not via the access node, an error is raised. The hint in this error was not conforming to the error style guide, so fix it.
11464a17d4c40297d0295bb80a1575d296e6426d4e0fAlexander Kuzmenkov<akuzmenkov@timescale.com>Mon Nov 15 14:10:14 2021 +0300Add shellcheck to CIWriting a shell script correctly can be hard even for a skilled programmer. shellcheck is a static analysis tool that helps catch common errors in shell scripts. We now have 36 executable scripts in our repository, for which shellcheck reports 126 errors (calculated like find . -type f -executable -exec bash -c '[ "$(file --brief --mime-type "$1")" == "text/x-shellscript" ]' sh {} \; -exec shellcheck -f gcc --exclude=SC2086 {} \; | cut -d: -f1 | sort | uniq | wc -l). This commit fixes these warnings and adds a GitHub actions workflow that runs shellcheck on all the executable shell scripts in the repository. The warning SC2086: Double quote to prevent globbing and word splitting is disabled globally, because it has little practical consequences, sometimes leads to false positives, and is general is too widespread because people forget to quote.
1147c91faad221248c35304f5d38f8b4ebf8a6ad6d64Sven Klemm<sven@timescale.com>Wed Oct 27 18:28:01 2021 +0200Add coccinelle workflow to CIThis patch adds a workflow to run coccinelle scripts against our codebase. This can be used to find errors in the code base. The initial patch adds a check to find unbalanced heap_form_tuple heap_freetuple occurances. https://coccinelle.gitlabpages.inria.fr/website/
1148e4ec15d8812455099293523b698d0163e6faab1cSven Klemm<sven@timescale.com>Wed Nov 10 09:45:32 2021 +0100Bump postgres versions used in CI to 12.9, 13.5, 14.1
1149509c2b99ab7e031f06ffd8815f11b40b8c981eedAleksander Alekseev<aleksander@timescale.com>Thu Nov 11 15:36:03 2021 +0300Silence 3 clang warnings for simple8b_rle.h/dictionary.cCLang 11 generates several warnings regarding possible null pointer dereferences and division by zero. The warnings seem to be false-positive. However, they may hide new valuable warnings. Thus this patch double-checks that there is nothing to be concerned about and also silences these warnings.
115010b8979db930600bf2e82dfddfee980d7781dbb0Mats Kindahl<mats@timescale.com>Wed Oct 27 13:18:11 2021 +0200Add skeleton release workflowIn order to be able to run workflows using `workflow_dispatch`, the event need to be defined on the default branch. This commit adds a basic workflow for the release pipeline containing only a workflow that can be triggered using `workflow_dispatch` with the correct parameters and will just list the commits in the branch since the last tag. With this workflow in the default branch, you can run the workflow either from the web interface, or using something like: gh workflow run release.yaml --ref 2.1.x -f version=2.1.1
11517591f7f1f3a03b25d69f96159244e7f8ce84574bSven Klemm<sven@timescale.com>Mon Nov 8 15:00:29 2021 +0100Fix time_bucket comparison transformationThe time_bucket comparison transformation code assumed the value and the width of the time_bucket comparison expression were both Const. But this was not validated only asserted. This can lead to wrong query results. Found by sqlsmith.
11520f5268ad49cab42b6876623b7b01b048d9ab0166Aleksander Alekseev<aleksander@timescale.com>Mon Nov 8 12:22:53 2021 +0300Fix possible uninitialized value in test_utils.cSupress the following CLang warning: ``` warning: 2nd function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage] ```
115382656a6807cc66dd2e0ed9c7059a6222f53c7698Mats Kindahl<mats@timescale.com>Mon Oct 25 14:27:45 2021 +0200Fix flaky pg_dumpCalling `CREATE DATABASE` we cannot have any backends connected to the source database, except the current one. Since background workers connect to any database that has installed the extension, they can linger and cause a flaky error. The test changed to just check that the extension can be implicitly installed, but this require waiting for backends to be unregistered from `procArray` in `procarray.c`, which the function `pg_terminate_backend` does not handle properly and hence results in a flaky test. This happen because `pg_terminate_backend` only signals the process to terminate, but does not wait for it to actually terminate. Instead, we add an explicit function that checks the `procArray` and waits for it to not have any backends for a database and uses that to wait for termination.
11547e3e771d9f4c2feac6c6d75ba1909af4b5c2a682Fabrízio de Royes Mello<fabriziomello@gmail.com>Mon Oct 25 17:26:22 2021 -0300Fix compression policy on tables using INTEGERCommit fffd6c2350f5b3237486f3d49d7167105e72a55b fixes problem related to PortalContext using PL/pgSQL procedure to execute the policy. Unfortunately this new implementation introduced a problem when we use INTEGER and not BIGINT for the time dimension. Fixed it by dealing correclty with the integer types: SMALLINT, INTEGER and BIGINT. Also refatored the policy compression procedure replacing the two procedures `policy_compression_{interval|integer}` by a simple `policy_compression_execute` casting dimension type dynamically. Fixes #3773
1155151637db89b57b43c1974fd469cd37f98b77e8b6Sven Klemm<sven@timescale.com>Wed Nov 3 12:20:38 2021 +0100Allow ALTER TABLE DROP COLUMN on compressed hypertableThis patch allows dropping columns from hypertables with compression enabled when the dropped column is neither an orderby nor a segmentby column. Fixes #3683
11565eadbbd0978fa327b57a9e91b3b321ca0b48c053Aleksander Alekseev<aleksander@timescale.com>Thu Nov 4 16:28:00 2021 +0300const'ify CaggsInfo structureCaggsInfo is an immutable structure and a good candidate to be const'ified. This simplifies the maintenance of the code and probably could save a CPU cycle or two here and there.
11571aabbc83f8ead6fe86961d02d9f481c85d1c86d8Nikhil<nikhil@timescale.com>Mon May 24 14:48:58 2021 +0530Enable 1PC and DN reads for read only AN txnsIn high availability setups, a streaming replica of the access node can be configured. Since it's a hot standby users should be able to run read-only queries from this replica and should be able to query the distributed hypertables from it. Additionally, the internal code which sets up a connection from the standby access node to the data nodes now marks the ongoing transaction explicitly as READ ONLY ones. This ensures that any functions or any activity which tries to make modifications on the data nodes errors out. Note that even if "timescaledb.enable_2pc" is enabled, we will still use 1PC for these READ ONLY transactions. While we are doing this, we also handle the case when a user explicitly marks a transaction as "READ ONLY" on the primary AN. Even in that case the connection to the DNs will be marked read only. Additionally, similar to the above standby case, even if "timescaledb.enable_2pc" is enabled, we will still use 1PC for these READ ONLY transactions on the primary AN. In normal Postgres standby, the ongoing transaction becomes READ WRITE immediately on promotion whereas in our case the ongoing transaction will remain READ ONLY till completion. New transactions on the same session will be READ WRITE as expected.
1158449019f3c1d68359537b53196a0f3276c34acf19Aleksander Alekseev<aleksander@timescale.com>Thu Nov 4 14:12:24 2021 +0300Remove dead codeRemove two procedures declared in continuous_agg.c: - ts_create_arrayexprs_from_caggs_info - ts_continuous_agg_get_user_view_oid This code is not used for anything and, nor is test-covered.
115977d1267eb1ae01bb503c38b5f2ab8b21601e04a8Sven Klemm<sven@timescale.com>Sun Oct 31 23:47:07 2021 +0100Remove unused function arg from metadata functionsRemove the key_type argument from metadata functions as all callers passed STRINGOID and there is no need to support other types for the key.
11607d9ea6237ce581e4e74757fd5b3dccf0e7609d72Sven Klemm<sven@timescale.com>Sun Oct 31 14:42:06 2021 +0100Remove namein calls from scankey initializationA lot of our scankey initialization when scanning indexes for a name had a superfluous namein call. This patch remove those unnecessary calls.
116193ffec7c10c70e1ba82a0aafb36614805ed26848Sven Klemm<sven@timescale.com>Mon Nov 1 08:22:52 2021 +0100Allow ALTER TABLE ADD COLUMN with DEFAULT on compressed hypertableWhen adding a new column with a default postgres doesnt materialize the default expression but just stores it in catalog with a flag signaling that it is missing from the physical row. Any expressions used as default that do not require materialization can be allowed on compressed hypertables as well. The following statements will work on compressed hypertables with this patch: ALTER TABLE t ADD COLUMN c1 int DEFAULT 42; ALTER TABLE t ADD COLUMN c2 text NOT NULL DEFAULT 'abc';
11626bce5da97b171c7cf8e25301eab57c7803967876Sven Klemm<sven@timescale.com>Sun Oct 31 20:30:50 2021 +0100Fix segfault in ts_hist_sfuncSince the number of buckets of the histogram function is an argument to the function call it is possible to initialize the histogram state with a lower number than actually needed in further calls leading to a segfault. This patch changes the memory access to use the number the state was initialized with instead of the number passed to the call. This also changes the function to error when the passed number differs from the initialized state.
116320543bf66b4de035d7890cdb642eed4cef2fed53Markos Fountoulakis<markos@timescale.com>Fri Oct 29 17:56:19 2021 +0300Refactor function in dist_commands.cFix coverity issue for Out-of-bounds access (ARRAY_VS_SINGLETON): "Passing &sql to function ts_dist_multi_cmds_params_invoke_on_data_nodes which uses it as an array"
1164af930685665b79b4dcb29f39c30e043864e25336Chris Bisnett<cbisnett@gmail.com>Sat Oct 30 09:18:23 2021 -0400Fix typo in error messageThis patch fixes a typo in the error message of CREATE INDEX when using timescaledb.transaction_per_chunk. Co-authored-by: Sven Klemm <sven@timescale.com>
116551a007d7065cef212abf342a40487b528e76752bSven Klemm<sven@timescale.com>Fri Oct 29 21:24:48 2021 +0200Refactor ts_hypertable_insert_path_createChange ts_hypertable_insert_path_create and add hypertable as argument since we always check for that in caller allowing us to remove an error branch from the function, save an additional lookup for the hypertable and save a lookup for the range table entry. This patch also changes the name of ts_chunk_dispatch_is_state to ts_is_chunk_dispatch_state to be consistent with naming of similar functions.
1166999f81bfd7339f702e151ec8b61adca88c324915Sven Klemm<sven@timescale.com>Fri Oct 29 19:46:42 2021 +0200Move ChunkAppend and AsyncAppend code into nodes directoryMove the ChunkAppend and AsyncAppend code into nodes directory to make it consistent with other custom node code.
1167e0e3bd1df52410890e7ca4866201fd5f10d12abbSven Klemm<sven@timescale.com>Fri Oct 29 18:53:36 2021 +0200Remove obsolete prototypesThis patch removes the prototypes for the following functions: policy_compression_proc tsl_hypertable_invalidation_log_delete tsl_materialization_invalidation_log_delete These were left in the code in previous refactorings even though they are no longer used.
11683d119275677dafc804637bf86ef107a9aad4ae23Dmitry Simonenko<dmitry@timescale.com>Fri Oct 29 15:41:50 2021 +0300Rework distributed DDL processing logicThis patch does refactoring and rework of the logic beside dist_ddl_preprocess() function. The idea behind it is to simplify process by splitting each DDL command logic inside separate function and avoid relaying on the hypertable list count to make decisions. This change allows easier to process more complex commands (such as GRANT), which would require query rewrite or to be executed on a different data nodes. Additionally this would make it easier to follow and be more alike as main code path inside src/process_util.c.
116956d31d855fd8805e39ca9c1c0332e27b2907de00Sven Klemm<sven@timescale.com>Thu Oct 28 12:44:08 2021 +0200Add PG14 to package testsThis patch adds PG14 to the package tests. Additionally the package downgrade test is disabled for PG14 since we do not have a released version to downgrade to yet.
1170df7f058ad13802a34290ebe332962b95296568c6Fabrízio de Royes Mello<fabriziomello@gmail.com>Thu Oct 28 05:48:22 2021 -0300Post release 2.5.0Add 2.5.0 to update test scripts for PG12 and PG13 and create update test script for PG14. Fix missing CHANGELOG thanks for external contributors.
11718925dd8e15c30ab5bdc1013abb063d4d05f64f06Fabrízio de Royes Mello<fabriziomello@gmail.com>Tue Oct 26 17:23:45 2021 -0300Release 2.5.0This release adds major new features since the 2.4.2 release. We deem it moderate priority for upgrading. This release includes these noteworthy features: * Continuous Aggregates for Distributed Hypertables * Support for PostgreSQL 14 * Experimental: Support for timezones in `time_bucket_ng()`, including the `origin` argument This release also includes several bug fixes. **Features** * #3034 Add support for PostgreSQL 14 * #3435 Add continuous aggregates for distributed hypertables * #3505 Add support for timezones in `time_bucket_ng()` **Bugfixes** * #3580 Fix memory context bug executing TRUNCATE * #3592 Allow alter column type on distributed hypertable * #3598 Improve evaluation of stable functions such as now() on access node * #3618 Fix execution of refresh_caggs from user actions * #3625 Add shared dependencies when creating chunk * #3626 Fix memory context bug executing TRUNCATE * #3627 Schema qualify UDTs in multi-node * #3638 Allow owner change of a data node * #3654 Fix index attnum mapping in reorder_chunk * #3661 Fix SkipScan path generation with constant DISTINCT column * #3667 Fix compress_policy for multi txn handling * #3673 Fix distributed hypertable DROP within a procedure * #3701 Allow anyone to use size utilities on distributed hypertables * #3708 Fix crash in get_aggsplit * #3709 Fix ordered append pathkey check * #3712 Fix GRANT/REVOKE ALL IN SCHEMA handling * #3717 Support transparent decompression on individual chunks * #3724 Fix inserts into compressed chunks on hypertables with caggs * #3727 Fix DirectFunctionCall crash in distributed_exec * #3728 Fix SkipScan with varchar column * #3733 Fix ANALYZE crash with custom statistics for custom types * #3747 Always reset expr context in DecompressChunk **Thanks** * @binakot and @sebvett for reporting an issue with DISTINCT queries * @hardikm10, @DavidPavlicek and @pafiti for reporting bugs on TRUNCATE * @mjf for reporting an issue with ordered append and JOINs * @phemmer for reporting the issues on multinode with aggregate queries and evaluation of now() * @abolognino for reporting an issue with INSERTs into compressed hypertables that have cagg * @tanglebones for reporting the ANALYZE crash with custom types on multinode
1172e02f48c19de1f0b0cfe705ebf864801ac2b7d626Erik Nordström<erik@timescale.com>Wed Oct 27 09:36:41 2021 +0200Add missing downgrade script filesSome of the downgrade script files were only added to the release branch and no downgrade path existed for downgrading from the 2.4.2 release to the 2.4.1 release. Add the missing downgrade files for 2.4.x releases to the main development branch. Also, avoid generating downgrade scripts for old versions, so that only the downgrade script for the current version is generated by default. A new CMake option `GENERATE_OLD_DOWNGRADE_SCRIPTS` is added to control this behavior. Note that `GENERATE_DOWNGRADE_SCRIPT` needs to be `ON` for the new option to work. The reason we want to keep the ability to generate old downgrade scripts is to be able to fix bugs in old downgrade scripts.
1173d117d8772f3cf59d66c7d0f85ffa915958e29222Fabrízio de Royes Mello<fabriziomello@gmail.com>Wed Oct 27 09:48:25 2021 -0300Add missing gitignore entryPull request #3717 introduced a new template SQL test file but missed to add the properly gitgnore entry to ignore generated test files.
1174f8bf3b9767a66c97d49d6274f4c5c4eba2ad2c67Mats Kindahl<mats@timescale.com>Wed Oct 27 10:04:06 2021 +0200Always reset expr context in DecompressChunkWhen decompressing very large compressed chunks as part of executing a `DecompressChunk`, the expression memory context was not reset after each qual evaluation if the qual did not match, meaning that if the qual did not match often, memory allocations would start to accumulate. This commit fixes this by resetting the expression memory context for each tuple when executing a `DecompressChunk` node, even if the qual did not match. Fixes #3620
11756db012dcc9c20b4777e37e127609e620e1a3544cNikhil Sontakke<nikhil@timescale.com>Wed Oct 27 11:38:01 2021 +0530Fix ANALYZE crash with custom typesExtensions like PostGIS introduce custom datatypes for columns. They also have custom statistics for such custom types. We already state in our comments that stats for custom types are not supported but it was never tested. Fix that now. Fixes #3733
11760fecefdafa44446595a0cf69b3986059da2b9711Sven Klemm<sven@timescale.com>Tue Oct 26 20:01:33 2021 +0200Skip chunk_utils for PG12Skip the chunk_utils test on PG12 instead of ignoring it because since the test segfaults it might actually cancel other tests even though it doesn't run in parallel.
1177a9e00497a2a8fce8e4016b343587d3a11662df45Sven Klemm<sven@timescale.com>Mon Oct 25 12:48:00 2021 +0200Improve memory testsThis patch implements various improvements to the memory tests. Memory tests are split off into separate workflow to allow running them separately from prerelease tests by pushing to branch memory_test. The scripts are adjusted to no longer build docker images to run the tests but instead running the tests directly. The python script to monitor memory usage was improved and now flushes after printing to make output appear consistently in CI. This patch also changes the memory test to run on PG 12,13 and 14 instead of only 12.
1178b27c9cbd47870f17e96e86f36cf6c68a7ae5faf5Sven Klemm<sven@timescale.com>Sat Oct 23 00:27:41 2021 +0200Add missing heap_freetuple callsThis patch adds missing heap_freetuple calls in 2 locations. The missing call in compression.c was a leak making the allocation live for much longer than needed. This was found by coccinelle.
1179d740e19c5fb0e57be20e58de282e29f00f262888Erik Nordström<erik@timescale.com>Thu Oct 21 11:06:21 2021 +0200Fix DirectFunctionCall crash in distributed_execThis change fixes a crash that occurred when calling `distributed_exec` via a direct function call. The crash was triggered by a dynamic lookup of the function name via the function Oid in the `FunctionCallInfo` struct in order to generate error messages for read-only and transaction block checks. However, this information is provided by the parsing stage, which is not executed when doing direct function calls, thus leading to a segmentation fault when trying to dereference a pointer in the `FunctionCallInfo` that wasn't set. Note that this problem is not limited to `distributed_exec`; it is present in all SQL-callable functions that use the same pattern and macros. To fix the problem, update the macros and patterns used for checking for read-only mode and transaction blocks to avoid doing the function name lookup when the pointer is not set. Instead fall back to the C function name in that case (via C macro `__func__`). A test case is added in C code to call `distributed_exec` via a direct function call within a transaction block in order to hit the previously crashing error message. The `distributed_exec` function has also been updated with better handling of input parameters, like empty arrays of data nodes, or arrays containing NULL elements.
11806d9715a95139f4d91fed99dd840b78e6533ca7d1Markos Fountoulakis<markos@timescale.com>Tue Oct 26 12:36:53 2021 +0300Fix compiler warningsFix compiler warnings for MacOS 10.15 build.
1181221437e8efbfd2dfee084adb3c3b05ae657d90c5Markos Fountoulakis<markos@timescale.com>Mon Oct 25 17:41:10 2021 +0300Continuous aggregates for distributed hypertablesAdd support for continuous aggregates for distributed hypertables by allowing a continuous aggregate to read from a distributed hypertable so that the continuous aggregate is on the access node while the hypertable data is on the data nodes. For distributed hypertables, both the hypertable and continuous aggregate invalidation log are kept on the data nodes and the refresh window is computed at refresh time on each data node. Since the continuous aggregate materialization hypertable is not present on the data nodes, the invalidation log was extended to allow using a non-local hypertable id on the data nodes. This means that you cannot create continuous aggregates on the data nodes since those could clash with continuous aggregates on the access node. Some utility statements added entries to the invalidation logs directly (truncating chunks and hypertables, as well as dropping individual chunks), so to handle this case, internal functions were added to allow logging invalidation on the data nodes from the access node. The commit also includes some fixes to memory context usage that caused crashes for invalidation triggers and also disable per data node queries during refresh since that would otherwise generate an exception. Fixes #3435 Co-authored-by: Mats Kindahl <mats@timescale.com>
1182bb1f046a37de782b85d00f6173e857e2f763bc83Sven Klemm<sven@timescale.com>Fri Oct 22 13:06:22 2021 +0200Fix SkipScan with varchar columnThis patch changes the operator lookup in SkipScan to fall back to the type of the operator class when it finds no direct match for column type but the type is binary compatible with the type of the operator class. This is required for SkipScan to work with character data column that are not of type text since the operator family will be text_ops which has no operators for varchar defined. Fixes #3720
11834ff1bd3636fbb518dce8251f23a986892050a3c3Sven Klemm<sven@timescale.com>Fri Oct 22 15:03:26 2021 +0200Ignore chunk_utils test results on PG 12.0Postgres 12.0 has a use-after-free bug in the event trigger code leading to a failing chunk_utils test in our nightly CI runs. This patch ignores this test for runs on PG 12.0. https://github.com/postgres/postgres/commit/93f726c0
118468697859df96ee7a8c69b5d75851d5537fc81a33Nikhil Sontakke<nikhil@timescale.com>Mon Oct 18 18:58:34 2021 +0530Fix GRANT/REVOKE ALL IN SCHEMA handlingFix the "GRANT/REVOKE ALL IN SCHEMA" handling uniformly across single-node and multi-node. Even thought this is a SCHEMA specific activity, we decided to include the chunks even if they are part of another SCHEMA. So they will also end up getting/resetting the same privileges. Includes test case changes for both single-node and multi-node use cases.
1185b0886c1b6dacac381de1bd2ee0bac6a3db34d9ecgayyappan<gayathri@timescale.com>Wed Oct 20 14:30:17 2021 -0400Support cagg invalidation trigger for inserts into compressed chunksAfter row triggers do not work when we insert into a compressed chunk. This causes a problem for caggs as invalidations are not recorded. Explicitly call the function to record invalidations when we insert into a compressed chunk (if the hypertable has caggs defined on it) Fixes #3410.
11862e6b05dfc02ed30678f5c20f5dd091b2274a719bgayyappan<gayathri@timescale.com>Wed Oct 20 13:16:20 2021 -0400Move test for error reporting to compression_errors.sqlcompression_insert.sql has tests related to inserts The test that is being moved verifies the error message.
1187acc6abee92d2f215f0de37d269f1613ad505dfedSven Klemm<sven@timescale.com>Mon Oct 18 23:54:15 2021 +0200Support transparent decompression on individual chunksThis patch adds support for transparent decompression in queries on individual chunks. This is required for distributed hypertables with compression when enable_per_data_node_queries is set to false. Without this functionality queries on distributed hypertables with compression would not return data for compressed chunks as the generated FDW queries would target individual chunks. Fixes #3714
11888862081e1c02a30108f593a9f55751ba77a3d728Erik Nordström<erik@timescale.com>Mon Oct 18 13:17:48 2021 +0200Merge version tests for distributed partial aggThe `dist_partial_agg` test no longer produces different output for the PostgreSQL versions we support, so the version-specific output files can be merged into one.
11893ee718c6d079b39931fb8a9f88380c37b8fce87eFabrízio de Royes Mello<fabriziomello@gmail.com>Mon Oct 18 12:26:43 2021 -0300Fix contributors documentationWe're not using Travis CI anymore and moved all our CI infrastructure to Github Actions. Replaced all old Travis CI mentioning to Github Actions on contributors documentation. Closes #3700
119001bf6518d4991ee98f8f29efd0f3a47e14d6da25Sven Klemm<sven@timescale.com>Mon Oct 18 21:15:59 2021 +0200Ignore pg_dump test result in macos PR testsSince pg_dump fails very often on macos we ignore the result of this test for PRs on macos.
11917f43a15ae8a899e6015d74b1bbb041acbb601aaaSven Klemm<sven@timescale.com>Sun Oct 17 07:15:42 2021 +0200Fix ordered append pathkey checkEven though ordered append checked the pathkey for a match of the attribute number with the initial ordering it did not double check the attribute number was actually from the hypertable. Under certain circumstances (e.g. with views) it was possible that the check passed even though the order by was not on the primary partitioning column. This patch changes the code to get the equivalence member for the hypertable relation instead of iterating over all equivalence members. Fixes #3409
11923c3290976cf71712736a53d52e86ba6df392ebe8Sven Klemm<sven@timescale.com>Sun Oct 17 14:17:16 2021 +0200Use postgres implemention of find_em_expr_for_relfind_em_expr_for_rel used to be a function in postgres_fdw which we imported but got moved to postgres main in PG13. This patch changes our code to use the postgres implementation when it is available and switches to our own implementation only for PG12.
1193e321d5212c4012bd84a54811bc4219516971fad4Sven Klemm<sven@timescale.com>Mon Oct 18 12:46:58 2021 +0200Add more PG14 tests to CIThis patch adds PG14 coverity, release, apache and snapshot tests to CI.
1194b243f82f61e488a54761b90ccba9ff65e6b7ef4cSven Klemm<sven@timescale.com>Sat Oct 16 21:23:53 2021 +0200Fix wrong assert in cagg_update_view_definitionWhen the view query has references to columns not selected in the resultset those columns will be at the end of the view query targetlist as junk columns. So the length of the targetlist of those queries might be different but they should always have the same amount of nonjunk columns.
1195fb3613fe04d6ec5c3216a077ac1d7078640290a6Alexander Kuzmenkov<akuzmenkov@timescale.com>Mon Oct 18 17:59:26 2021 +0300Improve evaluation of stable functions such as now() on access nodeWe have to evaluate the stable functions on the access node and not on data nodes, where the result might differ, to get consistent results of the query. Before this change, we used to substitute 'now()' with textual value of the current timestamp in the query text before sending it to the data node. This is not sufficient if now() is further wrapped in a whitelisted (for sending to data nodes) stable function such as '::timestamp'. Use the standard expression evaluation machinery to also handle such cases. Fixes #3598
119602f273dfe3bfa8a2aa868b46e8fc3163235b5c8fSven Klemm<sven@timescale.com>Fri Oct 15 18:16:40 2021 +0200Fix chunk_get_relstats Datum handlingThe code in chunk_get_single_stats_tuple was using Datum getter wrongly on FormData class which already holds primitive datatypes and did not correctly convert to Datum when setting the value for the tuple. Since most of the Datum macros are noops on amd64 this only lead to failing tests on 32bit.
1197eec04640087ece3c17d93d17fec7fba4645be7d5Sven Klemm<sven@timescale.com>Sat Oct 16 23:55:48 2021 +0200Fix crash in get_aggsplitWhen looking for the Aggref to determine whether partial or full aggregation is used get_aggsplit only checked for top-level Aggrefs in the targetlist. So a targetlist where all Aggrefs where nested in other expressions would lead to a crash. This function also only looked for the Aggref in the targetlist but in a query with a HAVING clause the aggregate might not be in the targetlist if it is only referenced in the HAVING clause. Fixes #3664 Fixes #3672
1198f25e795ec8450c15b08aa0c7593f81ca1bc5874eFabrízio de Royes Mello<fabriziomello@gmail.com>Thu Oct 14 17:55:54 2021 -0300Add regression tests for Memoize NodePostgreSQL 14 introduced new `Memoize Node` that serve as a cache of results from parameterized nodes. We should make sure it will work correctly together with ChunckAppend custom node over hypertables (compressed and uncompressed). Closes #3684
119957744c84ceedaa44178d6b27b1074e13524713e3Erik Nordström<erik@timescale.com>Thu Oct 14 15:07:11 2021 +0200Adjust cost estimates for distributed queriesTo improve remote query push down, do the following: * Import changes to remote cost estimates from PostgreSQL 14 `postgres_fdw`. The cost estimations for distributed (remote) queries are originally based on the `postgres_fdw` code in PG11. However, fixes and changes have been applied in never PostgreSQL versions, which improves, among other things, costing of sorts and having clauses. * Increase the cost of transferring tuples. This penalizes doing grouping/aggregation on the AN since it requires transferring more tuples, leading to the planner preferring the push-down plans. * As a result of the above, the improved costing also makes distributed queries behave similar across all currently supported PostgreSQL versions for our test cases. * Enable `dist_query` tests on PG14 (since it now passes). * Update the `dist_partial_agg` test to use additional ordering columns so that there is no diff in the test output due to ordering of input to the `first` and `last` functions.
120028a56503821d7de3ebc6c3c0f6a2c16fe0a0c095Erik Nordström<erik@timescale.com>Fri Oct 15 13:20:16 2021 +0200Allow anyone to use size utilities on distributed hypertablesThis change removes a check for `USAGE` privileges on data nodes required to query the data node using utility commands, such as `hypertable_size`. Normally, PostgreSQL doesn't require `USAGE` on a foreign server to query its remote tables. Also, size utilities, like `pg_table_size` can be used by anyone---even roles without any privileges on a table. The behavior on distributed hypertables is now consistent with PostgreSQL. Fixes #3698
1201cb13754c918c2709380925bd7f06846b57b29dffAleksander Alekseev<aleksander@timescale.com>Wed Oct 6 14:49:02 2021 +0300Clarify the comment for invalidation thresholdExplicitly state that the invalidation threshold is ignored by the transactions that use an isolation level above READ COMMITTED.
12023729c5001741596567fac31c3b82371964585168Aleksander Alekseev<aleksander@timescale.com>Thu Oct 14 15:30:33 2021 +0300Fix two "unused function" errorsWhen building on MacOS with Clang 11 the build fails with: error: unused function 'get_chunk_rri' error: unused function 'get_hyper_rri' [-Werror,-Wunused-function] This PR fixes it.
12032f7bb43fe0f3ac806e51e262af17dd4be2cc8a7bSven Klemm<sven@timescale.com>Wed Oct 13 11:44:58 2021 +0
The file is too large to be shown. View Raw