2145 Commits

Author SHA1 Message Date
Sven Klemm
dc5ed1a92d Remove debian 8 from package test
This patch removes Debian 8 from the package test since its no
longer supported. This patch also fixes the repository URL for
centos 8.
2020-07-08 19:16:37 +02:00
Sven Klemm
fa223ae701 Use macros to define crossmodule wrapper functions
This patch adds a helper macro to define cross module
wrapper functions to reduce code repetition. It also
changes the crossmodule struct names to match the function
names where this wasn't the case already.
2020-07-07 16:55:35 +02:00
Sven Klemm
41c89b5648 Add 1.7.2 to update test scripts 2020-07-06 17:59:15 +02:00
Sven Klemm
d1fda03473 Fix github action cache handling on macOS
On macOS the path used is depending on the runner version leading to cache
failure when the runner version changes or is different from the one used to
build the cache. This patch extracts the runner version and adds it as
suffix to the cache key on macOS.
2020-07-06 14:21:00 +02:00
Sven Klemm
666369ea2e Migrate update test to GitHub actions
This patch migrates the update tests from Travis to GitHub actions.
2020-07-06 14:21:00 +02:00
Erik Nordström
cb789a5eff Cleanup unused code paths
This change removes some code paths that are no longer used after the
removal of PG10 and PG9.6 support.
2020-07-06 13:07:29 +02:00
Mats Kindahl
76648557bb Remove ts_dimension_slice_insert_multi parameter
One parameter was always true. This commit remove the parameter and
update the logic to match the existing usage.
2020-07-06 12:36:44 +02:00
Sven Klemm
e6020e88d8 Fix syntax error in apt package test
The notification configuration for the apt package test was missing
a dollar sign in front of the variables leading to failing variable
interpolation.
2020-07-06 11:09:23 +02:00
Sven Klemm
9c026b2194 Add missing ORDER BY clause to chunk_api test
The chunk_api test fails sometimes because of inconsistent resultset
ordering in one of the queries. This patch adds the missing ORDER BY
clause to that query.
2020-07-06 11:09:23 +02:00
Sven Klemm
7fc7b2c360 Release 1.7.2
This maintenance release contains bugfixes since the 1.7.1 release. We deem it medium
priority for upgrading.

In particular the fixes contained in this maintenance release address bugs in continuous
aggregates, drop_chunks and compression.

**Features**
* #1877 Add support for fast pruning of inlined functions

**Bugfixes**
* #1908 Fix drop_chunks with unique constraints when cascade_to_materializations is false
* #1915 Check for database in extension_current_state
* #1918 Unify chunk index creation
* #1932 Change compression locking order
* #1938 Fix gapfill locf treat_null_as_missing
* #1982 Check for disabled telemetry earlier
* #1984 Fix compression bit array left shift count
* #1997 Add checks for read-only transactions
* #2002 Reset restoring gucs rather than explicitly setting 'off'
* #2028 Fix locking in drop_chunks
* #2031 Enable compression for tables with compound foreign key
* #2039 Fix segfault in create_trigger_handler
* #2043 Fix segfault in cagg_update_view_definition
* #2046 Use index tablespace during chunk creation
* #2047 Better handling of chunk insert state destruction
* #2049 Fix handling of PlaceHolderVar in DecompressChunk
* #2051 Fix tuple concurrently deleted error with multiple continuous aggregates

**Thanks**
* @akamensky for reporting an issue with telemetry and an issue with drop_chunks
* @darko408 for reporting an issue with decompression
* @dmitri191 for reporting an issue with failing background workers
* @eduardotsj for reporting an issue with indexes not inheriting tablespace settings
* @fourseventy for reporting an issue with multiple continuous aggregrates
* @fvannee for contributing optimizations for pruning inlined functions
* @jflambert for reporting an issue with failing telemetry jobs
* @nbouscal for reporting an issue with compression jobs locking referenced tables
* @nicolai6120 for reporting an issue with locf and treat_null_as_missing
* @nomanor for reporting an issue with expression index with table references
* @olernov for contributing a fix for compressing tables with compound foreign keys
* @werjo for reporting an issue with drop_chunks and unique constraints
2020-07-04 11:54:10 +02:00
gayyappan
43edbf8639 Fix concurrent tuple deletes for continuous aggregates
When we have multiple continuous aggregates defined on
the same hypertable, they could try to delete the hypertable
invalidation logs concurrently. Resolve this by serializing
invalidation log deletes by raw hypertable id.

Fixes #1940
2020-07-03 23:46:01 -04:00
Sven Klemm
d649d493f6 Add testing for RPM packages
This workflow will install our rpm packages and then try to enable
timescaledb in the database and also check the version installed
from the package against the expected version.
2020-07-03 16:10:18 +02:00
Sven Klemm
68ba6e073c Add regresscheck-shared sql files to license check
This adds the directories used by regresscheck-shared to the license
check and adds a license where it is currently missing.
2020-07-03 13:00:36 +02:00
Mats Kindahl
73ffc466cb Add isolation test for drop_chunks and insert
If a new chunk is created as part of an insert and drop_chunks runs
concurrently with the insert, there is a risk of a race. This is a test
for this.

Add locks for dimension slice tuples

If a dimension slice tuple is found while adding new chunk constraints
as part of a chunk creation it is not locked prior to adding the chunk
constraint. Hence a concurrently executing `drop_chunks` can find a
dimension slice unused (because there is no chunk constraint that
references it) and subsequently remove it. The insert will the continue
to add the chunk constraint with a reference to a now non-existent
dimension slice.

This commit fixes this by locking the dimension slice tuple with a
share lock when creating chunks and locking the dimension slice with an
exclusive lock prior to scanning for existing chunk constraints.

The commit also contains a script that repair the `dimension_slice`
table if it is broken by extracting information about dimension slices
that are mentioned in `chunk_constraint` table but not present in
`dimension_slice` table and re-create the rows from the constraints on
the chunks.
2020-07-02 19:20:07 +02:00
Ruslan Fomkin
cfb3331cab Use index tablespace during chunk creation
If a tablespace is provided for an index on a hypertable, it will be
also used for the index on new chunks. This is done when constraints
are created on new chunk from the hypertable constraints.

Fixes #903
2020-07-02 16:22:44 +02:00
Sven Klemm
9c49a47fbb Fix handling of PlaceHolderVar in DecompressChunk
When the relation targetlist of the uncompressed chunk contained
PlaceHolderVars the construction of the relation targetlist of
the compressed chunk would fail with an error. This patch changes
the behaviour to recurse into those PlaceHolderVar.
2020-07-02 14:07:39 +02:00
Oleg Smirnov
0e9f1ee9f5 Enable compression for tables with compound foreign key
When enabling compression on a hypertable the existing
constraints are being cloned to the new compressed hypertable.
During validation of existing constraints a loop
through the conkey array is performed, and constraint name
is erroneously added to the list multiple times. This fix
moves the addition to the list outside the conkey loop.

Fixes #2000
2020-07-02 12:22:30 +02:00
Mats Kindahl
4cd90789da Add tests for hypertable unique constraint crash
If a unique constraint is created on a hypertable, it could under some
circumstance crash. This commit adds a test for this situation even
though it was already fixed (but was reported on the 1.7 branch).
2020-07-01 19:38:37 +02:00
Sven Klemm
3823db1218 Merge pg_regress.sh and pg_isolation_regress.sh
Since pg_regress.sh and pg_isolation_regress.sh were almost
identical this patch combines them into a single script.
This patch also changes the dynamic schedule generation
so make installcheck TESTS='foo' is supported again which
was broken by previous refactoring and you needed to specify
the exact suite your test was in if you wanted to use TESTS.
2020-07-01 13:55:28 +02:00
Sven Klemm
d85309d268 Add testing for released apt packages
This workflow will install our apt package and then try to enable
timescaledb in the database and also check the version installed
from the package against the expected version.
2020-06-30 22:57:03 +02:00
Brian Rowe
029b4e867e Fix potential mem corruption in distributed copy
This change copies the chunk object into the distributed copy's
memory context before caching it in the ChunkConnectionList. This
resolves an issue where the chunk was being modified after being
stored which was resulting in rows being sent to the incorrect
data node.

This fixes github issue #2037
2020-06-30 12:05:03 -07:00
Sven Klemm
3e5e5255f2 Fix segfault in cagg_update_view_definition
Since relation_close will decrease the reference counter this
might lead to the relation being freed while we are still using
the view query. This patch changes cagg_update_view_definition
to release the relations later and also keeps the locks till
the end of the transaction.
2020-06-30 20:22:00 +02:00
Sven Klemm
4e41672161 Remove unused functions
Remove functions that are no longer used due to refactorings.
Removes the following functions:
- hypertable_tuple_match_name
- ts_hypertable_get_all_by_name
- ts_hypertable_has_tuples
2020-06-30 18:05:16 +02:00
Sven Klemm
586f057ad0 Retain parallel schedule when using IGNORES
When either TESTS, SKIPS or IGNORES is set for a regression check
run we would generate a new temporary schedule based on those
variables without any parallelity. This patch changes the behaviour
to keep the original test schedule when only IGNORES is specified
and just prepend the ignore lines to a copy of the original schedule.
2020-06-30 17:47:40 +02:00
Sven Klemm
0e8adc97f4 Fix segfault in create_trigger_handler
The TriggerDesc from rel->trigdesc seems to be modified during
iterations of the loop and sometimes gets reallocated leading
to a situation where the local variable trigdesc no longer matches
rel->trigdesc leading to a segfault in create_trigger_handler.

Fixes #2013
2020-06-30 12:03:40 +02:00
Sven Klemm
8a1976a6b9 Upload coredumps as artifact
This patch adds collecting coredumps to the regression workflow
in addition to the binary all shared libraries used by the coredump
are collected as well.
2020-06-29 21:48:12 +02:00
Sven Klemm
c96216e631 Improve github action stacktrace handling
Check for coredumps and only execute the stracktrace if there are
actually coredumps. This patch also changes the log handling to
always collect logs and upload them cause they might have useful
information even when all steps succeed. Additionally a list
of all failed tests is shown before the regression diff.
This patch also disables fail-fast so a single failed job does
not cancel other jobs still in progress.
2020-06-29 17:50:53 +02:00
Dmitry Simonenko
23eeecc4e5 Do not forward relcache invalidation as syscache invalidation
It is incorrect to forward relcache invalidations as syscache
invalidations, like cacheid = InvalidOid which is not possible
condition at the moment. Allow syscache invalidations only for
FOREIGNSERVEROIDs.
2020-06-29 17:13:22 +03:00
Sven Klemm
b1eeb56c12 Execute regresscheck-t tests in parallel
This patch adds parallel execution capabilities to regresscheck-t.
2020-06-26 10:47:17 +02:00
Sven Klemm
48b969ecc0 Disable fsync for appveyor
In our normal regression tests fsync is already disabled because
the cluster is initialized by pg_regress which turns fsync off,
but for all tests using regresschecklocal the setting will be missing
because the cluster is initialized outside of pg_regress.
2020-06-25 18:42:54 +02:00
Sven Klemm
0c1f967ef8 Refactor transparent_decompression test
This PR reduces the dataset size in the transparent_decompression
test to make it finish in a more reasonable time. It also splits
the test and modifies queries that used now(). Due to the change
in dataset size the resulting diff is rather large but is mostly
row count changes in the plan but the actual plan shapes don't
change. In addition to those changes to some LATERAL queries
additional constraints have been added to reduce the number of
loops.
2020-06-25 18:42:54 +02:00
Ruslan Fomkin
a0034e44db Add status badge for Linux i386 build 2020-06-25 15:41:15 +02:00
Dmitry Simonenko
9ec944a4dc Refactor process utility functions result type
Introduce and use explicit enum type for process utility functions return
value instead of using bool type.
2020-06-25 14:40:25 +03:00
Sven Klemm
65b3a0a991 Constify TIMESTAMPTZ OP INTERVAL in constraints
Constify expressions of the following form in WHERE clause:

column OP timestamptz - interval
column OP timestamptz + interval
column OP interval + timestamptz

Iff interval has no month component.

Since the operators for timestamptz OP interval are marked
as stable they will not be constified during planning.
However, intervals without a month component can be safely
constified during planning as the result of those calculations
do not depend on the timezone setting.
2020-06-25 12:41:34 +02:00
Sven Klemm
0d2cc046c2 Ignore continuous_aggs_insert and continuous_aggs_multi on PG11.0
The log output in the isolation tests when running on PG 11.0 seems
to be suppressed and not be recorded leading to a diff in the test
output.
2020-06-24 21:20:17 +02:00
Sven Klemm
ccbe67f94f Run regresscheck-shared tests in parallel
This patch changes regresscheck-shared to no longer run individual
tests serially but runs them in parallel instead.
2020-06-23 14:35:20 +02:00
Sven Klemm
0e532a165f Include local variables in github action stacktrace
This patch adds local variables to github action stacktraces to
add more context and make investigating issues easier.
2020-06-23 13:47:20 +02:00
Sven Klemm
1f93536704 Change testsupport.sql to not reference tsl code
testsupport.sql had a reference to TSL code which will fail in
apache-only code since this file is included in every test run
for every build configuration.
2020-06-23 12:12:15 +02:00
Sven Klemm
71ed454779 Give regression artifacts unique names
Since within a workflow artifacts share a namespace we need to make
sure artifacts have a unique name within the workflow so other
runs in the same workflow don't overwrite artifacts.
2020-06-22 18:14:29 +02:00
Sven Klemm
ae0f17705b Improve behaviour of test runner when being run in parallel
The test runner used to use a lockfile to decide whether
initial cluster setup has to be done. Unfortunately
checking for existance and creating the lockfile are 2 distinct
operations leading to race conditions. This patch changes the
runner to use a directory instead because with a directory
the operation is atomic.
2020-06-22 18:14:29 +02:00
Sven Klemm
a959281e48 Replace Travis badge with GitHub badge
Since most of our regression tests run on GitHub actions now this
patch replaces the build status badge from Travis with a GitHub
actions one.
2020-06-22 18:14:29 +02:00
David Kohn
66544c7564 Reset restoring gucs rather than explicitly setting 'off'
Setting the `timescaledb.restoring` guc explicitly to 'off'
for the db meant that the setting got exported in `pg_dumpall`
and some other cases where that setting would then conflict
with the setting set by the pre_restore function causing it to
be overridden and causing errors on restore. This changes to
`RESET` so that instead it will take the system default and not
be dumped separately as an override.
2020-06-22 11:43:27 -04:00
Dmitry Simonenko
04bcc949c1 Add checks for read-only transactions
This change ensures that API functions and DDL operations
which modify data respects read-only transaction state
set by default_transaction_read_only option.
2020-06-22 17:03:04 +03:00
Sven Klemm
ab293976f2 Make TSL_MODULE_PATHNAME available in testsupport.sql
This patch makes TSL_MODULE_PATHNAME available when executing
testsupport.sql in the regression test runner. This fixes an
error that happened in the test runner that was suppressed
because it happens before the actual test run.
2020-06-22 12:08:17 +02:00
Sven Klemm
157764c70e Remove dynamic version checks from SQL tests
The sql tests still had version checks and would run EXPLAIN
with different parameters depending on postgres version. Since
all supported postgres versions now support all the parameters
we use we can safely remove the version check.
2020-06-22 12:08:17 +02:00
gayyappan
b93b30b0c2 Add counts to compression statistics
Store information related to compressed and uncompressed row
counts after compressing a chunk. This is saved in
compression_chunk_size table.
2020-06-19 15:58:04 -04:00
Sven Klemm
5aaa07b9ee Fix flaky reorder_vs_insert isolation test
This patch makes the lock_timeout values for the 2 sessions distinct
so they will always fire in the same order leading to reproducable
results.
2020-06-19 19:40:02 +02:00
Sven Klemm
5b7f2fec18 Disable CI fail-fast for code style and i386 test
When fail-fast is true a single failing job will cancel
the entire workflow which is not desirable for scheduled runs
and the code style tests. This patch changes fail-fast
to false for the code style tests and the scheduled i386 tests.
It also changes the different code style check steps to always
run.
2020-06-19 19:40:02 +02:00
Sven Klemm
5659cb7515 Remove postgres 10 test files
Remove files that got introduced by rebase error or were missed
during removal of PG9.6 and PG10 support.
2020-06-19 19:40:02 +02:00
Sven Klemm
6d84751ebb Remove handling for pre PG10 version format
The telemetry code still had code to handle the version format used
by postgres before PG10 which is dead code now since PG11 is the
minimum version. This patch removes that code path.
2020-06-19 19:40:02 +02:00