Skip to content

refactor: round-trip single plan nodes through protobuf - #879

Draft
gabotechs wants to merge 1 commit into
mainfrom
gabotechs/roundtrip-single-node
Draft

gabotechs wants to merge 1 commit into
mainfrom
gabotechs/roundtrip-single-node

Conversation

@gabotechs

@gabotechs gabotechs commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

roundtrip_pb now round-trips only the node it's given, instead of the whole subtree below it. Its children are swapped for EmptyExec placeholders during the round-trip and put back afterwards, which is what isolate_sort_dynamic_filters_for_display was already doing by hand.

Round-tripping whole subtrees meant that any round-trip done during planning also serialized the network boundaries below it, worker URLs included. A follow-up PR makes those URLs unknown at that point, so this needs to stop.

Severing in-memory dynamic filter relationships can't just round-trip the whole plan anymore, but nodes in the same plan still have to keep sharing their dynamic filters afterwards. DeduplicatingProtoConverter only dedups within a single call, so this adds a RoundtripProtoConverter whose dedup cache lives as long as the instance. The sever now walks the plan and round-trips only the nodes that hold dynamic filters, all through one converter. For network boundaries, only their dynamic_filter_anchors are round-tripped.

No behaviour change is intended. The existing dynamic filtering integration tests cover the shared converter: giving each node its own converter makes 5 of them fail.

Comment on lines +107 to +108
#[derive(Default)]
pub(crate) struct RoundtripProtoConverter {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

A bit annoying that we need this committed here...

roundtrip_pb now serializes only the node it is given: its children are
swapped for EmptyExec placeholders during the round-trip and put back
afterwards. Severing in-memory dynamic filter relationships round-trips
only the nodes holding dynamic filters (and only the anchors of network
boundaries) through a shared RoundtripProtoConverter, so nodes that
shared a dynamic filter before still share it after.
@gabotechs
gabotechs force-pushed the gabotechs/roundtrip-single-node branch from b7801e0 to 576a2f2 Compare November 19, 2026 10:58

This branch has not been deployed

No deployments
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