348 Commits

Author SHA1 Message Date
Sven Klemm
0bff7dcac3 Run linux regression tests as GitHub action
Since we want to run additional test configurations when triggered
by a push to prerelease_test or by cron but github actions don't
allow a dynamic matrix via yaml configuration we generate the matrix
with a python script. While we could always have the full matrix
and have if checks on every step that would make the actual checks
harder to browse because the workflow will have lots of entries and
only by navigating into the individual jobs would t sit be visible
if a job was actually run.
Additionally we set fail-fast to true for pull requests and false
for other event types.
2020-06-15 00:56:33 +02:00
Sven Klemm
129aa47987 Adjust export prefix check to work with clang
This patch changes the export prefix check to ignore symbols
present in clang builds.
2020-06-15 00:56:33 +02:00
Sven Klemm
835ec5af10 Change export prefix check to work with gcov
This patch adjusts the export prefix check to exclude some symbols
present when using older toolchain and also includes gcov symbols
so export prefix check can be used on coverage enabled builds.
2020-06-10 15:09:31 +02:00
Sven Klemm
c90397fd6a Remove support for PG9.6 and PG10
This patch removes code support for PG9.6 and PG10. In addition to
removing PG96 and PG10 macros the following changes are done:

remove HAVE_INT64_TIMESTAMP since this is always true on PG10+
remove PG_VERSION_SUPPORTS_MULTINODE
2020-06-02 23:48:35 +02:00
Sven Klemm
92bdcf02d1 Fix license check return code
This patch fixes the return code of the license check, previously
it would always return the return code of the apache license check.
Additionally we check for the license in versioned sql base files
too so we dont miss files without license when the versioned sql
file has not been generated.
This patch also adds a missing newline to the jit_load.sql file
so the license check properly detects the license and fixes the
license for the continuous_aggs_union_view test.
2020-06-02 11:13:10 +02:00
Ruslan Fomkin
6bc4765f4d Remove regression tests on PG 9.6 and 10
The first step of removing support for PG 9.6 and 10 is to remove the
regression tests, which run against PostgreSQL versions 9.6 and 10.
2020-05-28 15:14:09 +02:00
Erik Nordström
f64fd4247f Make image build script work with remote Docker
This change tweaks the `docker-build.sh` script to work against remote
Docker daemons. This is useful when testing on minikube and you want
to quickly build and deploy a new image with the current code without
having to push to a remote registry.
2020-05-27 17:31:09 +02:00
Dmitry Simonenko
f7a39c6deb Support SSL with Certificate Based Authentication
Add a tunable way to support SSL connections to data nodes
with optional certificate based authentication.

Switch test suite to use pre-generated certificates.
2020-05-27 17:31:09 +02:00
Matvey Arye
af7d9fe4d6 Add remote txns support (1pc)
This commit adds the ability to open remote transactions
that share transactional semantics with the ongoing local
transaction. This is done by adding txn hooks to the local
transaction that performs txn commands on remote nodes.

This commit adds the 1pc variant of the commit protocol.
A 2-pc variant is going to be added in an upcoming PR.
The 1pc variant exists mostly for performance testing (i.e. how much is the 2pc penalty).
But, there are also cases where 1pc is good enough (non-critical
data and/or data backed by Kafka).

Note that the remote_txn test is not run during sanitizer tests due to
an apparent bug in PostgreSQL. (The test fails on an assertion of a
global variable `AbortStartTime`, which is non-atomic although read
across the ServerLoop and signal handlers.)
2020-05-27 17:31:09 +02:00
Sven Klemm
1df97acfd2 Add 1.7.1 to update test scripts 2020-05-19 15:00:16 +02:00
Sven Klemm
5a6fd603e6 Add 1.7.0 to update test scripts
Due to the changes of the default view behaviour of continuous
aggregates we need a new testsuite for the update tests for 1.7.0

This patch also changes the update test for 9.6 and 10 to run on
cron and 11 and 12 on pull request.
2020-04-21 01:39:00 +02:00
Mats Kindahl
7776062638 Remove pull of TSDB dev tools
The memory leak job pulls TSDB dev tools from bitbucket but only two
files from that repository are needed.

This commit copy the files from the `tsdb-dev-tools` repository, remove
the need to clone the repository, update the memory leak job to use
these files, and remove the two secrets containing the environment
variables `USR` and `PASSWORD`.
2020-04-14 23:12:15 +02:00
Ruslan Fomkin
5cc91e34de Add CRON jobs for PG12
Adds several jobs to run on PG12 as they run on all other PG major
versions in CRON builds. Fixes 32-bits jobs.
2020-04-14 23:12:15 +02:00
Erik Nordström
176b616e37 Refactor insert and copy paths
The INSERT and COPY paths have been refactored to better handle
differences between PostgreSQL versions. In particular, PostgreSQL 12
introduced the new table access mangement (AM) API which ties tuple
table slots to specific table AM implementations, requiring more
careful management of those data structures.

The code tries to adopt the new (PG12) API to the extent possible,
providing compatibility layers and functions for older PostgreSQL
versions where needed.
2020-04-14 23:12:15 +02:00
Ruslan Fomkin
403782a589 Run regression test on latest PG versions
Docker images are build with latest versions of PostgreSQL, thus
updating regression tests to run on the latest PG versions. Fixing
authentication for PG docker images, since it is required after a
recent change in docker-library/postgres@42ce743.

Running isolation tests on new versions of PG produces additional
output:
- Notifications are not missed to print postgres/postgres@ebd4992
- Notifications are prefixed with session name
postgres/postgres@a28e10e
- Timeout cancellation is printed in isolation tests
postgres/postgres@b578404

The expected outputs are modified to succeed on latest PG versions,
while the affected isolation tests are disabled for earlier versions
of PG.
2020-04-02 08:57:28 +02:00
Sven Klemm
d9aa40d36d Merge 9.6 specific update test files 2020-03-21 20:55:06 +01:00
Sven Klemm
b38b0d05b0 Add 1.6.1 to update test scripts 2020-03-21 20:55:06 +01:00
Sven Klemm
442a173ad6 Add 1.5.1 and 1.6.0 to update test scripts 2020-01-20 14:36:22 +01:00
Matvey Arye
707bb9d584 Add compression to update tests
Add a test using cmpressed tables to our extension update
test suite.
2019-11-11 17:10:13 -05:00
Matvey Arye
e575cc2b88 Add tests for updates of catalog tables
PG11 added an optimization where columns that were added by
an ALTER TABLE that had a DEFAULT value did not cause a table
re-write. Instead, those columns are filled with the default
value on read.

But, this mechanism does not apply to catalog tables and does
not work with our catalog scanning code. This tests makes
sure we never have such alters in our updates.
2019-11-07 12:12:54 -05:00
Matvey Arye
d34731a4e3 Add update test on PG11
Change travis to to run update tests on PG11.
2019-11-07 12:12:54 -05:00
Sven Klemm
41209fd629 Add 1.5.0 to update test scripts 2019-11-07 15:56:20 +01:00
Mats Kindahl
b2918e58fe Fix permission issue in test_sanitizer
The `test_sanitizer.sh` test failed because source code was being
copied from the host to the container as user `postgres` and this user
did not have read permissions on the mounted directory. This is fixed
by copying the files as `root` and then changing the owner to
`postgres`.

The commit also removes `wait_for_pg` since PostgreSQL server status is
not relevant for the tests since they start their own temporary
instance.

The commit also switches to use here-is documents for the execution for
readability purposes.
2019-11-07 08:54:32 +01:00
Sven Klemm
81d5db662a Fix export_prefix_check script
The export_prefix_check script would not set proper exit code
depending on the found exported functions.
2019-10-15 14:42:02 +02:00
Mats Kindahl
3fa3822d08 Only update reformatted files
When running `make format` it will update all files. If a file does not
actually require reformatting, it will trigger a re-build of the entire
code base.

This commit instead compare the re-formatted file with the existing one
and does not update it unless it has actually changed.
2019-10-03 17:32:40 +02:00
Joshua Lockerman
1cc1b7c14e Fix memory leaks part 1: BGWs
This commit fixes memory leaks in the Background Worker infrastructure.
Notably, it fixes a leak in the launcher and BGW scheduler where shared
message queue handles would not be freed, and it fixes a leak where
BackgroundWorkerHandles were not freed in the scheduler.
2019-10-02 15:54:39 -04:00
Sven Klemm
b2d7be31bb Add 1.4.2 to update test scripts 2019-09-12 14:53:59 +02:00
Sven Klemm
ee9fc6af4c Add 1.4.1 to update test scripts 2019-08-02 15:00:05 +02:00
Sven Klemm
f8f5a73fd2 Add 1.4.0 to update test scripts 2019-07-18 21:14:14 +02:00
Sven Klemm
70fd8df015 Add missing license information
Add license information to files missing it and fix the license
check script to honor the return code of both the apache license
check and the TSL license check. Previously errors occurring during
apache license check would not be reflected in the return code of
the script, so only the TSL license check was effective.
2019-07-13 17:18:57 +02:00
Mats Kindahl
368a5c80cb Disable tool checks for test_sanitizers.sh
The `test_sanitizers.sh` script do not require regress tools, so
turning off regress tools check when calling CMake.
2019-07-09 15:40:35 +02:00
Mats Kindahl
d1f8f9d326 CMake check for necessary testing tools
Adding checks for `pg_isolation_regress` and `pg_regress` and not
running the tests if the programs cannot be found either installed in
default directories or provided with the `PG_PATH` variable, or the
`PG_SOURCE_DIR` variable.
2019-06-28 13:47:28 +02:00
Sven Klemm
743a22f1fa Add 1.3.2 to update test scripts 2019-06-25 05:11:32 +02:00
Matvey Arye
33d28d2217 Test continuous aggs with extension updates
Add a v3 update test that makes sure that continuous aggregates
continue to work after extensions are updated.
2019-06-12 09:43:35 -04:00
Sven Klemm
70a02b5410 Add 1.3.1 to update test scripts 2019-06-10 21:15:56 +02:00
Matvey Arye
5e10efdff3 Run ABI tests on consistent alpine versions
Previously the compile image for the ABI tests was based on a different
postgres image than the run image (e.g. 10-alpine vs 10.2-alpine). This
created dependency problems between different version of ssl packages
that may be available under different alpine versions.

We fix this by forcing the run image to be based off of the same image
as the compile version.
2019-05-29 20:55:25 -04:00
Matvey Arye
5917938569 Fix ABI smoke test
This fix makes the smoke test return the correct exit code. It also
adds libssl1.0, which is needed for some openssl functionality.
2019-05-29 13:31:07 -04:00
Sven Klemm
bfabb30be0 Release 1.3.0 2019-05-07 02:47:13 +02:00
Joshua Lockerman
d5716fe200 Fix sanitizer and release tests
We were not building timescaledb with debug enabled in the sanitizer
tests, causing tests which needed debug symbols to fail. This commit
changes the sanitizer tests to include such symbols. We still enable
optimizations, as that results in more realistic build environment for
memory tests.
This commit also ensures some tests which should only be run in debug
builds are in fact only run in debug builds.
2019-04-29 15:02:05 -04:00
Sven Klemm
5695e32858 Fix syntax error in commit hook 2019-04-09 13:45:20 +02:00
Sven Klemm
0823498b25 Stop processing commit message on scissors line
The commit message template may include the actual diff to be
committed separated with a special scissors line. This patch adds
support for the scissors line to the commit hook otherwise
the diff content may trigger any of the rules.
2019-04-09 11:07:30 +02:00
Erik Nordström
18a8afd1f8 Add a gitignore for Git hook tests
Running the git hook tests will leave some Python byte code files
lying around. This change hides those using a gitignore file.
2019-04-08 14:01:00 +02:00
Erik Nordström
881e3729c4 Add a Git commit hook to validate commit messages
Our coding guidelines recommend following "The seven rules of a great
Git commit message" by Chris Beams:

https://chris.beams.io/posts/git-commit/

This change adds a Git commit hook that validates all Git commit
messages according to these rules (at least to the extent possible).
Currently, the hook simply prints a warning and a list of violations
in case of a non-conforming Git commit message. The commit is
otherwise accepted. This could be changed to entirely fail the commit,
or, via another hook, fail to push any code that is non-conformant.

The hook will be installed on a CMake run or when the hook source
changes.
2019-04-08 10:38:41 +02:00
Sven Klemm
e6dec5fff3 Improve information displayed on sanitizer test failure
Only print postgres log and regression diff for the instance
that actually failed for regresscheck and regresscheck-t
respectively.
2019-04-04 23:31:33 +02:00
Joshua Lockerman
dbe2bab392 Add array_unnest to alignment supressions it looks like trigger lookup triggers it 2019-04-01 12:14:16 -04:00
Sven Klemm
fcb5d8a41a Print regresscheck-t diff after sanitizer test
Change test_sanitizers.sh to always run regresscheck-t even when
regresscheck fails and print regresscheck-t diff on errors.
2019-03-30 02:11:51 +01:00
Sven Klemm
f2aea211bd Add 1.2.2 to update test scripts 2019-03-14 19:23:11 +01:00
Joshua Lockerman
72f4692c21 Add the ability to set the number of parallel tests from cmake and have sanitizer tests do so
With the forthcoming new sanitizer image running tests in parallel
causes machines to run out of resources, and fail tests spuriously
This commit forces test_sanitizers.sh to run tests sequentially to
prevent this.
2019-02-21 10:37:06 -05:00
Sven Klemm
33ef1de542 Add treat_null_as_missing option to locf
When doing a gapfill query with multiple columns that may contain
NULLs it is not trivial to remove NULL values from individual columns
with a WHERE clause, this new locf option allows those NULL values
to be ignored in gapfill queries with locf.

We drop the old locf function because we dont want 2 locf functions.
Unfortunately this means any views using locf have to be dropped.
2019-02-16 00:09:38 +01:00
Joshua Lockerman
bf3b3b8a69 Add sanitizer based tests
This commit adds a sanitizer run script, and updates travis to
run it in our nightly builds. Valgrind has been very slow and
unstable, so much so that we only run it during pre-release
tests, and even then it doesn't necissarily provide useful
output. The sanitizer tests run about 10x faster, and seem
stable.

We currently only run ASan and UBSan, as MSan has too many
issues within postgres's own initialization functions. As MSan
cannot be added to a binary that enables ASan, it would require
separate jobs anyway.
2019-02-13 18:12:43 -05:00