Repository navigation
fix(backup): check the client major against the server before dump and restore - #1591
Merged
Merged
Conversation
…d restore The image's pg_dump major is the highest server major HealthLog can run against, and nothing compared the two before running the tool. A server newer than the client stopped the boot at the dump before migrating with pg_dump's own mismatch line, the container restarted into the same error every few seconds, and the nightly dump failed the same way (#1431). Every path that runs pg_dump or pg_restore against a server now reads server_version_num and the tool's --version first and, when the server is newer, refuses with one message that names both majors and the way out: createDatabaseDump (the nightly dump and the dump before migrating) and db-restore. The dump before migrating exits 3 for this case; the entrypoint says why once and waits ten minutes before it exits, so a restart policy does not loop, and docker stop ends the wait. A boot with nothing to migrate starts and logs the same line as a warning. The recovery readiness model reads the stored failure back and calls the database dump failing from the first run (client_too_old), so admins get it as a backup alert instead of "the last dump failed". The upgrade guide and the self-hosting pages state the ceiling and how to check it.
This was referenced Nov 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The image's
pg_dumpmajor is the highest server major HealthLog can run against, and nothing compared the two up front (Refs #1431).dump-core.mjs(assertClientServesServer): readsserver_version_numand the tool's--version, refuses a server newer than the client with one message naming both majors and the way out. Used bycreateDatabaseDump(nightly dump and the dump before migrating) anddb-restore. Dev and beta versions (19devel,19beta2) read as their major; an unreadable side is not refused.db-dump.mjs pre-migrationexits 3 for this case. The entrypoint still refuses to migrate, says why once, and waits ten minutes (inside the healthcheck start period) before exiting, sorestart: unless-stoppeddoes not loop;docker stopends the wait. A boot with nothing to migrate warns and starts.database_dump/client_too_old, failing from the first run, so admins get it through the existing backup alert. Strings in all locales.postgres-major-upgrade.mdgets a section on the highest supported server major and how to check it; getting-started, unraid and truenas point at it.db-dumpexit codes,db-restorerefusal, an entrypoint test that runs the script with a stand-innode, and integration cases against a real server with a client one major older.