Expand description
DETERMINISTIC PLACEMENT (D8 / D9): every worker computes the SAME task→worker map from the topology and the sorted worker set, so no worker is told its placement and there is no control plane that owns it (D9 — “zero control plane; the leader is a worker”). Two properties make that sound:
- Deterministic and contiguous. A stage’s parallel instances are handed out in contiguous
blocks (
owner_of, instanceiofn→ worker⌊i·w/n⌋), mirroring [crate::dataflow:: vnode_ranges]. A worker therefore owns a contiguous span of a stage’s vnode ranges — fewer cross-worker edges — and the same(topology, sorted members)reproduces the same map on every worker and across a restart. - Part of the fingerprint. The member set folds into the checkpoint fingerprint
(
Members::fingerprint_clause), so a member-set change is a topology change that refuses to restore over the old checkpoint unlessSTREAM_RESET_STATE=1(D8 — restart-based rescale first; 4c does the authorised re-assignment). A solo run (no--join) contributes an empty clause, so its fingerprint — and thus every existing checkpoint — is byte-identical to the pre-Phase-4 runtime. No regression.
The single-process runtime is unchanged: Members::solo places every task on the one worker,
and the exchange wiring (the remote edge wiring) then has no remote edges at all.
Structs§
- Members
- The sorted, de-duplicated set of a run’s workers, plus this process’s own index. Sorting makes
the assignment independent of the order workers happened to join in — the invariant
owner_ofrelies on.
Functions§
- assign
- Place a whole graph: task id → worker, deriving each task’s stage from the builder’s
rolesandstage_of(both indexed by task id, in creation = id order). A stage’s parallel instances are the tasks that share a(role, stage)key, in id order; each is spread byowner_of. Becauseowner_ofdepends only on(instance, n, workers), a 1:1 forward chain (upstream and downstream stages of equal width, paired by instance) lands each pair on the same worker — a forward edge stays in-process — while a keyBy/shuffle stage of a different width spreads across workers. A solo run (members.len() == 1) places everything on worker 0, sostartand a solostart_workerare identical. - owner_
of - The owner of parallel instance
iof ann-way stage acrosswworkers. Contiguous blocks, mirroringcrate::dataflow::vnode_ranges(instancei→ worker⌊i·w/n⌋), so a worker owns a contiguous vnode span and adjacent instances tend to share a worker (fewer remote edges). Stable under restart with the samew.wandnare clamped to at least 1;i ≥ nis treated as the last instance (defensive — callers passi < n).
Type Aliases§
- Worker
Id - A worker’s index within the sorted member set.