feat(engine/physicalpb): Add IndexMerge node marshalling - #22231
Conversation
The dataobj compaction coordinator dispatches IndexMerge tasks to
workers over the wire transport, so the physical.IndexMerge node needs
protobuf marshal/unmarshal support. Without it the node cannot cross
the scheduler -> worker boundary.
- Add the IndexMerge message and its RunRef/SectionRef fields to
physicalpb.proto and regenerate physicalpb.pb.go.
- marshal_node.go / unmarshal_node.go convert physical.IndexMerge to
and from the proto message.
- codec.go now returns the conversion/marshal error instead of
panicking: an unmarshallable node should surface as a transport
error to the caller, not crash the encoder goroutine.
Adds round-trip marshalling tests for the new node.
872b7bd to
7a7e7e5
Compare
| google.protobuf.Duration task_ttl = 5 [ | ||
| (gogoproto.stdduration) = true, | ||
| (gogoproto.nullable) = false | ||
| ]; |
There was a problem hiding this comment.
This is standing out to me. What does TTL mean here? Why is the physical plan carrying information about task orchestration?
There was a problem hiding this comment.
AFAIK there's not really a good way to give tasks a TTL currently, and this seemed important for compaction. However you're completely right this is not a planning concern. I'm going to remove this and guard in #22233, and we can circle back to enforcing a task TTL later if needed. Or if there is a way to do that already, I can wire it up correctly in a future PR?
| // for a single tenant within one ToC window. | ||
| message IndexMerge { | ||
| string tenant = 1; | ||
| int64 toc_window_start = 2; |
There was a problem hiding this comment.
We should ideally have a comment here explaining what the unit being stored is, or add the unit as a suffix to the field name; it's not clear to me what a value means.
There was a problem hiding this comment.
renamed and added a comment
A per-task execution deadline is a task-orchestration concern, not part of the physical plan that crosses the scheduler -> worker boundary. Carrying task_ttl on the IndexMerge node promoted orchestration policy into the plan-level API. Remove the task_ttl field from the IndexMerge proto message, regenerate physicalpb.pb.go, and drop it from the marshal/unmarshal converters and the round-trip test. The google.protobuf.Duration import stays (other messages still use it). The deadline will be reintroduced at the orchestration layer (the wire Task envelope, alongside MaxTimeRange, which already carries execution-control metadata outside the fragment) as separate work covering both IndexMerge and LogMerge uniformly. The TaskTTL field remains on physical.IndexMerge for now and is simply not serialized.
Rename the IndexMerge proto field to toc_window_start_unix_nanos and document why it is pinned at plan time. The field is captured when the task is planned so the executor and the Phase-2 pointer swap operate on the same metastore ToC window even if the clock drifts before the task runs; deriving it from "now" at execution time could resolve to a different window near a boundary.
The prior proto-regen commit reindented a trailing comment in frontend.proto using a newer local buf than CI's pinned version, causing check-generated-files to fail. Restore the comment to the form CI's buf format produces.
What this does
Part 3 of 6 splitting up #21972 (IndexMerge executor) into reviewable PRs. Independent — based on
main, can review/merge in any order.The dataobj compaction coordinator dispatches
IndexMergetasks to workers over the wire transport, so thephysical.IndexMergenode needs protobuf marshal/unmarshal support.IndexMergemessage and itsRunRef/SectionReffields tophysicalpb.protoand regeneratephysicalpb.pb.go.marshal_node.go/unmarshal_node.goconvertphysical.IndexMergeto and from the proto message.Adds round-trip marshalling tests for the new node.