Skip to content

fix: let the shm transport absorb the coordinator's plan_proto encode#30

Draft
mdashti wants to merge 2 commits into
moe/shm-on-protocol-grpcfrom
moe/shm-plan-proto-discard
Draft

fix: let the shm transport absorb the coordinator's plan_proto encode#30
mdashti wants to merge 2 commits into
moe/shm-on-protocol-grpcfrom
moe/shm-plan-proto-discard

Conversation

@mdashti

@mdashti mdashti commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

This PR makes the shm embedder work under the channel-protocol coordinator, which serializes every stage subplan into plan_proto before dispatch even though the shm channel ships plans over DSM and drains-and-discards that request.

Two changes, both under src/shm/, so #28 stays shm-only:

  • src/shm/plan_codec.rs adds ShmDiscardedPlanCodec, a PhysicalExtensionCodec the embedder registers via with_distributed_user_codec. It sits behind the built-in DistributedCodec in new_combined_with_user, so it is consulted only for nodes DataFusion's proto can't represent (custom scans, SortMergeJoinExec), and encodes each as empty. The bytes are never read, so it refuses to decode.
  • collect_task_metrics reports an empty task-level MetricsSet instead of None, so the unchanged decode_task_metrics accepts the shm path's frames and the per-task EXPLAIN rewrite runs.

Surfaced by the pg_search MPP regress in paradedb #5448: without the first, a SortMergeJoinExec query errored mid-dispatch (DataFusion's proto can't encode it and no codec absorbed it); without the second, joins showed no worker output_rows in EXPLAIN ANALYZE (every metrics frame failed to decode, so the rewrite timed out).

Stacked on #28. Draft for review.

mdashti added 2 commits July 1, 2026 16:14
The coordinator serializes every stage subplan before handing it to the
channel, but the shm transport ships plans over DSM and discards that
request. `ShmDiscardedPlanCodec` lets the throwaway encode succeed for
nodes DataFusion's proto cannot represent, such as `SortMergeJoinExec`.
The shm fragment path has no task-level stamps, but the decoder requires
the field present; emitting an empty set instead of `None` keeps every
worker metrics frame decodable so the per-task EXPLAIN rewrite runs.
@mdashti mdashti force-pushed the moe/shm-on-protocol-grpc branch from 992673d to ea63b5e Compare July 1, 2026 23:15
@mdashti mdashti force-pushed the moe/shm-plan-proto-discard branch from a09c34a to 741f0c1 Compare July 1, 2026 23:16
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