temporalio / features

Behavior and history compatibility testing for Temporal SDKs
13 stars 16 forks source link

Support upgrading handlers/loops easier #518

Open recht opened 1 month ago

recht commented 1 month ago

We have a couple of long-running workflows, which currently use workflow.GetVersion for backwards compatibility. The workflows usually sit in a loop handling signals. It would be very nice if it was possible to upgrade the signal handler code safely so that new signals run with the latest version while history is processed with the version used at that point in time.

Right now, workflow.GetVersion will always return the same value, so it gets locked into a specific behavior. It would be great if there was an alternative GetVersion, which would switch to the latest version once the history has been replayed, or some similar solution.

For reference here's the conversation from Slack: https://temporalio.slack.com/archives/CTRCR8RBP/p1721843534985449

Quinn-With-Two-Ns commented 1 month ago

Moving this issue to features because this applies to more then just the Go SDK. All SDKs should have similar features to make versioning signal handler easier.