fix: a restore with pg_restore 17 into Postgres 16 isn't stopped by a setting the server lacks
CI and images / lint (push) Successful in 1s
CI and images / extension-version (push) Successful in 2s
CI and images / backend-lint-and-test (push) Successful in 48s
CI and images / frontend-build (push) Successful in 24s
CI and images / extension-test (push) Successful in 20s
CI and images / integration (push) Successful in 2m51s
CI and images / sign-extension (push) Successful in 2s
CI and images / build-agent (push) Successful in 4s
CI and images / build-web (push) Successful in 1m52s
CI and images / smoke-web (push) Successful in 55s
CI and images / promote (push) Successful in 2s
CI and images / refresh-dev (push) Skipped
CI and images / unattended-failure (push) Skipped

pg_restore 17 opens with `SET transaction_timeout = 0`, which Postgres 16 refuses.
Under --exit-on-error that one harmless statement ended every restore: the
image ships pg_restore 17.11 and the bundled server is pg16, so a restore
from the bucket (and the local restore) could never have loaded a dump. The
backup round trip, now that CI has pg_dump, found it.

pg_restore now runs to the end and its errors are judged afterwards: the
known harmless one is ignored, and any other fails the restore with that
error's words rather than the "Command was:" line that followed it.

Also sorts an import the lint lane flagged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-07 15:00:00 -05:00
co-authored by Claude Opus 5.5
parent 1e63f70bf7
commit 9715143492
3 changed files with 85 additions and 11 deletions
+1 -1
View File
@@ -198,7 +198,7 @@ def test_a_restore_out_of_time_queues_its_next_chunk(db_sync, tmp_path, run_env,
def test_a_restart_resumes_the_file_phase_and_drops_the_stale_chunk(
db_sync, tmp_path, run_env,
):
from backend.app.tasks.backup import resume_offsite_runs, restore_offsite_task
from backend.app.tasks.backup import restore_offsite_task, resume_offsite_runs
_file(tmp_path, "a.jpg", b"aa")
_image(db_sync, tmp_path / "a.jpg", b"aa")
now = datetime.now(UTC)