Skip to content

feat: add an in-process worker transport (no gRPC)#27

Draft
mdashti wants to merge 4 commits into
gabrielmusat/abstract-grpcfrom
moe/protocol-grpc-shm
Draft

feat: add an in-process worker transport (no gRPC)#27
mdashti wants to merge 4 commits into
gabrielmusat/abstract-grpcfrom
moe/protocol-grpc-shm

Conversation

@mdashti

@mdashti mdashti commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

This PR makes @gabotechs's WorkerChannel abstraction (datafusion-contrib#512) usable by a non-gRPC transport, and adds the in-process reference transport that proves it. The base here is a mirror of his abstract-grpc tip, so the diff is just our additions.

What

  • InProcessChannelResolver (src/protocol/in_process.rs): a ChannelResolver backed by a co-located Worker, routing the three protocol methods straight to it, with no gRPC, no IPC, and no serialization round-trip. The reference implementation of the protocol for a co-located worker.
  • The worker-protocol prost message types and the metrics codec are un-gated (crate::proto, protocol::metrics_proto): a non-gRPC transport speaks the same wire shape but must build with grpc off, so only the tonic client/server stay gated.
  • The transport-authoring helpers a transport reaches for: collect_plan_metrics_protos, set_received_time, the RemoteWorkUnitFeedTxs type.
  • CI: a unit-test-no-grpc job runs cargo test --no-default-features --lib, which actually runs the in-process transport test with no gRPC. Making that compile needed decoupling the benchmarks dev-dependency (it re-unified grpc into every test build), so the dataset suites moved to the benchmarks crate and the gRPC-coupled test_utils is gated behind grpc.

Why

datafusion-contrib#512 abstracts the worker protocol behind WorkerChannel, but gRPC was still the only implementation and the proto sat behind the grpc feature, so nothing exercised the abstraction without gRPC. This is the smallest set of changes that makes it real: a transport that is not gRPC, building and tested with grpc off.

Verified

cargo test --no-default-features --lib runs the in-process transport test (a real distributed GROUP BY across tasks) with no gRPC; clippy + check clean in both feature configs.

Stack

The public embedder API an out-of-crate driver needs (shuffle routing, the metrics store, prepare_in_process_plan) that datafusion-contrib#512 dropped is a separate PR on top of this (#29). The shared-memory transport is on top of that (#28), and its diff is only src/shm/* — it plugs in with no core changes, which is the test that this abstraction is sufficient.

The worker-protocol abstraction shipped only a gRPC implementation, so
nothing exercised it without gRPC. This routes the three protocol methods
straight to a co-located `Worker`, and is the seam a shared-memory
transport plugs into. A worker resolves its own nested stage reads back
through the same transport, so multi-stage queries stay in process.
A co-located transport (in-process worker, shared-memory mesh) speaks the
same wire shape as gRPC, so the prost messages and the metrics codec have
to build with the feature off and crate::proto must resolve either way.
The plan-metrics collector and the receive-time stamp are the seams such a
transport drives directly.
The benchmarks dev-dependency and a few `tonic`-importing test helpers
re-unified gRPC into every test build, so nothing exercised the
in-process transport with gRPC off. Moving the dataset suites into the
benchmarks crate and gating the gRPC-coupled helpers lets
`cargo test --no-default-features --lib` run the in-process transport,
guarded by a new CI job.
Lets an embedder supply the dispatch bytes per stage instead of the
coordinator encoding the plan it holds, whose exec-time state can be
wrong to dispatch or not serializable through datafusion-proto.
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