Skip to content

Commit db4dae3

Browse files
carlydfSushisource
andcommitted
Add CONTINUE_AS_NEW_SUGGESTED_REASON and CONTINUE_AS_NEW_VERSIONING_BEHAVIOR enums. (#677)
_**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._ <!-- Describe what has changed in this PR --> - Allow user to specify in ContinueAsNewOptions what the initial versioning behavior of the continued-as-new workflow should be. User can say AutoUpgrade if they want their workflow to upgrade on continue-as-new. - Define `CONTINUE_AS_NEW_SUGGESTED_REASON`. `suggest_continue_as_new = true, reason = TARGET_WORKER_DEPLOYMENT_VERSION_CHANGED` will be sent to the SDK with each workflow task, if the target version of the workflow is different than the deployment version that the workflow is currently on. Workflow code should listen to this and decide whether to ContinueAsNew based on the suggestion and reason(s) for the suggestion. <!-- Tell your future self why have you made these changes --> We want to offer a way for users to guarantee workflow pinning within a run, while still upgrading to the latest Current/Ramping version on the continue-as-new boundary. In Phase 2 of Trampolining (which is "proactive wakeup for sleeping workflows"), a separate workflow attribute will be added to allow workflows to receive a proactive wake-up when a new version is available. Pro-active wakeup would cause sleeping workflows to wake up and have the opportunity to check `continue_as_new_suggested` and continue-as-new if they choose. This is orthogonal to "will I upgrade when I continue-as-new," and applicable to both Pinned and AutoUpgrade workflows. <!-- Are there any breaking changes on binary or code level? --> **Breaking changes** <!-- If this breaks the Server, please provide the Server PR to merge right after this PR was merged. --> **Server PR** temporalio/temporal#8784 --------- Co-authored-by: Spencer Judge <[email protected]>
1 parent 74439c7 commit db4dae3

File tree

8 files changed

+552
-313
lines changed

8 files changed

+552
-313
lines changed

command/v1/message.pb.go

Lines changed: 80 additions & 66 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

enums/v1/workflow.go-helpers.pb.go

Lines changed: 39 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

enums/v1/workflow.pb.go

Lines changed: 184 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)