1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2026-06-13 21:54:53 +02:00
Commit Graph

4833 Commits

Author SHA1 Message Date
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
David Steele 464f3020a9 Move ignoreMissing out of the storage read drivers.
Previously each read driver decided whether a missing file was an error, which duplicated the ignoreMissing logic across the Posix, SFTP, remote, S3, Azure, and GCS drivers. Now driver open() simply reports whether the file exists and StorageRead throws FileMissingError when missing files are not ignored.

Since the client now makes this decision, ignoreMissing no longer needs to be passed through the remote protocol and a missing file is reported locally rather than as an error raised from the remote.
2026-06-12 10:11:49 +07:00
David Steele 2b7825ad46 Add valgrind suppressions for libbacktrace unwind false positives.
When libbacktrace is enabled, throwing an error calls backtrace_full(), which unwinds the stack with libgcc's _Unwind_Backtrace. On aarch64 the unwinder (and glibc's _dl_find_object, which it calls to look up unwind tables) branches on values valgrind considers uninitialised. Since tests run under valgrind with --exit-on-first-error=yes, the false positive aborted any test that happened to trip it, e.g. storage/sftp.

Suppress Cond and Value8 errors that originate inside _Unwind_Backtrace when called from backtrace_full.
2026-06-11 12:10:35 +07:00
David Steele eaac49e3c2 Move issue template to new format required by Github.
.github/ISSUE_TEMPLATE.md is no longer filling new issues even though it should still be working according to the documentation.

Rather than fight the system just move to the new format.
2026-06-09 13:27:53 +07:00
ShivakumarAmbigiTR 6c518001c2 Add support for S3 Outposts.
Add a repo-s3-service option that controls the SigV4 signing service name. Defaults to 's3' for standard S3 endpoints. Set to 's3-outposts' when using an S3 Outposts endpoint.

The signing service is used in the credential scope, HMAC signing key derivation, and authorization header. The option accepts free-form input to support future AWS service variants.
2026-06-09 12:37:48 +07:00
David Steele a953aa74b5 Invert storage read/write interface ownership.
Previously, drivers constructed StorageRead/StorageWrite objects directly and stored metadata in a shared interface struct. Now, StorageRead/StorageWrite create the driver via storageInterfaceNewReadP()/NewWriteP() and mediate between IoRead/IoWrite and the driver. Drivers return opaque objects and own their metadata independently.

This loosens the tight coupling between drivers and the StorageRead/StorageWrite layer. The remote write driver replaces its back-pointer to StorageWrite with a filterGroup callback, eliminating the circular dependency. It makes retry in StorageRead much more readable.

Also move the logic for testing whether a file version could not be found out of the drivers and into StorageRead.
2026-06-09 11:23:15 +07:00
David Steele 71f52f7d92 Remove extraneous pathSync test in the SFTP storage driver.
The driver does not implement path sync so there is not reason to test the behavior.
2026-06-08 17:15:27 +07:00
David Steele 7d4c0d58ed Test the Posix driver for syncPath rather than StorageWrite.
The syncPath value in StorageWrite is for informational purposes and does not determine if the path is actually synced or not.

Instead probe the Posix driver to make sure that syncPath is disabled so there is no error on CIFS.
2026-06-08 17:08:58 +07:00
David Steele 0c62043419 Rename execOne() to execOneExpect().
This clears the way to use the shorter version in the core code.
2026-06-04 15:07:50 +07:00
David Steele beb189fbb3 Add repo-s3-key-type=pod-id documentation missed in 79544f64. 2026-06-04 11:31:44 +07:00
David Steele c02ddc3ad9 Update lock-threads action version.
Also remove unused PR settings.
2026-06-01 12:59:46 +09:00
David Steele e1cbd5b55c New CI container builds.
These should have been updated in 742fff17 when libsystemd was added but doing it now includes the last PostgreSQL minor releases.
2026-05-29 12:15:28 +09:00
GLFNSE 1e6d23fea7 Add user/group caching for faster manifest build.
On systems where uid/gid lookups are routed to a remote name service (sssd, systemd-userdbd, LDAP, etc.), every getpwuid()/getgrgid() call incurs a Unix socket round-trip. This dominates the manifest build phase for clusters with millions of files, even though the data files almost always share a single owner.

Add a small fixed-size (16-entry) per-process cache for userNameFromId() and groupNameFromId(). Linear scan is faster than a hash table at this size. Negative results (unknown ids) are also cached. Cache overflow falls through to uncached lookups.
2026-05-29 10:36:48 +09:00
David Steele 2cc9898fa1 Remove extraneous const. 2026-05-28 22:17:30 +09: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 3a6c67183c C11 is now the minimum C standard.
This standard is over fifteen years old and the features we are interested in seem well supported on popular compilers.

The main advantage is that static_assert() will now display the specified message on error rather than the ever-cryptic `negative width
in bit-field '__error_if_negative'`. Now that we can depend on having
static_assert() we can replace our STATIC_ASSERT_STMT() macro.

Replace our ALIGN_OF() macro with alignof().

Replace our FN_NO_RETURN macro with noreturn. Include stdnoreturn.h in build.h to avoid needing to include it in many header files.

Use an anonymous union in common/type/json.c where it simplifies syntax.
Other uses of union seem better as they are.
2026-05-19 10:19:58 +09:00
David Steele 6a40144d91 Add sponsors and announcement that pgBackRest will continue. 2026-05-18 20:27:00 +09:00
David Steele 91b8dd6035 Add news page.
Move recent announcements that were added to the top of the homepage.
2026-05-18 20:14:45 +09:00
David Steele e0c934d231 Fix documentation typos. 2026-05-18 10:05:02 +09:00
David Steele 892b60bc79 Add dark mode favicon.
In dark mode the black favicon was barely visible. Use a white favicon in dark mode instead.

Also, use the new SVG logo for the favicon and update logo.png to the new style.
2026-05-17 11:56:56 +09:00
David Steele 7ad4fd21c1 Remove attribution for armchair icon since it is now licensed. 2026-05-16 16:55:12 +09:00
David Steele 684f12c6cb Remove information about v1 releases.
These releases do no support any current version of PostgreSQL so they are of limited value.
2026-04-27 13:17:20 +09:00
Will Morland 77312b33ba Add per-repo backup progress to info command output.
When backups are running on multiple repositories simultaneously, the info command now reports per-repo progress in addition to the existing overall progress. A new repo array is included in JSON output for backup locks. This avoids confusing progress jumps when one repo finishes before another.
2026-04-14 14:51:42 +07:00
David Steele ce8bb04d5b Limit CI permissions on the repository to read. 2026-04-14 12:40:33 +07:00
David Steele 2ef8673534 Remove CodeQL CI job.
This job has never surfaced any useful data and now it is failing, so remove it.

It appears that CodeQL can now be automated directly within the Github interface, so that seems like a better route if we decide to reenable it.
2026-04-14 12:34:32 +07:00
David Steele afd6939656 Allow FreeBSD tests to continue running even if one fails. 2026-04-13 18:22:49 +07:00
David Steele c823ce2f7c Update GitHub Actions versions. 2026-04-13 18:19:41 +07: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 d3cdff17f5 Migrate documentation block rendering to C.
This also requires a fair amount of support code that cannot be removed from Perl yet.
2026-04-10 13:26:21 +07:00
David Steele ff69fcb671 Remove obsolete Perl code. 2026-04-07 10:20:29 +07:00
Denis Garsh 7f82fb6635 Add backup.info checks to verify command.
Verify currently checks only backup directories present in the repository and does not validate consistency with backup.info. As a result, discrepancies between the repo contents and backup.info may go unnoticed.

Warn if a backup directory exists but is not described in backup.info. Warn if a backup is listed in backup.info but missing on disk. Add backups found only in backup.info (but not on disk) to the processing list so that verify command reports their status as manifest missing.
2026-03-30 16:39:44 +07:00
Denis Garsh 6704ffacfb Test changes in preparation for additional verification of backup.info. 2026-03-24 15:04:52 +07:00
Yegor 6e4f10203f Remove unused backtrace-supported.h include.
This header is only useful for autoconf builds and in any case it was not being used correctly.
2026-03-23 11:22:25 +07:00
Yegor Zhmak 0885374549 Add alternate error to common/io/tls test module for WSL. 2026-03-23 10:44:57 +07:00
David Steele e54b4a42fd Move archiveAsyncExec() to command/command module and rename.
Spawning an async process is useful for more than archive-get/push so move the function to a module used by all commands.
2026-03-17 11:46:33 +07:00
David Steele 9016b362fc Comment out unused CSS elements.
These are useful to denote elements that could be styled but currently work with defaults. However, CSS linters dislike empty rules so comment them out. This was already done with some rules but not followed consistently.
2026-03-07 21:46:15 +07:00
David Steele 6d7ddc3e0a Add support for sponsors in the documentation.
This allows logos to be displayed for sponsors in HTML on the homepage.

The markdown will continue to list sponsors in text but the list will be pulled from the new XML.
2026-03-07 15:35:11 +07:00
David Steele 4397d12247 Remove FreeBSD 13 and add FreeBSD 15 to Cirrus CI.
FreeBSD 13 will be EOL soon after the next release.
2026-03-04 21:37:13 +07:00
David Steele 8e711d40cb Update Fedora test image to Fedora 43. 2026-03-04 20:15:55 +07:00
David Steele 9bb26a5065 Update PostgresQL versions in user guide.
PostgreSQL 13 is EOL and no longer available in the yum.postgresql.org repository.

Update the base and upgrade versions of the RHEL and Debian documentation to better cover supported versions.
2026-03-04 17:16:18 +07:00
David Steele 4a2008c6ed Ensure backup-timestamp-start is non-zero in unit tests.
The unit tests do not require this field to be non-zero so in general it has not been set.

However, in production this field is always set and can be used to calculate timestamp deltas, which will be useful in a future commit.

Commit the test changes separately to show that there is no change in behavior.
2026-02-23 16:51:21 +07:00
David Steele b908d5e2c5 Improve seek performance during block incremental delta restore.
The prior code issued a seek for each block even if the file was in the correct position. The extra call to lseek() was probably not too expensive but a flush was also required in case of a seek on the next loop. Flushing the write buffer after each block (which is often 8KiB) was definitely wasteful.

Fix this by adding seek to the IoWrite interface. That means the file position can be tracked and calls to seek/flush are only done when needed.

Seek during write is only used in PGDATA during restore so seek functionality is only added to the Posix driver.
2026-02-21 08:37:31 +07:00
David Steele 009644b443 Update always_inline to __always_inline__.
This is the preferred syntax to avoid conflict with user-defined macros.
2026-02-20 17:56:30 +07:00
David Steele 2c747f277e Add meson check for __builtin_types_compatible_p().
This check was lost in the migration from autoconf which means that the UNCONSTIFY() macros has not been enforcing since then.

Add the check so UNCONSTIFY() enforces as expected.
2026-02-20 13:14:01 +07:00
Yegor Zhmak fc42e85d8c Fix incorrect postgres/interface unit test title. 2026-02-19 22:53:52 +07:00