Skip to content

Datalium Strata 0.9.0-preview.3

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 19 Nov 22:28
· 19 commits to main since this release
d3c88a7

A 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 every Datalium.Strata.* reference.
  • Rust: =0.9.0-preview.3 on every datalium-strata* crate. The crates pin each other exactly, so they move together.
  • CLI: download the binary from the v0.9.0-preview.3 release.

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's strata graph validate on their exported definitions.
  • Rust: a match on ValidationErrorKind that names every variant needs an arm for NoTerminal.
  • Rust: a client passed to StrataCloudOptions::with_client must be a reqwest 0.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) or max_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() and strata graph validate now 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. ValidationErrorKind gains NoTerminal in 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 exits 1, 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's malloc to 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 end GraphExecutionResult::Failed with NodeFailed { message: "no branches to run" } instead, when the group's branches had settled as cancelled before the group was polled again (#48). It now ends Cancelled at 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.WhenAny and each branch through WaitAsync (#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" in design/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_client takes a reqwest 0.13 client. datalium-strata-ai and datalium-strata-cloud moved from reqwest 0.12 to 0.13. If you pass your own client to with_client, build it with reqwest 0.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-ai and datalium-strata-cloud build used to trust a bundled copy of the Mozilla root certificates, with ring for the cryptography. They now use the operating system's certificate store (rustls-platform-verifier) and aws-lc-rs, the defaults of reqwest 0.13's rustls feature. A certificate your system trusts, such as a company proxy's, now works without extra setup.

  • Rust dependencies updated: base64 0.23, sha2 0.11, syn 3 (in datalium-strata-macros) and rusqlite 0.40 (in datalium-strata-memory, and in the CLI's tests). rusqlite stays 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) and RecoverOptions::with_max_concurrency (Rust) set how many threads one RecoverStaleAsync / recover_stale call 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 than Limit, 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) and Host::recover (Rust) used to recover one at a time. They now take MaxConcurrency / 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's datalium-strata gains a dependency on futures-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_id is 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 of ListThreadsAsync / list_threads joined every matching thread: about half a second a page with a million threads, so listing them all took minutes. Each purge candidate scanned the whole checkpoint_leases table. 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: ratatui 0.30. The CLI moved from ratatui 0.29 to 0.30, which pulls in lru 0.18 instead of 0.12. lru before 0.16.3 has a soundness advisory, GHSA-rhfx-m35p-ff5j. The CLI looks and behaves the same.

  • benchmarks/RESULTS.md is measured again, in one run on this version, with comparisons against 0.9.0-preview.2 made 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.