Skip to content

inherit pinned version and override across CaN when pinned #588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

carlydf
Copy link
Contributor

@carlydf carlydf commented May 13, 2025

READ BEFORE MERGING: All PRs require approval by both Server AND SDK teams before merging! This is why the number of required approvals is "2" and not "1"--two reviewers from the same team is NOT sufficient. If your PR is not approved by someone in BOTH teams, it may be summarily reverted.

What changed?
Add fields to continued as new event to enable inheriting pinned version and override across CaN when the effective behavior of the WF is pinned.

This inheritance will not happen if the behavior is anything else (auto-upgrade, pinned-until-continue-as-new, etc)

Why?
To differentiate pinned from trampolining

No

Server PR

@carlydf carlydf requested review from a team as code owners May 13, 2025 23:53
// instead of starting on the Current Version of its Task Queue.
// This is set only if the new workflow is starting on a Task Queue belonging to the same
// Worker Deployment Version.
temporal.api.deployment.v1.WorkerDeploymentVersion previous_pinned_deployment_version = 37;
Copy link

@drewhoskins-temporal drewhoskins-temporal May 14, 2025

Choose a reason for hiding this comment

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

  • nit: continued_from_pinned_deployment_version for clarity?
  • nit: At the cost of sending a redundant identifier, it seems easier to explain/more declarative, and more robust, to just set this always and then let the new workflow decide whether it wants to ignore the information. That way, you're not embedding intent into it, you're just presenting the data.

Choose a reason for hiding this comment

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

(The main related question I have is, have we thought through transition points where the workflow is changing behaviors across code revisions?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here is what I think we want:

CaN: Auto-upgrade -> Pinned

  • WF1 is running on version A, where it is labelled auto-upgrade
  • WF1 Continues as new, call the new wf WF1.1
  • Because WF1 is not Pinned, WF1.1 does not inherit the pinned version, and starts on the current version of its task queue, which is now B. In version B, this WF type is labelled Pinned, so the behavior of WF1.1 becomes Pinned on the first WFT completion send by the version B worker.
  • WF1.1 Continues as new, call the new wf WF1.2
  • Because WF1.1 is Pinned to B, WF1.2 inherits the pinned version B, and starts on version B*
  • The first WFT completion on WF1.2 will come from worker B, which will say this wf type is Pinned, so WF1.2 will remain Pinned.

*if WF1.2 starts on a different task queue from WF1.1, and that other task queue is not in Version B, then WF1.2 will not inherit, and will instead start on the current version of its task queue. This is uncommon.

bool inherit_build_id = 15;

// If this is set, the new execution inherits the versioning override of the current execution,

Choose a reason for hiding this comment

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

Symmetric point here: should we just always set this?

bool inherit_build_id = 15;

// If this is set, the new execution inherits the versioning override of the current execution,
// because the effective behavior of the current execution is pinned.
temporal.api.workflow.v1.VersioningOverride current_pinned_versioning_override = 16;
Copy link
Contributor

Choose a reason for hiding this comment

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

since this event belongs to the previous run we might not need it at all. That workflow already knows it's pinned version and override.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, the important thing is just that we create the new mutable state correctly

// of starting on the Current Version of its Task Queue.
// This is set only if the child workflow is starting on a Task Queue belonging to the same
// Worker Deployment Version.
temporal.api.deployment.v1.WorkerDeploymentVersion parent_pinned_deployment_version = 36;
Copy link
Member

@cretz cretz May 15, 2025

Choose a reason for hiding this comment

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

Not generally reviewing PR (leaving up to others that know versioning better), but I can I get confirmation that this field is not referenced in any SDK or CLI code? I didn't see it, just wanting to confirm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I asked @Sushisource last week and he told me that it was not. I also don't think that it is. This is used internally in the server.

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.

5 participants