Repository navigation
Trellis 0.3.0
Highlights
- A rolling deploy needs no
migratestep. Once every old process has
stopped, a background process of the new release runs the pending
migrations itself and takes over in the same pass (#1852). The takeover
work runs once per binary version, recorded with the work (#1855). - Faster aggregate and
JOINbuilds. A plain aggregate's fresh build
writes each group once, per leaf on a partitioned source; rebuilds update
hidden rows in key order;JOIN … GROUP BYbuilds write their hidden
tables in sorted single passes. At 10M groups a fresh aggregate build takes
82 s from define tolive, against 1,535 s for 0.2.0's form (#1938,
Benchmarks). - Correct on the PostgreSQL 2026-11 minors (15.20, 16.16, 17.12, 18.7),
whose attribute versions (CVE-2026-6460) hid a same-type column rewrite
from capture (#1947). Also in 0.2.1. - A revoked schema
USAGEhalts only the definitions that read or write
that schema, instead of failing the staging pass for every table
(#1921, #1925). - Alertable metrics for definitions by status, pauses by cause, held
keys, tripped column fuses, drain failures, capture holdups and worker
liveness (#1957). - The Ruby gem follows Rails conventions: logs to
Rails.logger, a
metrics endpoint and exporter middleware, read-onlyTrellis::Target
models, a test-environment off switch withrefresh_trellis_target, and a
CI check for risky deploys. Trellis is now off in a Rails app'stest
environment by default (Behaviour changes).
0.3.0 includes every fix in 0.2.1. 80 pull requests merged since v0.2.0
(changelog).
Bugfixes
-
A deadlock between a page and a rebuild start (#2019, #2021; also in
0.2.x). A page that parked a quarantined key's change, or wrote a 1-1
JOIN's hidden state, took definition rows in two places out of id order.
A rebuild start (request_backfill, the last capture install) locks the same
rows in one sorted statement, so the two could deadlock. The start usually
lost and returneddeadlock detected(40P01) to its caller; no data went
wrong. A page now takes all its definition rows in one id order, after its
other targets. Truncate clears run in target order too. -
A 1-1
JOINbuild could go live with a stale target row (#2027; also in
0.2.x). A page that re-derived an entry while the build'sMpass ran,
whosearow was deleted before its chunk read the range, left a target row
joined to a replacedMentry until the delete's page drained. The sweep's
stale bound now sits past theMpass, and every 1-1JOINbuild, fresh
ones too, ends with the sweep. A fresh build takes about 18% longer (5M
rows: 36.7 s to 43.4 s); a build in 0.3.0 is still much faster than in 0.2.x. -
Same-type column rewrites on the 2026-11 minors (#1947, #1948; also in
0.2.1). Capture missed anALTER COLUMN … TYPE … USINGthat kept the
type, and its readers' targets stayed silently stale. The rewrite check now
leaves the attribute version out of its hash. Tests simulate attribute
versions on every server, so pull-request CI covers these minors. -
A revoked
USAGEon a source's schema (#1921, #1925). The definitions
reading or writing a table in that schema halt (capture_failurekind
halt, naming the role and schema), andstatus()answers for them.
Every other table keeps staging. AfterGRANT USAGE,RESUMErebuilds
them. In 0.2.x the drain failed the page forever,status()of an affected
aggregate returned a permission error, and the staging pass failed for
every table. -
A star
JOINpaused by anON-column retype (#1950) names only the
retyped column, once. A two-tableJOINwhose onlyONcolumn re-renders
(integertotext) now also says the pair no longer matches. -
Key types are matched by OID, not type text (#1875). A user type or
domain named like a key type (create domain "integer" as numeric) is not
taken for the built-in one in a retype pause reason. A refused extension
type is named in full (public.citext).Behaviour changes
-
Ruby: Trellis is off in the
testenvironment (#1959).
config.trellis.off_indefaults to%w[test], read from every
environment, sodb:preparefrom development leaves Trellis out of the
test database too. There nothing connects at boot;Trellis::Railtie.connect
andtrellis:migratewarn and do nothing; a schema load creates the
targets as plain tables and leaves the definitions in the restore queue;
the migration helpers (define,apply,status) raise
ActiveRecord::MigrationError, so build the test database with
db:schema:loadordb:test:prepare, notdb:migrate. Tests write
targets directly or fill one withrefresh_trellis_target.
Action: a suite that runs Trellis in its tests sets
config.trellis.off_in = [](the gem README's "Running Trellis in
tests"). Without it nothing connects andTrellis::Railtie.connectwarns. -
Ruby: Rails sends the engine's log lines to
Rails.logger, at its
level (#1954). Action, if adebuglog is too much:
config.trellis.log_level = :info, orconfig.trellis.log_bridge = false. -
Rust: while migrations are pending, a failing
status()or
definitions()returnsTrellisError::MigrationsPending(code
version_handover, the SQL error as its source), not the bare SQL error.
Action: code matching that SQL error matches the new variant. -
A worker role that can't alter Trellis's tables stands by until
migrateruns (above). Action: keep the deploy step. -
A queued restore runs before the takeover (#1855). While it refuses (a
conflicting definition, a role without DDL), every background process
stands by, retries every minute and reports why in its log andstatus().
0.2.x took over and left the queue unrestored. Action: fix what the
reason names. -
More rebuilds on the 2026-11 minors (also in 0.2.1). There an
ALTER COLUMN … TYPEre-stamps every later column. When the table's file
also moved, each later column a definition reads counts as rewritten and
its readers rebuild, some for nothing: one rule that errs toward
rebuilding (decided on #1948). Action: expect such anALTERto
rebuild the readers of the table's later columns. -
Rolling back to 0.2.x and forward again skips the takeover work
(below). Action: none
for 0.3.0.