312 Commits

Author SHA1 Message Date
Sven Klemm
7608cb8719 2.7.2 Post-release
Add 2.7.2 to update tests and adjust downgrade script generation for
2.7.2.
2022-07-25 13:16:28 +02:00
Sven Klemm
ba41a92d9e Bump macOS version used in CI to 11
macOS 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
2022-07-21 20:09:27 +02:00
Konstantina Skovola
0e9dd3c70b Add config file and workflow for pull-review
This commit adds a workflow for running pull-review in
the serverless mode, using docker container CLI.
2022-07-20 09:16:46 +03:00
Sven Klemm
cfac68ec3d Ignore compression_chunk_race test in 12.0 and 13.2
The 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.
2022-07-18 14:34:49 +02:00
Mats Kindahl
5670378e03 Post-release fixes for 2.7.1 2022-07-12 12:18:25 +02:00
Jacob Champion
f400c75b79 Tweak commit-msg hook's line character limits
The 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.
2022-06-21 13:04:42 -05:00
Jacob Champion
bab5cc101d Update commit-msg hook to Python 3
This 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.
2022-06-21 13:04:27 -05:00
Sven Klemm
cb096757fa Bump Postgres version used in CI to 14.4
Make 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.
2022-06-20 07:59:16 +02:00
Luigi Servini
eb9f466582 Update dump_meta_data.sql
Added `c.dropped is false ` for table _timescaledb_catalog.chunk to
skip dropped chunks in the size calculation.
2022-06-10 19:17:51 +02:00
Sven Klemm
f0556dc902 Skip 001_extension test on PG13.2 in CI
The 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
2022-05-25 13:55:57 +02:00
Sven Klemm
cf9b626794 Post-Release 2.7.0
Adjust version.config and add 2.7.0 to update/downgrade test.
2022-05-24 12:54:06 +02:00
Sven Klemm
4f58132d37 Fix PG13.2 isolation tests
The 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.
2022-05-23 10:12:00 +02:00
Sven Klemm
94ca9c66f4 Ignore telemetry isolation test on PG13.2
Commit 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.
2022-05-20 21:37:01 +02:00
Sven Klemm
aa0b36d5ba Skip telemetry test on PG12.0
With 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.
2022-05-20 20:31:19 +02:00
Sven Klemm
b845f9423b Skip tablespace test on PG12.0
The tablespace test causes a segfault on PG12.0 due to an upstream
bug in the event trigger handling.
2022-05-20 17:18:21 +02:00
Sven Klemm
a7c8641e04 Bump postgres versions used in CI
Bump postgres versions used in CI to 14.3, 13.7 and 12.11.
2022-05-17 15:24:38 +02:00
Fabrízio de Royes Mello
557023c3a7 Revert "Ignore flaky "dist_gapfill_pushdown" test"
This reverts commit cf83b3b9c2d899fa0156d5c94dc4848b7584e3c9.
2022-05-16 15:21:32 -03:00
Sven Klemm
bb241ffcd1 Add missing ignores for dist_gapfill_pushdown
The patch to ignore result of dist_gapfill_pushdown missed some
places that overwrite installcheck_args.
2022-05-09 10:24:46 +02:00
Konstantina Skovola
cf83b3b9c2 Ignore flaky "dist_gapfill_pushdown" test
This 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.
2022-05-03 10:33:19 +03:00
Alexander Kuzmenkov
a1e76d2e84 Follow-up for compressed chunk collation #4236
Add a changelog message and add a check for broken chunks to the update
script.
2022-04-25 18:09:40 +05:30
Alexander Kuzmenkov
0ab2d39f25 Set correct collation for segmentby columns of compressed chunks
We 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.
2022-04-18 21:46:50 +05:30
Markos Fountoulakis
fab16f3798 Fix segfault in Continuous Aggregates
Add 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
2022-04-18 12:54:20 +03:00
Sven Klemm
ca6122e01a Fix downgrade test git failure
Due 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/
2022-04-18 07:50:49 +02:00
Fabrízio de Royes Mello
bb6dc173a0 Set PG14 as default scripts version
Set latest PG14 as the default Postgres version for scripts and some
minor fixes.
2022-04-13 09:39:07 -03:00
Sven Klemm
bdaa4607d4 Post release 2.6.1
Add 2.6.1 to update and downgrade tests.
2022-04-12 11:52:31 +02:00
Markos Fountoulakis
e9fb9acbbb Fix regressions found in nightly CI
Add concurrent_query_and_drop_chunks to ignore-list and fix C compiler
warning.
2022-03-03 19:29:58 +02:00
Mats Kindahl
15d33f0624 Add option to compile without telemetry
Add 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
2022-03-03 12:21:07 +01:00
Mats Kindahl
b909d4857d Fixes to smoke update tests
Smoke 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.
2022-03-01 13:15:46 +01:00
Sven Klemm
45cf7f1fa1 Document requirements for statements in sql files
Since we now lock down search_path during update/downgrade there
are some additional requirements for writing sql files.
2022-02-18 14:15:11 +01:00
Alexander Kuzmenkov
f29340281e Post release 2.6.0 2022-02-18 14:18:27 +03:00
Sven Klemm
65ffa44711 Bump postgres versions used in CI to 14.2, 13.6, 12.10 2022-02-12 03:39:56 +01:00
Sven Klemm
c07fe1f883 Post Release 2.5.2
Add 2.5.2 to update/downgrade scripts
2022-02-10 12:13:01 +01:00
Sven Klemm
c8b8516e46 Fix extension installation privilege escalation
TimescaleDB 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
2022-02-09 17:53:20 +01:00
Aleksander Alekseev
454d32539c Fix "nm: unknown argument -defined-only" error on MacOS
On 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.
2022-02-08 20:07:19 +03:00
Markos Fountoulakis
9248de2f2a Fix shellcheck warnings 2022-02-01 15:10:27 +02:00
Sven Klemm
481bf8b5a8 Fix downgrade test artifact upload
The artifact upload for the downgrade test was using the filenames
of the update test and so would never upload any files.
2022-02-01 00:20:14 +01:00
Sven Klemm
9e16d9f4e4 Add coccinelle scripts for detecting use-after-free
This 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.
2022-01-28 01:43:16 +01:00
Sven Klemm
5c22ef3da2 Rename continuous aggregate tests
Change 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.
2022-01-24 14:12:56 +01:00
Sven Klemm
c5796c0f1d Ignore memoize test in pg14 snapshot
Upstream 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.

6c32c09777
2022-01-17 14:44:58 +01:00
Sven Klemm
1f9bd81ee0 Adjust CI ignore lists to isolation test renames
Commit 6a8c2b66 renamed cagg tests in isolationcheck-t to have a
common prefix but did not adjust the CI ignorelists to reflect
that change.
2022-01-16 14:46:58 +01:00
Sven Klemm
69b267071a Bump copyright year in license descriptions
Bump 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.
2022-01-14 18:35:46 +01:00
gayyappan
d8d392914a Support for compression on continuous aggregates
Enable 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.
2021-12-17 10:51:33 -05:00
Duncan Moore
1bc1993c61 Post release 2.5.1 2021-12-03 13:51:11 -05:00
Mats Kindahl
210886e508 Ignore deadlock_recompress_chunk in early version
This isolation test will fail in early versions of the PG servers, just
like the other isolation tests, so ignoring failures for it.
2021-12-02 11:33:16 +01:00
Sven Klemm
0a82e7f0ab Add ABI test for minimum required pg version
This 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.
2021-11-18 17:17:14 +01:00
Mats Kindahl
ecb59170d3 Add krb5-dev dependency to alpine build
The 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.
2021-11-17 11:41:09 +01:00
Alexander Kuzmenkov
4a17d4c402 Add shellcheck to CI
Writing 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.
2021-11-15 14:54:14 +03:00
Sven Klemm
c91faad221 Add coccinelle workflow to CI
This 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/
2021-11-15 10:56:12 +01:00
Sven Klemm
e4ec15d881 Bump postgres versions used in CI to 12.9, 13.5, 14.1 2021-11-14 20:43:39 +01:00
Fabrízio de Royes Mello
df7f058ad1 Post release 2.5.0
Add 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.
2021-10-28 10:09:19 -03:00