Skip to content

Commit 2084f22

Browse files
committed
docs(changelog): record the drift guard, the index alignment and the inventory
Unreleased: the schema-drift guard and reserved/unused inventory, the canonical-id / microsecond-truncation and shared-timeline coverage, and the SQLite index alignment (`jobs_ready` key, new `job_requests_attempts`) with its before/after EXPLAIN QUERY PLAN.
1 parent 41d6af3 commit 2084f22

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,48 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
Releases before v0.27.0 predate the changelog.
99
## [Unreleased]
1010

11+
### Added
12+
13+
- A schema-drift guard keeps the SQLite (`control/lite/schema.sql`) and
14+
Postgres (`control/pg/schema.sql`) control schemas aligned: same tables,
15+
column names, foreign keys and indexes, with every deliberate difference
16+
listed and reasoned in `control/schema_drift.rs` (partition children, the
17+
xid8 outbox columns and their ordering index, the GIN label index, the
18+
pg-only `job_messages.job_timeout_s`, the shared `timeline_id`, and the
19+
`runner_sessions.runner_id` FK). The guard fails on an undocumented
20+
difference and on a stale entry, so aligning the backends shrinks the list
21+
instead of letting it rot. The same module inventories the schema objects
22+
kept without readers — `RESERVED` placeholders (`namespace_policies`, three
23+
unread `namespace_limits` columns, `artifacts`) and `UNUSED` leftovers
24+
(`namespaces.cell_generation`/`config_version`,
25+
`run_submissions.secret_refs`, `jobs.not_before`,
26+
`provision_requests.lease_owner`/`leased_until`,
27+
`runner_sessions.engine_node_id`, `log_files.byte_count`/`line_count`,
28+
`artifacts.upload_token_hash`/`finalized_at`) — and a grep test fails when
29+
code starts using one, so the inventory cannot silently stale. Nothing is
30+
dropped and no schema version is bumped: this branch has no migration
31+
runner, so dropping a column would strand every existing control database.
32+
- Coverage for id and time storage on both backends: a run id and job
33+
round-trip in lowercase-canonical form, a sub-microsecond instant reads
34+
back as whole microseconds (nanosecond `bigint` stamps keep full
35+
precision), SQLite accepts several attempts of one job sharing a
36+
`timeline_id` (the deliberate pg-`UNIQUE` divergence) and its
37+
`job_requests_timeline_cascade` trigger prunes the shared timeline with the
38+
last request.
39+
40+
### Changed
41+
42+
- SQLite's `jobs_ready` key is now `(pool_key, priority DESC, run_order,
43+
job_order)` — exactly the claim / ready-queue `ORDER BY`, the key Postgres
44+
already carries. `namespace_id` sat between the pool key and the priority,
45+
so SQLite sorted the last three ORDER BY terms on every poll; the claim
46+
query now reads the ready front in index order (`EXPLAIN QUERY PLAN` goes
47+
from `USE TEMP B-TREE FOR LAST 3 TERMS OF ORDER BY` to no sort). SQLite
48+
also gains `job_requests_attempts (run_id, job_id, request_id DESC)`, the
49+
same index Postgres has, which serves the latest-attempt lookups and the
50+
`jobs` -> `job_requests` cascade that the partial inflight index cannot.
51+
Both are fresh-database changes: an existing database keeps working
52+
unchanged, because a missing index is never an error.
1153

1254
### Security
1355

0 commit comments

Comments
 (0)