Skip to content

compute: launch a second, interactive compute runtime - #38391

Draft
antiguru wants to merge 1 commit into
mh/interactive-05-importfrom
mh/interactive-06-runtime
Draft

compute: launch a second, interactive compute runtime#38391
antiguru wants to merge 1 commit into
mh/interactive-05-importfrom
mh/interactive-06-runtime

Conversation

@antiguru

@antiguru antiguru commented Aug 21, 2026

Copy link
Copy Markdown
Member

Sixth of eight PRs splitting #37770. Stacks on #38390. Tracked by CPU-216.

With --interactive-compute-timely-config, clusterd runs two compute runtimes in one process: the first takes Maintenance, the second Interactive, and both share the one sharing registry so a reader on worker i of either finds the slot a publisher on worker i of the other filled. They must span an equal number of Timely peers, which the config preparation asserts, because the registry pairs workers by ordinal. Without the flag the process runs a single Solo runtime, unchanged from a deployment with no second runtime.

One controller endpoint still fronts the replica: with two runtimes a Multiplexer serves it, with one the maintenance client builder serves it directly.

Shared fate is the read-hold mechanism. Both runtimes' threads are covered by the process-global panic hook installed at the top of main, so a panic on either aborts the process, bounding an interactive import's read hold to the life of the replica without a lease. A subprocess test asserts the abort, which cannot be observed from inside the panicking process.

enable_compute_interactive_runtime is replica-scoped but resolved in environmentd, since the controller decides ServiceConfig::ports before the replica exists. replica_scoped_bool parses through the dyncfg rather than str::parse, because a stored bool formats as on/off.

Off in production and in tests. Flipping it changes how a replica is provisioned, so it is not a live toggle. The interactive runtime cannot serve index peeks until the next PR in the stack, which is safe only because the flag is off here. That is also why the flag is registered in UNINTERESTING_SYSTEM_PARAMETERS and pinned to FALSE in parallel-workload's FlipFlagsAction: check-test-flags requires a new flag to be registered in the PR that introduces it, but nothing may turn this one on yet. The last PR of the stack promotes it to a variable system parameter defaulting on.

true,
"Aggressively downgrade input read holds for indexes on zero-replica clusters.",
);
/// Whether to launch compute replicas with a second, interactive compute timely runtime.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline above.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. (Posted by Claude Code.)

@antiguru
antiguru force-pushed the mh/interactive-06-runtime branch 2 times, most recently from a985417 to 3cc5402 Compare August 21, 2026 13:24
@antiguru
antiguru force-pushed the mh/interactive-06-runtime branch from 3cc5402 to 15cc33c Compare August 21, 2026 13:42
@antiguru
antiguru requested a review from DAlperin August 21, 2026 13:46
@antiguru
antiguru force-pushed the mh/interactive-06-runtime branch from 15cc33c to 9311614 Compare August 21, 2026 14:31
With `--interactive-compute-timely-config`, clusterd runs two compute runtimes in
one process: the first takes the `Maintenance` role, the second `Interactive`, and
both share the one sharing registry so a reader on worker `i` of either finds the
slot a publisher on worker `i` of the other filled. The two must span an equal
number of Timely peers, which the config preparation asserts, because the registry
pairs workers by ordinal and reads are sound only if both shard keys across the
same peer count. Without the flag the process runs a single `Solo` runtime and is
byte-unchanged from a deployment that has no second runtime.

One controller endpoint still fronts the replica. With two runtimes a
`Multiplexer` serves it, routing each command to the owning runtime and merging
responses; with one, the maintenance client builder serves it directly.

Shared fate is the read-hold mechanism. Both runtimes' worker and reader threads
are covered by the process-global panic hook installed at the top of `main`, so a
panic on either aborts the whole process. That bounds an interactive import's read
hold to the life of the replica without a lease, because there is no way for one
runtime to wedge while the other's holds continue. A subprocess test asserts the
abort, which cannot be observed from inside the panicking process.

`ClusterSpec::cluster_name` lets one process run two clusters of the same kind with
distinguishable tracing spans. The interactive runtime takes
`compute-interactive`; solo and maintenance keep the bare `compute` so
single-runtime logs are unchanged.

`enable_compute_interactive_runtime` is replica-scoped but resolved in
`environmentd`, because the controller decides `ServiceConfig::ports` before the
replica exists and so cannot read the value from the replica's `worker_config`.
`CatalogState::replica_scoped_bool` parses the override through the dyncfg rather
than `str::parse`, since a stored bool formats as `on`/`off`, which
`str::parse::<bool>()` rejects.

Off by default in production and in tests. Flipping it changes how a replica is
provisioned, so it is not a live toggle: a running replica keeps the layout it was
launched with.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@antiguru
antiguru force-pushed the mh/interactive-06-runtime branch from 9311614 to eb80f6a Compare August 21, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant