Postgres knows whether a given aggregate is parallel-safe, and creates
parallel aggregation plans based on that. The `partialize_agg` is a
wrapper we use to perform partial aggregation on data nodes. It is a
pure function that produces serialized aggregation state as a result.
Being pure, it doesn't influence parallel safety. This means we don't
need to mark it parallel-unsafe to artificially disable the parallel
plans for partial aggregation. They will be chosen as usual based on
the parallel-safety of the underlying aggregate function.
Multinode queries use _timescaledb_internal.chunks_in to specify
the chunks from which to select data. The chunk id in
regresscheck-shared is not stable and may differ depending on
execution order leading to flaky tests.
While we do filter out chunk ids and hypertable ids from the test
output, the output was still unstable when those ids switch between
single and double digit as that changes the length of the query
decorator in EXPLAIN output. This patch removes this decorator
entirely from all shared test output.
Commit 9b180915 introduce some tests that are a bit flaky because are
checking a DEBUG message from Postgres catcache rehashing.
Fixed it by teaching our test runner to ignore this Postgres DEBUG
message.
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.
Currently any tests in regresscheck-shared can only include
EXPLAIN output if they only access the precreated hypertables
as hypertables and chunks created in the test itself will
have ids depending on execution order of the shared tests.
This patch filters out those ids so shared tests can include
EXPLAIN output for local hypertables.
EXPLAIN ANALYZE output of incremental sort nodes contains details
about memory usage which is not stable and might lead to flaky tests.
This patch filters out memory usage from test output.
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.
This PR adds test infrastructure for running tests with shared tables.
This allows having hypertables with specific configurations usable for
all tests. Since these tests also don't require creating a new database
for each test case some of the overhead of the normal tests is removed.
While this will lead to much faster query tests some tests will still
require their own database to test things, but most queres could be moved
to this infrastructure to improve test coverage and speed them up.