Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ['3.10', '3.11', '3.12', '3.13', '3.14']
python: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.15']
env:
UV_PYTHON: ${{ matrix.python }}
steps:
Expand All @@ -46,6 +46,10 @@ jobs:
fail-fast: false
matrix:
include:
- pg: 13
python: '3.11'
- pg: 14
python: '3.15'
- pg: 15
python: '3.10'
- pg: 16
Expand Down
32 changes: 30 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,36 @@

Notable user-facing changes.

## [Unreleased]

## [0.5.1] - 2026-10-31

- Support Python 3.10–3.15 and PostgreSQL 13–18. Python 3.15 and PostgreSQL 13–14
needed no runtime change. The clone backend still requires PostgreSQL 15 or later and
now stops with a version error before any dump or restore on older servers. The CI
matrix gains Python 3.15 and PostgreSQL 13 and 14. Version-dependent tests are skipped
on servers that lack the feature, and a flaky test that left a database behind now
cleans up after itself.
- Redraw the project icon: a dashed source database reduced to a small one that keeps the
highlighted row.
- Report `database_stats.already_absent` for databases that were gone when cleanup ran.
- Handle SIGTERM like SIGINT in `dbreduce reduce`: stop new candidates and oracle calls,
stop owned subprocess groups (SIGTERM, then SIGKILL after at most 5 s), remove the
workspace and clone databases and the temporary dump directory, then exit with status
128+signal. Previously SIGTERM left the workspace database and a full dump behind.
- Bound cancellation by one 30-second shutdown budget shared by subprocess stops,
connections, cleanup SQL and lock waits; a watchdog ends the process shortly after it
and reports what is unconfirmed. A repeated signal during cleanup is ignored; SIGQUIT
or SIGKILL abandons it.
- Report cleanup honestly: removed, already absent, not removed, ownership unverified or
result unknown, per database, separately from the temporary directory, with a way to
check each one. Exit status 1 means cancelled with cleanup unconfirmed. Ownership checks
(OID, owner, run marker) are unchanged, and nothing is removed by name prefix.
- Resolve an interrupted `CREATE DATABASE` by cancelling the statement this run left
on the server before deciding; a database that appears without a marker is reported,
never dropped by name.
- Run `pg_dump`/`pg_restore` and the oracle's matcher in their own process groups so
a stopped run cannot be held by a grandchild that keeps the output pipes open.
The oracle supervisor no longer kills the group on SIGTERM itself; DBReduce sends
SIGTERM, waits a bounded grace period and escalates.
- Add repository editing/Git defaults, contribution and security policies, and
issue/PR templates; document local checks and dependency-update cadence.
- Bound CI job runtimes while retaining the existing test and release matrices.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ superuser test role. Never point these tests at a shared or production server.
DBREDUCE_TEST_ADMIN=postgresql://localhost/postgres uv run --locked pytest -q -m postgres
```

The existing CI matrix tests Python 3.10–3.14 and PostgreSQL 15–18, builds wheel
The CI matrix tests Python 3.10–3.15 and PostgreSQL 13–18, builds wheel
and source distributions, and checks standalone installation. Release publication
runs only for version tags or an explicit release workflow dispatch.

Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ and explicitly configured application relationships.

## Quick start

DBReduce v0.5.0 supports Python 3.10–3.14 and PostgreSQL 15–18. Use current patched,
DBReduce supports Python 3.10–3.15 and PostgreSQL 13–18 (the experimental clone
backend needs PostgreSQL 15 or later). Use current patched,
matching-major `pg_dump`, `pg_restore` and `psql` tools; see the
[compatibility report](docs/compatibility.md).

Expand Down Expand Up @@ -65,9 +66,10 @@ target-bug disappearance and infrastructure failures. See the
[candidate-validity contract](docs/candidate-invalid.md) and guide for details.

Use `--oracle-framed-json` when the application logs to stdout. Snapshot isolation
is the default; `--candidate-backend clone` is an experimental alternative on
PostgreSQL 15–18. Both `WAL_LOG` and `FILE_COPY` are tested; `file_copy_method`
requires PostgreSQL 18. `--restore-jobs N` enables parallel archive restores.
is the default and works on PostgreSQL 13–18; `--candidate-backend clone` is an
experimental alternative on PostgreSQL 15–18. Both `WAL_LOG` and `FILE_COPY` are
tested; `file_copy_method` requires PostgreSQL 18. `--restore-jobs N` enables parallel
archive restores.

Use `--reduce-schema` for opt-in whole-table schema reduction.
It runs after row reduction, checks each proposed removal with
Expand Down
2 changes: 1 addition & 1 deletion docs/adoption.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ v0.5.0 supports the [candidate-validity contract](candidate-invalid.md) for both
strict and framed JSON oracles. Case-specific wrappers may explicitly mark known
invalid schema/data states; unknown application/environment failures remain
infrastructure errors. Current feedback requirements are Python >=3.10,
PostgreSQL 15–18 with matching clients, and DBReduce v0.5.0 or the latest release.
PostgreSQL 13–18 with matching clients, and DBReduce v0.5.1 or the latest release.
Reports should state how invalidity was established, separately from negative
target checks and unresolved errors.

Expand Down
66 changes: 55 additions & 11 deletions docs/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ the checks performed on 2026-09-30 for DBReduce v0.5.0. This release retains the
Python and PostgreSQL compatibility established in v0.4.1 and adds explicit
candidate validity without new reducer primitives.

## Range in v0.5.1

DBReduce v0.5.1 supports **Python 3.10–3.15** and **PostgreSQL 13–18**. The
[v0.5.1 verification](#v051-verification) below extends the v0.5.0 results; the tables
that follow remain the record of the v0.5.0 validation.

## Python

DBReduce v0.5.0 requires **Python 3.10 or newer**. Each Python version below passed
Expand Down Expand Up @@ -83,14 +89,52 @@ Servers older than PG15 receive a version error before clone creation.
`--file-copy-method` still requires PostgreSQL 18; explicit `copy` requests were
rejected clearly on real PG15, PG16 and PG17 servers.

PostgreSQL 14 is **unsupported by policy** for snapshot/schema, not claimed
incompatible. No full snapshot/schema suite was run on 14. Its clone backend is
**known incompatible**: PostgreSQL 14.24 rejects `CREATE DATABASE ... STRATEGY
WAL_LOG` with `option "strategy" not recognized`, and DBReduce rejects it before
creating a clone. PG14 is outside the tested support range and
[reaches end of support on 2026-11-12](https://www.postgresql.org/support/versioning/).
Snapshot mode does not reject PG14 solely on its version, but its
behavior there has not been validated.
Servers older than PostgreSQL 15 cannot use the clone backend: PostgreSQL 14.24
rejects `CREATE DATABASE ... STRATEGY WAL_LOG` with `option "strategy" not
recognized`. Since v0.5.1 DBReduce stops with a version error before any dump or
restore when `--candidate-backend clone` meets such a server. Snapshot and schema
reduction need no PostgreSQL 15 feature and are verified on 13 and 14 (see
[v0.5.1 verification](#v051-verification)). PostgreSQL
[13 is past end of support and 14 reaches it on 2026-11-12](https://www.postgresql.org/support/versioning/);
use a patched release.

## v0.5.1 verification

Checked on 2026-10-31 on macOS arm64 (Python source checks) and Linux arm64 containers
(PostgreSQL), with the committed `uv.lock`. GitHub Actions was not run for these
results; the CI matrix was extended to the same combinations.

Python 3.10, 3.11, 3.12, 3.13, 3.14 and 3.15 (3.15.2) each passed Ruff, mypy and the
122 non-PostgreSQL tests (also with `DeprecationWarning` as an error), built the wheel
and sdist once, and ran `dbreduce --help` from that wheel through
`uvx --isolated --python <version>`. No source change was needed for 3.15; the locked
psycopg-binary and Typer install and run on it. The wheel declares
`Requires-Python: >=3.10` with no upper bound.

PostgreSQL integration suite (`pytest -m postgres`) with native, matching-major clients:

| Server and client | Result | Notes |
| ----------------- | --------------------------- | ------------------------------------------- |
| 13.23 | 45 passed, 21 skipped | snapshot, schema, final restore |
| 14.24 | 45 passed, 21 skipped | snapshot, schema, final restore |
| 15.19 | 65 passed, 1 skipped | adds clone WAL_LOG and FILE_COPY |
| 16.15 | 65 passed, 1 skipped | |
| 17.11 | 65 passed, 1 skipped | |
| 18.6 | 65 passed, 1 skipped | `file_copy_method` is PostgreSQL 18 only |

The skips are deliberate: clone tests and the per-database ICU provider test need
PostgreSQL 15, and the test that checks the clone version error needs a server older
than 15. Everything else, including cancellation and cleanup, ran on all six majors,
and no run left a `dbreduce_` database behind. The whole suite (167 passed, 21
skipped) also passed on Python 3.15.2 with PostgreSQL 14.24. Only that pairing and the
Python 3.11 container used for the other majors were executed here; other
Python/PostgreSQL combinations rely on the CI matrix.

PostgreSQL 13 and 14 have no `CREATE DATABASE ... STRATEGY`, per-database ICU locale
providers or `file_copy_method`. Restoring an archive whose database uses the ICU provider
into such a server fails with the server's own error. `pg_dump --restrict-key`, which
snapshot fingerprinting needs, is present in the 13.23 and 14.24 clients used here; for 13 the
first patched client version was not checked.

## PostgreSQL feature audit

Expand Down Expand Up @@ -151,9 +195,9 @@ Cross-major combinations were not added to the support matrix.

## CI and installation

The workflow separates five Python unit/type/lint/install jobs from four
PostgreSQL integration jobs (PG15/Python 3.10, PG16/3.12, PG17/3.13, PG18/3.14),
not a 5×4 cross product. Each PostgreSQL job checks all three native client major
The workflow separates six Python unit/type/lint/install jobs from six
PostgreSQL integration jobs (PG13/Python 3.11, PG14/3.15, PG15/3.10, PG16/3.12,
PG17/3.13, PG18/3.14), not a cross product. Each PostgreSQL job checks all three native client major
versions, server major, privileged test role and `--restrict-key` availability.
The release job depends on both matrices. The tables above summarize v0.5.0
validation; the candidate-validity, oracle-write isolation and final confirmation
Expand Down
25 changes: 15 additions & 10 deletions docs/dbreduce-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading