366 Commits

Author SHA1 Message Date
Lakshmi Narayanan Sreethar
e5691bee11 Cleanup PG12 specific code from source and test files
Removed the PG12 specific macros and all the now, dead code. Also updated
the testcases which had workarounds in place to make them compatible
with PG12.
2023-07-25 16:00:18 +05:30
Lakshmi Narayanan Sreethar
c3a9f90fdd Merge PG12 specific testfiles
Merged testfiles that were split out due to their output differing only
in PG12.
2023-07-25 16:00:18 +05:30
Jan Nidzwetzki
b9a58dd5c4 Exclude workflow changes from being backported
The backport script for the PRs does not have the permission to backport
PRs which include workflow changes. So, these PRs are excluded from
being automatically backported.

Failed CI run:

https://github.com/timescale/timescaledb/actions/runs/5387338161/
   jobs/9780701395

> refusing to allow a GitHub App to create or update workflow
> `.github/workflows/xxx.yaml` without `workflows` permission)
2023-07-03 12:57:12 +02:00
Jan Nidzwetzki
a7be1cc06a Fixed the ordering of merge_changelogs.sh script
The CHANGELOG.MD file contains the sections features, bugfixes, and
thanks. This patch adjusts the script merge_changelogs.sh to produce
the sections in the same order.
2023-06-30 11:33:57 +02:00
Jan Nidzwetzki
8a58101095 Post-release fixes for 2.11.1
Bumping the previous version and adding tests for 2.11.1.
2023-06-30 09:54:57 +02:00
Jan Nidzwetzki
f172679022 Added perltidy make target
This patch introduces the make target 'perltidy' to format Perl files
with perltidy. In addition, calling perltidy is added to 'make format'.
2023-06-26 10:59:19 +02:00
Zoltan Haindrich
769646bdb6 Fix issues with scripts/test_update_smoke.sh
The test was failing on first run by leaving a database behind as a
sideeffect.
Between two steps the extension was dropped; without a proper cleanup.
A non-existent sql function was called during cleanup.

This patch also removes the "debug mode" and every execution will leave
the logs/etc in the /tmp directory for further inspection.
2023-06-07 13:30:21 +02:00
Zoltan Haindrich
ac7090653e Ensure PR number is referenced in the .unreleased files
Adds a simple check to ensure that the PR number is present at least once
in the added changelog file.
Also fixes an earlier PR which introduced a typo.
2023-06-02 18:33:53 +02:00
Zoltan Haindrich
ab2cccb6e2 Post-release 2.11.0
Adjust the upgrade/downgrade scripts and add the tests.

(cherry picked from commit d5fea0a842cbd38d2d72db16e9e67f1c9b1ccf36)
2023-05-25 18:22:32 +02:00
Maheedhar PV
38ee7f49b0 Every PR to have its own changelog
The changes in this commit
1. workflow action to check if the PR has its own changelog file in
".unreleased/" folder.
2. script to merge the individual changelog entries that can be copied
into the CHANGELOG.md file.
3. script to check the format of the lines in the change log file.
4. script to delete the individual changelogs, post release.
2023-05-19 13:51:37 +05:30
Alexander Kuzmenkov
fb65086b55 Add a ubsan suppression for overflow in histogram()
It is in postgres code, and doesn't lead to bugs.
2023-05-16 21:32:52 +02:00
Fabrízio de Royes Mello
cc9c3b3431 Post-release 2.10.3
Adjust the upgrade/downgrade scripts and add the tests.
2023-04-28 10:05:11 -03:00
Alexander Kuzmenkov
12f3131f9e Post-release 2.10.2
Adjust the upgrade/downgrade scripts and add the tests.
2023-04-20 17:55:18 +04:00
Alexander Kuzmenkov
20db884bd7 Increase remote tuple and startup costs
Our cost model should be self-consistent, and the relative values for
the remote tuple and startup costs should reflect their real cost,
relative to costs of other operations like CPU tuple cost.

For example, now remote costs are set even lower than the parallel tuple
and startup cost. Contrary to that, their real world cost is going to be
an order of magnitude higher or more, because parallel tuples are sent
through shared memory, and remote tuples are sent over the network.

Increasing these costs leads to query plan improvements, e.g. we start
to favor the GROUP BY pushdown in some cases.
2023-04-17 22:22:08 +04:00
Alexander Kuzmenkov
d32224a914 Add labels to backported PRs
Makes it easier to check what was done when looking at the release
milestone.
2023-04-17 13:26:57 +04:00
Fabrízio de Royes Mello
a3d778f7a0 Add CI check for missing gitignore entries
Whenever we create a template sql file (*.sql.in) we should add the
respective .gitignore entry for the generated test files.

So added a CI check to check for missing gitignore entries for generated
test files.
2023-04-14 12:46:20 -03:00
Rafia Sabih
3f9cb3c27a Pass join related structs to the cagg rte
In case of joins in the continuous aggregates, pass the required
structs to the new rte created. These values are required by the
planner to finally query the materialized view.

Fixes #5433
2023-04-13 04:57:33 +02:00
Sven Klemm
00321dba41 2.10.1 Post-release adjustments
Add 2.10.1 to update test scripts and adjust the downgrade versioning.
2023-03-07 13:44:54 +01:00
Maheedhar PV
c8c50dad7e Post-release fixes for 2.10.0
Bumping the previous version and adding tests for 2.10.0
2023-02-24 12:03:36 +01:00
Jan Nidzwetzki
330bb8f4af Added coccinelle rule to find strlcpy on NameData
NameData is a fixed-size type of 64 bytes. Using strlcpy to copy data
into a NameData struct can cause problems because any data that follows
the initial null-terminated string will also be part of the data.
2023-02-20 15:23:57 +01:00
Jan Nidzwetzki
7e43c702ba Increase timeout for PostgreSQL in upgrade tests
The upgrade and downgrade tests are running PostgreSQL in Docker
containers. The function 'wait_for_pg' is used to determine if
PostgreSQL is ready to accept connections. In contrast to the upgrade
tests, the downgrade tests use more relaxed timeout values. The upgrade
tests sometimes fail because PostgreSQL cannot accept connections within
the configured time range. This patch applies the more relaxed timeout
values also to the upgrade script.
2023-02-20 11:17:48 +01:00
Mats Kindahl
38b71d0e70 Use NameData and namestrcpy for names
Using `strlcpy` to copy variables holding PostgreSQL names can cause
issues since names are fixed-size types of length 64. This means that
any data that follows the initial null-terminated string will also be
part of the data.

Instead of using `const char*` for PostgreSQL names, use `NameData`
type for PostgreSQL names and use `namestrcpy` to copy them rather
than `strlcpy`.
2023-02-17 10:43:46 +01:00
Alexander Kuzmenkov
caf79e0f5e When backporting, fetch the main branch with large depth
Apparently in some cases we're getting a shallow repo in the Github
Actions.
2023-02-08 18:48:53 +04:00
Lakshmi Narayanan Sreethar
1eb8aa3f14 Post-release fixes for 2.9.3
Bumping the previous version and adding tests for 2.9.3.
2023-02-07 15:53:42 +05:30
Alexander Kuzmenkov
c4d8f35307 Improve automated backports
A follow-up for the review comments in the previous PR.

1. Create one backport PR per one source PR, even with multiple commits.
1. Add a comment to the source PR if we fail to backport it for some
   reason.
2023-02-02 16:13:33 +04:00
Alexander Kuzmenkov
9133319081 Fix pylint again
Apparently a new version is out and it complains about Exception being
too general.
2023-02-02 08:57:42 +04:00
Alexander Kuzmenkov
739fd00bb9 Add a workflow for automated backporting
1. Find the latest release branch
1. For each commit in main and not in release branch (compared by
   title), find the corresponding PR.
1. If the PR fixes an issue labeled "bug", and neither the PR nor the
   issue are labeled "no-backport", cherry-pick the commits from the PR
onto the release branch, and create a PR with these changes.
2023-02-01 16:25:02 +04:00
Alexander Kuzmenkov
21a3f8206c Run python linter and formatter in CI
Helps find some errors and cosmetic problems.
2023-01-30 13:49:26 +04:00
Bharathy
684637a172 Post-release fixes for 2.9.2
Bumping the previous version and adding tests for 2.9.2
2023-01-25 17:54:54 +05:30
Alexander Kuzmenkov
552950d221 Save SQLSmith results to the CI DB
Mostly we are interested in stacktraces and failed queries here.
2023-01-24 20:33:50 +04:00
Jan Nidzwetzki
1751efbaea Improve the PR workflow actions
This patch includes two changes to the PR handling workflow:

(1) It changes the trigger for the workflow to pull_request_target. So,
    PRs can now also be assigned to reviewers if the PR is opened from
    external sources.

(2) A workflow has been added that automatically assigns PRs to the
    author.
2023-01-04 11:11:01 +01:00
Sven Klemm
b92f36d765 Add 2.9.1 to update test scripts 2022-12-27 09:24:57 +01:00
Sven Klemm
08bb21f7e6 2.9.0 Post-release adjustments
Add 2.9.0 to update test scripts and adjust downgrade scripts for
2.9.0. Additionally adjust CHANGELOG to sync with the actual release
CHANGELOG and add PG15 to CI.
2022-12-19 19:10:24 +01:00
Jan Nidzwetzki
c76dfa0acb Improve Sanitizer checks
This patch contains two changes to the Sanitizer checks:

(1) All logfiles of the Sanitizer will be uploaded to the
    CI database.

(2) The Sanitizer checks are executed on every PR.
2022-12-08 10:55:17 +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
Alexander Kuzmenkov
0d30155b26 Upload test results into a database
This will help us find the flaky tests or the rare failures.
2022-11-14 17:35:50 +04:00
Fabrízio de Royes Mello
9e276c58ee Revert "Upload test results into the database"
This reverts commit 252cefb509153fadcb32741a27ec3fa977487049 because it
broke our CI globally.
2022-11-11 15:25:01 -03:00
Alexander Kuzmenkov
252cefb509 Upload test results into the database
This will help us find the flaky tests or the rare failures.
2022-11-11 20:02:29 +04:00
Jan Nidzwetzki
4f9eef3211 Print correct variables in downgrade test script
The downgrade script has printed a message in which the same variable is
used for the upgrade and the downgrade version. This patch corrects the
output and uses the correct variables.
2022-11-10 15:31:20 +01:00
Alexander Kuzmenkov
85f5efdc8f Fix -Wsign-compare with PG 15
It changed the type of Var.varno from Index to int. I'm starting to
wonder if it was a good idea to enable this warning, but maybe we can
give it the last try.
2022-10-28 17:10:13 +04:00
Alexander Kuzmenkov
864da20cee Build on Ubuntu 22.04
It has newer GCC which should detect more warnings.
2022-10-26 23:32:05 +04:00
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
7758f5959c Update .clang-format for version 14
The only configuration we're missing is the newline for braces after
case labels. The rest of the differences looks like bugs/omissions of
the version 8 that we use now.

Require clang-format-14 in cmake and use it in the CI check. We can't
support versions earlier than 14 because they have some
formatting differences that can't be configured.
2022-10-10 17:12:36 +03:00
Fabrízio de Royes Mello
e0bbd4042a Fix missing upgrade/downgrade tests DDL validation
Recently we fixed a DDL error (#4739) after upgrading to 2.8.0 version
that surprisly the CI upgrade/dowgrade tests didn't complained during
the development of the feature (#4552).

Fixed it by adding an specific query in the `post.catalog.sql` script to
make sure we'll check all the constraints of our internal tables and
catalog.
2022-10-07 16:40:30 -03:00
Jan Nidzwetzki
2f739bb328 Post-release fixes for 2.8.1
Bumping the previous version and adding tests for 2.8.1.
2022-10-07 10:10:22 +02:00
Sven Klemm
eac3132b67 Migrate CI summary slack bot to eng-database 2022-10-03 17:09:09 +02:00
Mats Kindahl
244b3e637c Move perltidyrc to root
To allow perltidy to be used from editors and IDEs, the perltidyrc file
is moved from `scripts/perltidyrc` to `.perltidyrc`. This will allow
editors and IDEs to quickly find the style file in the root of the
repository, where `perltidy` normally searches for the style file.

The workflow is then updated to use the new location, and the two
options `--backup-file-extension` and `--backup-and-modify-in-place`
are moved to the workflow file to allow editors and IDEs to use
whatever method they find useful to process the file.
2022-09-26 17:27:16 +02:00
Sven Klemm
3722b0bf23 Add 2.8.0 to update tests
Add 2.8.0 to update tests and adjust the downgrade script files.
2022-09-01 18:32:10 +02:00
Sven Klemm
0c6f4e2458 Centralize CI settings
This patch adds a new settings file for common github action settings.
Instead of repeating latest pg versions in every github workflow we
can read the settings from this central file.
2022-08-15 13:02:34 +02:00
Sven Klemm
29937fd57c Bump PG version used in CI to 14.5,13.8 and 12.12 2022-08-15 10:23:36 +02:00