1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2026-06-20 01:17:49 +02:00

512 Commits

Author SHA1 Message Date
David Steele bc6d399a6a PostgreSQL 19beta1 support.
Add PostgreSQL 19 as an unreleased version (release: false) and vendor its control/checkpoint structures, catalog and control versions, and XLOG_PAGE_MAGIC.

PostgreSQL 19 stores data_checksum_version in pg_control as a four-state ChecksumStateType enum (OFF, VERSION, INPROGRESS_OFF, INPROGRESS_ON) rather than the prior 0/1 value. Validate the field against the version-appropriate maximum and clear the in-progress states to 0, since page checksums cannot be relied on while checksums are being enabled or disabled. Consumers of pageChecksumVersion therefore continue to see only 0 or 1.

Add the PG19 test harness and the supporting Perl/CI plumbing (DbVersion, VmTest, container build) and adjust the integration test matrix.
2026-06-14 16:18:33 +07:00
David Steele e166a33f48 Prevent recursive exit() on signal.
musl 1.2.6 intentionally crashes when exit() is called recursively, which happened when a signal arrived while exit() was already in progress, e.g. when a server terminated a child that was already exiting. Set a flag when exit is in progress so exitOnSignal() ignores the signal and allows the in-flight exit() to complete. Reset the flag in exitInit() since a forked child may inherit it from a parent that was exiting.

Also call exitSafe() before notifying the parent in the server tests so a signal sent in response to the notification cannot arrive before the exit in progress flag is set.

Add Alpine 3.24 to CI to exercise the unit tests against musl 1.2.6, which is where this crash was found.
2026-06-13 12:46:46 +07:00
David Steele aca779a6ec Run integration tests on Alpine 3.21 (musl libc).
Drop the c-only restriction for the a321 CI job so the full unit and integration suites run on musl libc, exercising the integration tests (including SFTP) against Alpine in addition to glibc.

Apply the ssh-rsa HostKeyAlgorithms/PubkeyAcceptedAlgorithms workaround to a321 as well as u22, since Alpine 3.21 ships OpenSSH 9.x which no longer offers the SHA-1 ssh-rsa host-key algorithm by default and the libssh2 client requires it (otherwise the SFTP handshake fails key exchange with LIBSSH2_ERROR_KEX_FAILURE).

Suppress the libssh2_session_init_ex and libssh2_session_handshake "possibly lost" leaks reported by valgrind during SFTP integration. These are persistent allocations tied to the session lifetime and are flagged only on the Linux CI runner where valgrind wraps the integration test binary. The suppressions go in valgrind.suppress.none because integration tests always run with vm none.

Generalize hrnHostPgBinPath() to probe the Debian, RHEL, and Alpine PostgreSQL bin paths in turn rather than hardcoding two, and throw a clear assert if none match.

Add a321 to the default VM list, install PostgreSQL 15/16/17 on Alpine, and point VMDEF_PGSQL_BIN at the Alpine layout. Rebuild the a321 base image accordingly.
2026-06-13 12:18:33 +07:00
Artur Zakirov 760dd8db69 Fix Alpine group conflicts in CI containers.
Handle /etc/group entries with non-empty member fields when renaming TEST_GROUP_ID and only create the Alpine group when it does not already exist.
2026-06-12 21:34:45 +07:00
David Steele 3ce9fb9563 Update Fedora CI container to Fedora 44. 2026-06-12 21:04:06 +07:00
David Steele cb694fcb4d Update (almost) EOL Debian 11 to Debian 12 in CI.
Debian 11 will be EOL just after the next release but it is also a blocker for some planned work due to old package versions. It seems fine to just expire it a bit early.

Also update the integration tests to run Debian 12 on Posix since Azure is not supported on i386.
2026-06-12 20:57:16 +07:00
David Steele 3e2e3b1ff0 Add code count exclusion for SVG files. 2026-06-12 11:46:58 +07:00
Andrew Jackson 742fff174a Add systemd notify integration.
Allow systemd to have a better understanding as to when pgBackRest has finished starting or is stopping.

This implementation is based off of the existing implementations in
PostgreSQL [1] and PgBouncer [2]. PgBouncer also has an
implementation for `notify-reload` but this is not implemented here
as it is a very recent feature [3] that is unavailable on many Linux
distributions.

[1] https://www.postgresql.org/message-id/flat/CAFj8pRA4%3DhVj-d%3D8O7PSMjopsFUHPcAftd5tLqFC_xb035hNQA%40mail.gmail.com#e346a6189d8b0ed44c745c4aaaef587f
[2] https://github.com/pgbouncer/pgbouncer/commit/3816a0073f09944a6f7eaa278d2226ca4942b911
[3] https://github.com/systemd/systemd/blob/fa6d3bffe30064c4d4092b3daa749465f08d35fb/NEWS#L6176
2026-05-19 11:37:48 +09:00
David Steele 45987413d3 Migrate Cirrus CI tests to Github Actions.
Cirrus CI is shutting down on June 1 so migrate all tests. This could have been done before, probably, but it was not clear how to run FreeBSD on Github Actions. The cross-platforms-actions action solves that problem.

Fix a couple of minor test issues found on MacOS.

Also remove the dead make-cmd option. This has not been valid since the migration to meson.
2026-04-13 18:11:36 +07:00
David Steele ff69fcb671 Remove obsolete Perl code. 2026-04-07 10:20:29 +07:00
David Steele 8e711d40cb Update Fedora test image to Fedora 43. 2026-03-04 20:15:55 +07:00
David Steele cf003f67e7 Move static build defines to build.h.
Putting these defines in meson.build is a bit annoying because of the added syntax and double commenting. Since the defines are static there is no good reason to have them there.

This also creates a place for test builds to add global defines -- again rather than in meson.build.
2026-02-17 15:05:33 +07:00
David Steele d206d89d5f New CI container builds. 2026-01-19 16:29:57 +07:00
David Steele fdeb46be83 Remove PDF documentation output.
PDF output is not longer used by the project. Removal will make documentation maintenance and improvements simpler.
2025-12-23 16:59:08 +07:00
David Steele d83019924b Fix 32-bit CI testing.
32-bit testing was broken by 24802a08, which was attempting to fix multi-architecture builds by using docker to set the architecture.

i386 is not a special case but the prior alternate architectures did not run integration tests. This requires passing the architecture around since the integration test main process runs on the host system, which may be a different architecture.
2025-11-12 14:27:22 +02:00
David Steele c6ebfc8fae Removed unused code in test container build. 2025-11-12 11:22:08 +02:00
David Steele 5171e8bde3 Remove support for PostgreSQL 9.5.
Per our policy to support five EOL versions of PostgreSQL, 9.5 is no longer supported by pgBackRest. Remove all logic associated with 9.5 and update the tests.

An effort was made to advance versions as much as possible in the tests while still providing coverage. Hopefully this will reduce churn when future versions expire, though it has created a bit more here.

Tests for 9.4/9.5 are left in the expire/info tests to demonstrate that these commands work with old versions present.
2025-11-07 10:01:50 +02:00
David Steele 24802a08b4 Improve support for multi-architecture builds.
On recent versions of Docker it is not necessary to specify the architecture of the require image. The --platform option takes care of it.

Rebuild test images that were modified by this change.
2025-10-04 13:34:53 +02:00
David Steele 5f55f7c1b1 Finalize catalog number for PostgreSQL 18 release. 2025-09-26 11:10:53 +02:00
David Steele 5de5ed842a New CI container build for PostgreSQL 18 beta3.
Rebuild all containers to get the most recent versions of PostgreSQL.

Update the Debian repository install to match current recommendations. This has already been done for the documentation in fcd00a45.
2025-08-23 11:40:34 -04:00
David Steele fcd00a45f5 Update user guide and tests to Ubuntu 22.04.
20.04 is EOL so update the user guide and tests to 22.04.

The contributing guide was updated to 22.04 in d55836e7e.
2025-08-04 17:42:16 -04:00
David Steele 3780057866 Update Fedora test image to Fedora 42. 2025-06-22 17:46:54 -04:00
David Steele 8aa2d88bac Update unit tests to work with Alpine Linux and musl libc.
A few bugs have been reported over the years on Alpine with musl libc and generally it has been possible to figure them out without testing on that platform but a few newer ones cannot be reproduced elsewhere.

Also, testing with additional libc implementations helps portability so it makes sense to add support.

For the most part musl libc works as expected with a few caveats:

1) The FD_*() macros won't accept an int file descriptor without warning when -Wsign-conversion is enabled. I opened https://www.openwall.com/lists/musl/2025/05/23/4 to discuss this and I was referred to https://www.openwall.com/lists/musl/2024/07/16/1 which explains why this happens. It was not a very satisfying answer but clearly it is not going to be addressed so a meson probe was added to detect the issue and disable the warning.

2) Floating point numbers are rounded differently than in GNU/Mac libc when formatted with printf() and friends. This is fine for the core code but causes issues in the unit tests that expect log entries to match exactly. This was solved in ad7ba46b by adding our own rough and ready formatting routines.

3) Some error messages are different from GNU/Mac libc. This was solved with a new error macro that accepts multiple messages in b5fbb16c.

4) For some reason ninja on Alpine outputs "nothing to do" messages to stderr whereas they go to stdout on other distributions. Redirecting stderr to stdout is our standard fix for this issue so do that. A non-zero result code will let us know that something has gone wrong.

5) It appears that profiling is not supported on Alpine, which is pretty surprising. For now fix this by only unit testing the profiling code when coverage is enabled. This is not a great solution since we would rather test profiling on any system that supports it but for now this will do.
2025-06-05 17:33:18 -04:00
David Steele f494dd21ad Fix architecture labeling for multi-architecture container builds.
When the architecture was not specified it was being set to x86_64 rather than the host architecture.
2025-05-27 17:14:18 -04:00
David Steele 7b1b1f5322 New CI container build for PostgreSQL 18 beta1.
Since the addition of libcurl4-openssl-dev requires a rebuild of the Debian containers go ahead and rebuild all containers to include new PostgreSQL minor release versions.
2025-05-09 17:45:05 -04:00
David Steele 34b916f323 Use 'x86_64' instead of 'amd64' for container testing.
This aligns with what is reported by 'uname -m' and required by Docker naming conventions.

Also convert a 'aarch64' string to the VM_ARCH_AARCH64 constant.
2025-05-09 12:56:57 -04:00
David Steele 565d2e0c47 PostgreSQL 18 experimental support.
Support is experimental since PostgreSQL 18 is still in development and has not released a beta, but it may be useful for testing.
2025-04-14 12:29:31 -05:00
David Steele 57ffd2dfcb Fix multi-architecture unit testing.
The Github action we were using for multi-architecture testing stopped working. The project does not seem to be getting regular maintenance so it seems better to roll multi-architecture testing into our existing container builds.

Introduce multi-architecture builds and testing into our test framework. For now this only works for unit tests -- integration tests will still only run on x86_64. That could be updated in the future but since emulation is so slow it is not clear if it would be useful.

Also fix an invalid 32-bit checksum. The d11 test had not been running as 32-bit since d8ff89a so the checksum was not updated when it should have been in 48f511d.
2025-02-28 15:38:05 -06:00
Kian-Meng Ang c351263a1d Fix typos.
Found using `codespell -S *.eps,*.cache,*.xml -L inout,te,fo,bload,fase,collet,hilight,debians,keep-alives` and `typos --hidden --format brief`.
2024-11-22 15:25:43 -05:00
David Steele 7f2dfc021c Update Fedora test image to Fedora 41. 2024-11-18 13:33:03 -05:00
David Steele 48f511dad3 Remove support for PostgreSQL 9.4.
Per our policy to support five EOL versions of PostgreSQL, 9.4 is no longer supported by pgBackRest. Remove all logic associated with 9.4 and update the tests.

This includes a small fix in infoPg.c to allow backup.info files with old versions to be saved. This allows expire to function when old versions are present. Even though those older versions cannot be used, they can be expired.

Tests for 9.4 are left in the expire/info tests to demonstrate that these commands work with old versions present.
2024-10-21 13:56:04 +03:00
David Steele 89c9baba72 Remove autoconf/make build.
2.54.0 is the last release to support the autoconf/make build. Remove the autoconf/make build to reduce maintenance going forward.
2024-10-21 13:32:35 +03:00
David Steele f76da03eb6 Update CI containers to include newest PostgreSQL patch releases. 2024-10-16 12:14:12 +03:00
David Steele 1020bc117a Shuffle PostgreSQL versions between test containers.
Ubuntu 20.04 has been having consistent errors starting PostgreSQL 10 so move 9.5 to this container instead. An older version makes sense with an older distro.

Also move PostgreSQL 12 from RHEL 8 since this version will be EOL soon.
2024-10-08 18:15:34 +03:00
David Steele 047e3d0ed9 Finalize catalog number for PostgreSQL 17 release. 2024-10-02 19:49:15 +03:00
David Steele d8ff89ae75 Update EOL Debian 10 to Debian 11/Ubuntu 20.04 in CI.
Typically we use the oldest Debian/Ubuntu to run 32-bit unit and integration tests. However, 32-bit is no longer fully supported by Ubuntu (multiple packages we need are missing) and apt.postgresql.org no longer packages for any 32-bit version.

To address these changes, do 64-bit integration testing on the oldest Debian/Ubuntu (currently Ubuntu 20.04) and 32-bit unit/integration testing on the oldest Debian (currently 11) using the included version for integration testing.
2024-07-15 11:53:57 +07:00
David Steele ce2493c3f6 Remove obsolete vm constants.
The VM[2-4] constants do not serve a purpose anymore (removed in 794c5771) and just make the mappings more complicated, so remove them.
2024-07-15 11:22:13 +07:00
David Steele 6495a46ca3 Fix --run and --scale options for unit tests.
These were broken while code was being migrated to C and went unnoticed because the options are generally only used when doing performance testing.

The C code can only take one --run param so add a check for that in test.pl.
2024-06-25 15:46:07 +08:00
David Steele 2ec99ca4d9 Specify test images that get valgrind installed.
This means valgrind is no longer built from source, which caused image builds to run for a very long time.

Valgrind is only required in a few images for testing.
2024-06-12 16:08:17 +10:00
David Steele 886bb281f6 Migrate CentOS 7 integration tests to Rocky 8.
CentOS 7 will be EOL on June 30 and since there is no CentOS 8 migrate instead to Rocky 8.
2024-06-11 15:20:04 +10:00
David Steele 6f562fba60 Migrate coverage testing to C and remove dependency on lcov.
lcov does not seem to be very well maintained and is often not compatible with the version of gcc it ships with until a few months after a new distro is released. In any case, lcov is that not useful for us because it generates reports on all coverage while we are mainly interested in missing coverage during development.

Instead use the JSON output generated by gcov to generate our minimal coverage report and metrics for the documentation.

There are some slight differences in the metrics. The difference in the common module was due to a bug in the old code -- build/common was being added into common as well as being reported separately. The source of the two additional branches in the backup module is unknown but almost certainly down to how exclusions are processed with regular expressions. Since there is additional coverage rather than coverage missing this seems fine.

Since this was pretty much a rewrite it was also a good time to migrate to C.
2024-05-31 14:52:07 +10:00
David Steele 899b892788 New CI container build for PostgreSQL 17 beta1.
Update the catalog version for beta 1 so pgbackrest will not work with any prior development versions.

Also improve the integration/all test so the catalog version does not need to be updated again during the beta period.
2024-05-24 12:24:11 +10:00
David Steele 04b0437976 Exclude documentation code coverage from metrics report.
Coverage of the documentation code is not important enough to report to users. If it were reported it should be in a separate section (along with test code coverage).
2024-05-23 10:58:52 +10:00
David Steele 28ad1badd9 Update Fedora test image to Fedora 40. 2024-05-18 18:55:53 +10:00
Michael Schout e00e33b528 Dynamically find python in meson build.
This is better than requiring a python3 binary to be on the path because some installations might have, e.g. python3.9.

Also add the python3-distutils package to Debian builds to make this work.
2024-04-25 19:32:07 +10:00
Reid Thompson 4ea4e3f380 Update Fedora test image to Fedora 38.
This should have been done in 434938e3 but somehow it didn't happen.

Fedora 38 requires 2048 bit keys so update the VM builds to use them. Update the documentation to use 2048 bit keys. This is not technically required by this commit but it makes sense to do it now.

Also update the key location for the yum.p.o repository.

Lastly, shuffle test PostgreSQL versions since PostgreSQL 11 is not longer available in the yum.p.o repository.
2024-04-23 22:34:32 +10:00
David Steele fb22f04555 PostgreSQL 17 Support.
Add catalog version and WAL magic for PostgreSQL 17.
2024-04-18 10:56:24 +10:00
David Steele e3d9df3ae9 Make meson the primary build system.
Meson has a lot of advantages over autoconf/make, primarily in ease-of-use and performance. Make meson the only build system used for testing and building the Debian documentation, but leave the RHEL documentation using autoconf/make for now so it gets some testing.
2024-03-10 10:53:31 +13:00
David Steele 794c577130 Migrate integration tests to C.
The Perl integration tests were migrated as faithfully as possible, but there was some cruft and a few unit tests that it did not make sense to migrate.

Also remove all Perl code made obsolete by this migration.

All unit, performance, and integration tests are now written in C but significant parts of the test harness remain to be migrated.
2024-03-06 11:00:09 +13:00
David Steele 6356a2b76c Disable log expect testing for non-unit tests.
This has never been a problem for performance tests since they do not call functions that log at info level or above, but the upcoming integration tests may do so. In any case it is better to disable this functionality outside of unit tests.
2024-02-17 19:16:39 +13:00