Repository navigation
Datalium Strata 0.9.0-preview.3
Pre-releaseA new validation check for graphs that can't reach an end (#50), a fix for a Rust run cancelled while a parallel group runs (#48), parallel groups and maps that allocate less (#37), Postgres listings and purges that no longer slow down as the store grows (#38), and recovery of several threads at once (#39). Measured against 0.9.0-preview.2 on one machine, a .NET parallel group of 32 branches runs in half the time and allocates about half as much, and a Rust one is 20 to 30% faster (benchmarks/RESULTS.md, finding 5).
Upgrading
Change the version:
- .NET:
dotnet add package Datalium.Strata.Hosting --version 0.9.0-preview.3, or the same version on everyDatalium.Strata.*reference. - Rust:
=0.9.0-preview.3on everydatalium-strata*crate. The crates pin each other exactly, so they move together. - CLI: download the binary from the
v0.9.0-preview.3release.
Then check these, in both engines unless named:
- A graph that compiled before can now fail to compile with
STRATA_ERR_NO_TERMINAL, if it has a node from which every path loops back. Give the loop an exit. To find such graphs before you upgrade, run the new CLI'sstrata graph validateon their exported definitions. - Rust: a
matchonValidationErrorKindthat names every variant needs an arm forNoTerminal. - Rust: a client passed to
StrataCloudOptions::with_clientmust be areqwest0.13 client. - Rust: HTTPS uses the operating system's certificates instead of a bundled copy. An image with no CA certificates installed (built
FROM scratch, say) needs them. - The hosted recovery drivers recover 8 threads at once by default, where they recovered one. Set
Strata:Recovery:MaxConcurrency(.NET) ormax_concurrency(Rust) to 1 for the old behaviour, or lower it if the process is close to its model's rate limit or its database pool.
Changes
-
Validation refuses a graph with a node that can't reach an end (
STRATA_ERR_NO_TERMINAL)..compile()/.Compile()andstrata graph validatenow report each node the entry point reaches from which every path loops back, at every level, by its qualified path (#50,design/Arch-Specs/STRATA-SPEC-004.md). Until now a graph whose loops were all guarded but had no way out passed, and ran until a hop limit stopped it, or forever without one. A graph that compiled before can now fail to compile: give the loop an exit, an edge to a node with no outgoing edge. A node whose only edges are a reject route, a timeout route or a recovery-policy fallback counts as an end, and those routes count as a way out. The check proves a node can reach an end, not that a run will, so a hop limit is still the guard for an exit whose condition never matches.ValidationErrorKindgainsNoTerminalin both engines; Rust code that matches on it exhaustively needs a new arm. The error comes after a level's unguarded cycles and before its groups' errors. The CLI exits1, as for any structural error. -
Rust: a parallel group's branch allocates less. An async branch's handler future is no longer boxed a second time to catch its panic, and
BranchOutcomes::deciding()builds its list of names the first time it is called instead of copying them on every run (#37,design/49-Burst-Throughput.md). A branch makes 7 allocations instead of 9.deciding()returns the same names. A CPU profile of a burst of runs found glibc'smallocto be about 40% of the engine's CPU there;design/49's "Hosting a burst" has the numbers for choosing an allocator. -
Rust: a run cancelled while a parallel group runs ends
Cancelled. It could endGraphExecutionResult::FailedwithNodeFailed { message: "no branches to run" }instead, when the group's branches had settled as cancelled before the group was polled again (#48). It now endsCancelledat the group, as in .NET, with the branches reported cancelled. A map, and a group that isn't cancelled, behave as before. -
.NET: a parallel group or a map waits for its branches with less. Each branch now reports how it settled to one inbox the group reads, instead of the group waiting on its branches through
Task.WhenAnyand each branch throughWaitAsync(#37,design/49-Burst-Throughput.md). A branch allocates about 707 bytes instead of 943. A burst of 100,000 waiting runs got through 132,000–145,000 runs a second with DATAS off, against 92,000. A branch is reported, timed out and given up on as before: one that ignores its token still times out on time and is still given up on, and an exception it throws later is still observed. In Rust, a group no longer copies its attempt's inputs, which makes a burst of runs about 4% faster on Linux. Nothing an application sees changes. -
Nodes and parallel branches allocate less. A burst of runs whose handlers really wait is limited by what each run in flight holds, not by the engine's CPU (#37,
design/49-Burst-Throughput.md). In .NET a node now allocates 728 bytes instead of 1,008, and a branch 943 instead of 1,307. The idempotency key is built when a handler first reads it, and an attempt has a token source of its own only when its node has a timeout. In Rust an async branch makes 9 allocations instead of 12. In both engines a branch of a group without a branch timeout watches the group's token instead of one of its own. Nothing an application sees changes: the API, the idempotency keys, the events, spans and metrics are the same. A host that runs bursts of waiting runs should also read "Hosting a burst" indesign/49: .NET's DATAS, server GC's dynamic heap count, and the allocator in Rust set the rate more than the engine. -
Rust:
StrataCloudOptions::with_clienttakes areqwest0.13 client.datalium-strata-aianddatalium-strata-cloudmoved fromreqwest0.12 to 0.13. If you pass your own client towith_client, build it withreqwest0.13. A 0.12 client no longer compiles. Nothing else in the API changed. -
Rust: HTTPS trusts the operating system's certificates. The clients that
datalium-strata-aianddatalium-strata-cloudbuild used to trust a bundled copy of the Mozilla root certificates, withringfor the cryptography. They now use the operating system's certificate store (rustls-platform-verifier) andaws-lc-rs, the defaults ofreqwest0.13'srustlsfeature. A certificate your system trusts, such as a company proxy's, now works without extra setup. -
Rust dependencies updated:
base640.23,sha20.11,syn3 (indatalium-strata-macros) andrusqlite0.40 (indatalium-strata-memory, and in the CLI's tests).rusqlitestays below 0.41, which needs Rust 1.89. The minimum Rust version is still 1.88. -
Recovery can run several threads at once, and skips live threads with one read.
RecoverOptions.MaxConcurrency(.NET) andRecoverOptions::with_max_concurrency(Rust) set how many threads oneRecoverStaleAsync/recover_stalecall checks and recovers at once. The default is 1, one at a time, as before. Before, recovering a dead worker took about one run's latency per thread it had in flight. The call still never recovers more thanLimit, and the report keeps the listing's order. Each listed thread's lease is now read first, before its checkpoint is loaded and before it waits for a scheduler slot. A thread a live lease holds then costs one read, where it cost two and, with a scheduler, a slot. The skip reasons are the same, but a thread that is both held and no longer running is now reported as held. -
The hosted recovery drivers recover 8 threads at once by default.
AddRecoveryDriver(.NET) andHost::recover(Rust) used to recover one at a time. They now takeMaxConcurrency/max_concurrency(Strata:Recovery:MaxConcurrency), default 8. Each recovery re-runs the node that was in flight, so a dead worker's recovery now adds up to 8 runs to the new worker's own. To recover one at a time as before, set it to 1; set it lower if the process is close to its model's rate limit or its database pool (#39). Rust'sdatalium-stratagains a dependency onfutures-util(#39). -
Postgres: a page of a thread listing no longer slows down as the store grows, and a purge no longer scans every lease. The head table's
thread_idis in the"C"collation and the log's and the leases' are in the database's, so Postgres couldn't use their primary keys to join them. Each page ofListThreadsAsync/list_threadsjoined every matching thread: about half a second a page with a million threads, so listing them all took minutes. Each purge candidate scanned the wholecheckpoint_leasestable. Both now compare in the other table's collation and look each thread up in its primary key: about 2 ms a page at a million threads. Same results, in both engines, with no migration (#38). -
CLI:
ratatui0.30. The CLI moved fromratatui0.29 to 0.30, which pulls inlru0.18 instead of 0.12.lrubefore 0.16.3 has a soundness advisory, GHSA-rhfx-m35p-ff5j. The CLI looks and behaves the same. -
benchmarks/RESULTS.mdis measured again, in one run on this version, with comparisons against0.9.0-preview.2made the same day.
Wire formats
Unchanged from 0.9.0-preview.1: see its table below. The shared validator gains STRATA_ERR_NO_TERMINAL, with fixtures in schema/fixtures/graph-validation/; graph definitions keep their schema_version.