16 Commits

Author SHA1 Message Date
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
Sachin
29f35da905 Fix Github CI failures
Not 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>
2022-12-05 18:15:21 +05:30
Konstantina Skovola
54ed0d5c05 Introduce fixed schedules for background jobs
Currently, 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.
2022-10-18 18:46:57 +03: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
Mats Kindahl
bff87a8e2b Disable tests by default if tools are not found
If tools like `pg_regress` or `pg_isolation_regress` are not found, an
error is generated telling you that you need to disable the tests
explicitly using `REGRESS_CHECKS`. This is an inconvenience for the
user since in most cases you just want to build the system with what
you have.

This commit changes that by automatically disabling regression tests,
isolation tests, TAP tests, and formatting targets when tools cannot be
found, which means that users do not normally have to disable tests
explicitly. A notice is still printed that the targets are not added.

In addition, the commit adds an option `REQUIRE_ALL_TESTS` for the rare
case when you want to make sure that all tests are indeed executed (for
example, in CI runs), which by default is off.
2021-08-11 15:28:09 +02:00
Sven Klemm
39cb98bcc4 Fix sanitizer test
The sanitizer test is running on PG11.1 where the cluster test is
expected to fail. This patch changes the sanitizer test to ignore
the test result of the cluster test.
2021-02-18 12:13:14 +01:00
Sven Klemm
1eceee3151 Fix sanitizer test script
This patch removes the -t and -i options from docker exec
since this script is not interactive and not run in terminal
on CI.
2020-08-29 23:15:20 +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
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
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
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
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
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
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
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
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