chore(deps)!: bump obix to 0.11.0, job to 0.14.0 - #884
Conversation
obix 0.11.0 adds commit-ordered delivery as an opt-in second lane (#151); job 0.14.0 returns the existing job for duplicate requests (#214). Both are breaking 0.x minor bumps. Migration updated in place from the obix 0.11.0 template (nothing is live yet, so no drop/add migration is needed). The regenerated file is a faithful cala_-prefixed copy of the upstream template, verified by round-trip: stripping the prefix reproduces it byte for byte. The new schema adds commit_xid to the events table plus the commit-log lane (partitioned log, its partitions, and the singleton state row). SingletonSubscriber::handle_persistent now receives the event as the shared Arc the outbox decoded once, so the EC rollup handler's signature is updated to match; Arc derefs, so the body is unchanged. .sqlx cache regenerated against the new schema. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
obix 0.11.0 delivers each persistent event as the Arc it decoded once, so a collect_with fold can retain a refcount instead of copying the payload out. The rollup batch now holds those Arcs: - EntryCreated: was a full EntryValues clone per entry per batch (Decimal, Currency, description, metadata JSON). Stragglers whose transaction flushed in an earlier landing were cloned and then dropped, which is pure waste. - TransactionCreated: was a Vec<EntryId> allocation per transaction. The Copy scalars are still copied out; entry_ids is read back through the event. Nothing downstream needed owned entries — the applier stores &'a EntryValues in SnapshotOrEntry and only reads them — so EcRollupTxn now carries Vec<&'a EntryValues>, borrowed either from the batch's events or from the flush's fetched map. Both outlive the apply call. Snapshots::from_ec_entries takes an IntoIterator of &EntryValues; &Vec<EntryValues> still satisfies it, so its existing callers are unchanged. into_rollup_txns becomes rollup_txns(&self, &fetched). It reads the maps instead of draining them; entry ids are unique to one transaction, so get and remove are equivalent here. 104 tests pass (lib, ec_streaming_rollup, effective_balance). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Pushed What changed. The batch retains the shared events instead of copying payloads out of them:
Why it reaches all the way down. Nothing downstream ever needed owned entries — the applier stores
One thing worth a reviewer's eye: Verified: |
📊 Performance ReportCommit: 9817393 Cala Performance Benchmark Results (non-representative)Criterion Benchmark Results (single-threaded)
Load Testing Results (parallel-execution)
Note: Performance results may vary based on system resources and database state. Last updated by commit 9817393 |
What
obixjobBoth are breaking 0.x minor bumps:
Migration — updated in place
Nothing is live yet, so the obix setup migration is regenerated in place rather than adding a drop/add migration.
The new file is a faithful
cala_-prefixed copy of the obix 0.11.0 template, verified by round-trip: strippingcala_reproduces upstream byte for byte. Prefixes are applied to DDL identifiers only; comment prose is upstream verbatim (which is why the comment diff is noisy — the previous copy had hand-abridged comments).Schema delta from 0.10.0:
commit_xid BIGINT NOT NULL DEFAULT pg_current_xact_id()::text::bigintoncala_persistent_outbox_events, plus an index on itcala_persistent_outbox_commit_log(range-partitioned, with_p0+_defaultpartitions and asequenceindex) and the singletoncala_persistent_outbox_commit_log_stateseeded with(0, 0)20250904065521_job_setup.sqlis already identical to job 0.14.0's copy — unchanged.Source change
SingletonSubscriber::handle_persistentnow takes&Arc<PersistentOutboxEvent<P>>(the shared Arc the outbox decoded once) instead of&PersistentOutboxEvent<P>. Updated the EC rollup handler's signature to match;Arc<T>derefs toT, so the body is unchanged.Not done here: the new Arc makes it possible for
collect_withfolds to retain a refcount instead of cloning fields out of the event. The handler still clonesentry_ids/entryas before — worth a follow-up, but out of scope for a version bump.Verified locally
make reset-deps— migration applies cleanly from scratch.sqlxregenerated viamake sqlx-prepare(10 new commit-log queries cached)SQLX_OFFLINE=true cargo build --locked(what CI builds) — passescargo clippy --workspace --all-targets --all-features— clean; the oneunused_mutwarning intests/transaction_batch.rs:814is pre-existing on main (confirmed by stashing)make check-event-schemas— schemas unchangedFull test suite left to CI.
🤖 Generated with Claude Code
Note
High Risk
Touches persistent outbox schema/commit ordering, job queue SQL under concurrency, and the EC rollup hot path—core async infrastructure where regressions affect delivery correctness and balance maintenance.
Overview
Bumps
obixto 0.11.0 andjobto 0.14.0, with workspace lockfile updates and a regenerated.sqlxoffline cache (outbox queries now surfacecommit_xid; job-execution SQL reflects upstream locking, batching, and idempotency changes).The obix setup migration is rewritten in place for greenfield deploys:
commit_xid(and index) oncala_persistent_outbox_events, plus the new commit-ordered delivery lane (cala_persistent_outbox_commit_log, singleton state, partitions/indexes). Subscription DDL comments are expanded; behavior is unchanged aside from schema alignment with obix 0.11.EC balance rollup adapts to obix’s
handle_persistent(&Arc<PersistentOutboxEvent<…>>)API and avoids cloning stream payloads: transactions keep anArcto the shared event (entry ids read from payload), batches storeArcentry events, andEcRollupTxn/ balance appliers take borrowed&EntryValuesthrough flush instead of owned vectors.Reviewed by Cursor Bugbot for commit 9817393. Bugbot is set up for automated code reviews on this repo. Configure here.