Preserve sub-orchestration parent link across ContinueAsNew#31
Preserve sub-orchestration parent link across ContinueAsNew#31pinodeca wants to merge 3 commits into
Conversation
| None, | ||
| history_mgr.parent_instance.clone(), | ||
| history_mgr.parent_id, | ||
| Some(carry_forward_events.clone()), |
There was a problem hiding this comment.
Can we wire this into WorkItem::ContinueAsNew event directly instead of pulling from the history?
Needs to be backcompat though.
There was a problem hiding this comment.
Done in 4f9d29c. The parent link (parent_instance/parent_id) is now stamped directly onto WorkItem::ContinueAsNew by the CAN producer in execution.rs, and the consumers read it from the work item.
For backcompat, both new fields are #[serde(default)] + skip_serializing_if, so old enqueued messages deserialize cleanly and the wire format is unchanged. To stay correct during rolling upgrades (a CAN enqueued by an older node that didn't stamp the fields), the consumers fall back to deriving the link from the previous execution's history when the fields are absent. Added test_workitem_reader_can_preserves_parent_link_from_work_item for the direct path and kept ..._from_history for the fallback path.
Address review feedback: wire parent_instance/parent_id directly into WorkItem::ContinueAsNew instead of deriving solely from prior execution history. Fields are optional (#[serde(default)]) for backward compatibility; consumers fall back to history for messages enqueued by older runtimes.
Preserves the parent link when a sub-orchestration rolls over with ContinueAsNew, so the logical child can still notify its parent when a later execution completes or fails.
Summary:
Validation: