393 Commits

Author SHA1 Message Date
Sven Klemm
d16bc17fe6 Remove grep based update script check
Remove the grep based update script check and add some additional
checks to the AST based one.
2024-01-15 13:33:05 +01:00
Alexander Kuzmenkov
f08dd10425 Check the spelling in our code with codespell 2024-01-11 12:18:50 +01:00
Jan Nidzwetzki
df7a8fed6f Post-release fixes for 2.13.1
Bumping the previous version and adding tests for 2.13.1
2024-01-09 16:31:07 +01:00
Sven Klemm
8f73f95c2a Remove replication_factor field from _timescaledb_catalog.hypertable 2023-12-18 10:53:27 +01:00
Sven Klemm
11dd9af847 Remove multinode catalog objects
This patch removes the following objects:

tables:
- _timescaledb_catalog.chunk_data_node
- _timescaledb_catalog.dimension_partition
- _timescaledb_catalog.hypertable_data_node
- _timescaledb_catalog.remote_txn

views:
- timescaledb_information.data_nodes

functions:
- _timescaledb_functions.hypertable_remote_size
- _timescaledb_functions.chunks_remote_size
- _timescaledb_functions.indexes_remote_size
- _timescaledb_functions.compressed_chunk_remote_stats
2023-12-18 10:53:27 +01:00
Nikhil Sontakke
987435032c Fix MacOSx build issues
The upload script needs access to the "psql" binary with its proper
path. Fix that.
2023-12-15 16:31:56 +05:30
Fabrízio de Royes Mello
78490c47b7 Remove support for creating CAggs with old format
Timescale 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.

In 2.10.0 released on February 2023 the Continuous Aggregate old format
deprecation was announced.

With this PR the ability of creating Continuous Aggregate in the old
format was removed, but we still support migrate from the old to the
new format by running the `cagg_migrate` procedure.

This is the continuation of the PR #5977 started by @pdipesh02.

References:
https://docs.timescale.com/api/latest/continuous-aggregates/cagg_migrate/
https://github.com/timescale/timescaledb/releases/tag/2.10.0
https://github.com/timescale/timescaledb/releases/tag/2.7.0
https://github.com/timescale/timescaledb/pull/5977
2023-12-13 18:48:31 -03:00
Sven Klemm
985c1d2beb fixup 2023-12-12 20:37:35 +01:00
Sven Klemm
5d3ab06295 Remove multinode from update/downgrade test 2023-12-12 20:37:35 +01:00
Fabrízio de Royes Mello
d2284c282a PG16: Enable update/downgrade tests on CI
Note that multinode support was removed from PG16 so starting now
update/downgrade tests will be executed only on singlenode setup.
2023-11-30 07:33:53 -03:00
Jan Nidzwetzki
3b59a8a774 Post-release fixes for 2.13.0
Bumping the previous version and adding tests for 2.13.0.
2023-11-29 21:49:17 +01:00
Jan Nidzwetzki
9fd6d8b817 Add missing new lines to changelog script
Our changelog contains empty lines between the version sections. These
empty lines were missing in the script output so far.
2023-11-28 21:02:03 +01:00
Jan Nidzwetzki
b423d14ef5 Adjust restore points test for PG 16
Currently, MN is not supported on PG16. Therefore, the creation of
distributed restore points fails on PG16. This patch disables the CI
test for this PG version.
2023-11-09 11:43:49 +01:00
Fabrízio de Royes Mello
fbc1fbb64b PG16: Enable CI
This commit enables PG16 in the following workflows:
* Regression Linux (including 32bit)
* ABI test
* Memory tests
* Sanitizer tests
* Coverity
2023-11-04 13:29:02 -03:00
Sven Klemm
1126b08567 2.12.2 Post-release
Add 2.12.2 to update test scripts and add update downgrade metadata.
2023-10-23 18:31:36 +02:00
Fabrízio de Royes Mello
f12ed00cec Add CI check for unecessary template tests
When the regression tests output differs between PG versions we create a
template test file (*.sql.in) and add several different output files for
each supported version.

Over time we support new PG version and deprecate older ones, for
example nowadays we're working on PG16 support and removed PG12 so we
need to check if we still need template files.
2023-10-13 11:32:43 -03:00
Konstantina Skovola
5752c33b0a Post-release fixes for 2.12.1
Bumping the previous version and adding tests for 2.12.1.
Also adjust tagging date in changelog.
2023-10-13 10:55:51 +03:00
Dipesh Pandit
0b87a069e7 Add metadata for chunk creation time
- Added creation_time attribute to timescaledb catalog table "chunk".
  Also, updated corresponding view timescaledb_information.chunks to
  include chunk_creation_time attribute.
- A newly created chunk is assigned the creation time during chunk
  creation to handle new partition range for give dimension (Time/
  SERIAL/BIGSERIAL/INT/...).
- In case of an already existing chunk, the creation time is updated as
  part of running upgrade script. The current timestamp (now()) at the
  time of upgrade has been assigned as chunk creation time.
- Similarly, downgrade script is updated to drop the attribute
  creation_time from catalog table "chunk".
- All relevant queries/views/test output have been updated accordingly.

Co-authored-by: Nikhil Sontakke <nikhil@timescale.com>
2023-10-04 14:49:05 +05:30
Konstantina Skovola
c1b500f0be Fix pylint errors 2023-10-02 20:59:08 +03:00
Konstantina Skovola
f505bd2207 Add CI check for incorrect catalog updates
There are certain modifications/commands that should not be allowed
in our update/downgrade scripts. For example, when adding or dropping
columns to timescaledb catalog tables, the right way to do this is to
drop and recreate the table with the desired definition instead of doing
ALTER TABLE ... ADD/DROP COLUMN. This is required to ensure consistent
attribute numbers across versions.
This workflow detects this and some other incorrect catalog table
modifications and fails with an error in that case.

Fixes #6049
2023-10-02 12:15:59 +03:00
Sven Klemm
b339131c68 2.12.0 Post-release adjustments 2023-09-27 09:38:11 +02:00
Jan Nidzwetzki
683e2bcf18 Schedule compression policy more often
By default, the compression policy is scheduled for every
chunk_time_interval / 2 in the current implementation, equal to three
days and twelve hours with our default settings. This schedule interval
was sufficient for previous versions of TimescaleDB. However, with the
introduction of features like mutable compression and ON CONFLICT .. DO
UPDATE queries, regular DML operations decompress data. To ensure that
modified data is compressed earlier, this patch reduces the schedule
interval of the compression policy to run at least every 12 hours.
2023-09-22 12:30:57 +02:00
Sven Klemm
183362e17b Move size_util functions to _timescaledb_functions schema
To 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)
2023-08-22 12:05:23 +02:00
Sven Klemm
0a66bdb8d3 Move functions to _timescaledb_functions schema
To 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)
2023-08-21 15:01:35 +02:00
Sven Klemm
0dd06e919f Move get_create_command into _timescaledb_functions schema
To 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.
2023-08-21 11:29:37 +02:00
Konstantina Skovola
2080c3c0f0 Post-release fixes for 2.11.2
Bumping the previous version and adding tests for 2.11.2
2023-08-21 09:48:06 +03:00
Mats Kindahl
71b0168ab7 Add debug utilities to debug builds
This 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`.
2023-08-14 14:42:47 +02:00
Lakshmi Narayanan Sreethar
e5691bee11 Cleanup PG12 specific code from source and test files
Removed 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.
2023-07-25 16:00:18 +05:30
Lakshmi Narayanan Sreethar
c3a9f90fdd Merge PG12 specific testfiles
Merged testfiles that were split out due to their output differing only
in PG12.
2023-07-25 16:00:18 +05:30
Jan Nidzwetzki
b9a58dd5c4 Exclude workflow changes from being backported
The 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)
2023-07-03 12:57:12 +02:00
Jan Nidzwetzki
a7be1cc06a Fixed the ordering of merge_changelogs.sh script
The 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.
2023-06-30 11:33:57 +02:00
Jan Nidzwetzki
8a58101095 Post-release fixes for 2.11.1
Bumping the previous version and adding tests for 2.11.1.
2023-06-30 09:54:57 +02:00
Jan Nidzwetzki
f172679022 Added perltidy make target
This patch introduces the make target 'perltidy' to format Perl files
with perltidy. In addition, calling perltidy is added to 'make format'.
2023-06-26 10:59:19 +02:00
Zoltan Haindrich
769646bdb6 Fix issues with scripts/test_update_smoke.sh
The 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.
2023-06-07 13:30:21 +02:00
Zoltan Haindrich
ac7090653e Ensure PR number is referenced in the .unreleased files
Adds 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.
2023-06-02 18:33:53 +02:00
Zoltan Haindrich
ab2cccb6e2 Post-release 2.11.0
Adjust the upgrade/downgrade scripts and add the tests.

(cherry picked from commit d5fea0a842cbd38d2d72db16e9e67f1c9b1ccf36)
2023-05-25 18:22:32 +02:00
Maheedhar PV
38ee7f49b0 Every PR to have its own changelog
The 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.
2023-05-19 13:51:37 +05:30
Alexander Kuzmenkov
fb65086b55 Add a ubsan suppression for overflow in histogram()
It is in postgres code, and doesn't lead to bugs.
2023-05-16 21:32:52 +02:00
Fabrízio de Royes Mello
cc9c3b3431 Post-release 2.10.3
Adjust the upgrade/downgrade scripts and add the tests.
2023-04-28 10:05:11 -03:00
Alexander Kuzmenkov
12f3131f9e Post-release 2.10.2
Adjust the upgrade/downgrade scripts and add the tests.
2023-04-20 17:55:18 +04:00
Alexander Kuzmenkov
20db884bd7 Increase remote tuple and startup costs
Our 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.
2023-04-17 22:22:08 +04:00
Alexander Kuzmenkov
d32224a914 Add labels to backported PRs
Makes it easier to check what was done when looking at the release
milestone.
2023-04-17 13:26:57 +04:00
Fabrízio de Royes Mello
a3d778f7a0 Add CI check for missing gitignore entries
Whenever 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.
2023-04-14 12:46:20 -03:00
Rafia Sabih
3f9cb3c27a Pass join related structs to the cagg rte
In 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
2023-04-13 04:57:33 +02:00
Sven Klemm
00321dba41 2.10.1 Post-release adjustments
Add 2.10.1 to update test scripts and adjust the downgrade versioning.
2023-03-07 13:44:54 +01:00
Maheedhar PV
c8c50dad7e Post-release fixes for 2.10.0
Bumping the previous version and adding tests for 2.10.0
2023-02-24 12:03:36 +01:00
Jan Nidzwetzki
330bb8f4af Added coccinelle rule to find strlcpy on NameData
NameData 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.
2023-02-20 15:23:57 +01:00
Jan Nidzwetzki
7e43c702ba Increase timeout for PostgreSQL in upgrade tests
The 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.
2023-02-20 11:17:48 +01:00
Mats Kindahl
38b71d0e70 Use NameData and namestrcpy for names
Using `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`.
2023-02-17 10:43:46 +01:00
Alexander Kuzmenkov
caf79e0f5e When backporting, fetch the main branch with large depth
Apparently in some cases we're getting a shallow repo in the Github
Actions.
2023-02-08 18:48:53 +04:00