Skip to content
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

Use string values for deployment version #547

Merged
merged 7 commits into from
Feb 3, 2025
Merged

Conversation

ShahabT
Copy link
Contributor

@ShahabT ShahabT commented Feb 3, 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?

  • Using string type in all the places for version fields. Removed WorkerDeploymentVersion from the public API. This is for two reasons:
    • String type gives ability to specify special values of __unversioned__ (and maybe later <deployment_name>/__unversioned__.
    • We might add ability for users to pass custom version IDs in with case the struct would be hard for users to use (they'd need to write the logic to convert the struct to an ID based on whether it has a custom ID or not).
  • Using WorkerDeploymentOptions in the task response APIs instead of WorkerDeploymentVersion so that server has the full info regardless of the worker participating in versioning or not.
  • Added worker_deployment field to execution info (top level) so both versioned and unversioned workflows can have this info (and its corresponding SA).
  • Renamed WorkflowVersioningMode to WorkerVersioningMode and its VERSIONING_BEHAVIORS enum to VERSIONED, for the following reasons:
    • This enum is more about the worker than the workflows, whether or not workflows are versioned or not depends on whether or not the worker enables versioning.
    • We tried to not use the terms "versioned" and "unversioned" for workers for a while but the attempt did work and we ended up even creating special __unversioned__ value for them. Hence, it'd be very confusing if they don't see some config such as WorkerVersioningMode that directly specifies the worker as versioned or unversioned. The previous name, while doing the same thing, twisted the naming and I believe it'll confuse the users.
    • Deployment Versions are not created for the unversioned mode, at least not so far. This naming and updated comments reflects that better.
    • WorkflowVersioningMode is easy to be confused with Workflow VersioningBehavior.

Why?

Breaking changes

Server PR

Copy link
Member

@cretz cretz left a comment

Choose a reason for hiding this comment

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

LGTM since going to feature branch and doesn't appear to be affecting any master APIs

Copy link
Contributor Author

@ShahabT ShahabT left a comment

Choose a reason for hiding this comment

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

Change requests that came out of in-person meeting with @antlai-temporal @carlydf @Shivs11 .

// same `deployment_name` and `build_id`, across all Task Queues.
// When `versioning_mode==VERSIONED`, the worker will be part of a Deployment Version identified
// by "<deployment_name>/<build_id>".
temporal.api.enums.v1.WorkerVersioningMode versioning_mode = 3;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

-> worker_versioning_mode

@@ -260,7 +260,7 @@ message WorkflowTaskCompletedEventAttributes {
// The deployment version of the worker that completed this task. Must be set if
// `versioning_behavior` is set. This value updates workflow execution's
// `versioning_info.deployment_version`.
temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 9;
string deployment_version = 9;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

add format comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

add deployment name too

@@ -110,6 +110,9 @@ message WorkflowExecutionInfo {
// be versioned or unversioned, depending on `versioning_info.behavior` and `versioning_info.versioning_override`.
// Experimental. Versioning info is experimental and might change in the future.
WorkflowExecutionVersioningInfo versioning_info = 22;

// The name of Worker Deployment that completed the most recent workflow task.
string worker_deployment = 23;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

-> worker_deployment_name

// Note that if `versioning_override.behavior` is PINNED then `versioning_override.pinned_version`
// will override this value.
temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 5;
string deployment_version = 5;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

-> version

temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 1;
// Required. The target version of the transition. May be `__unversioned__` which means a
// so-far-versioned workflow is transitioning to unversioned workers.
string deployment_version = 1;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

-> version

// - It has no active pollers (none of the task queues in the Version have pollers)
// - It is drained (see WorkerDeploymentVersionInfo.drainage_info)
// - It is drained (see WorkerDeploymentVersionInfo.drainage_info). This condition can be skipped
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Make it clear that nil drainage info is ok

// Workers with this mode are part of a Worker Deployment Version which is identified as
// "<deployment_name>/<build_id>". Such workers are called "versioned" as opposed to
// "unversioned".
// Each Deployment Version is distinguished from other Versions and users can configure Temporal
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Each Deployment Version is distinguished from other Versions and users can configure Temporal
// Each Deployment Version is unique within a Namespace and users can configure the Temporal

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 meant they are distinguished for routing task. I'll make that clear.

// Optional. By default this request would be rejected if not all the expected Task Queues are
// being polled by the new Version, to protects against accidental removal of Task Queues, or
// worker health issues. Pass `true` here to bypass this protection.
// The set of expected Task Queues equals to all the Task Queues ever polled from the existing
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// The set of expected Task Queues equals to all the Task Queues ever polled from the existing
// The set of expected Task Queues is the set of all the Task Queues that ever belonged to the existing

// add_rate of 0.)
// - Task Queues that are moved to another Worker Deployment (inferred by the Task Queue
// having a different Current Version than the Current Version of this deployment.)
// WARNING: Do not set this flag unless you are sure that the missing task queue poller are not
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// WARNING: Do not set this flag unless you are sure that the missing task queue poller are not
// WARNING: Do not set this flag unless you are sure that the missing task queue pollers are not

// having a different Current Version than the Current Version of this deployment.)
// WARNING: Do not set this flag unless you are sure that the missing task queue poller are not
// needed. If the request is unexpectedly rejected due to missing pollers, then that means the
// pollers have not reached to server yet.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// pollers have not reached to server yet.
// pollers have not reached the server yet.

string namespace = 1;
// Deployment Version identifier in the form "<deployment_name>/<build_id>".
string version = 2;
// Pass to force deletion even if the Version is not drained. In this case the open pinned
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Pass to force deletion even if the Version is not drained. In this case the open pinned
// Pass to force deletion even if the Version is draining. In this case the open pinned

// - It has no active pollers (none of the task queues in the Version have pollers)
// - It is drained (see WorkerDeploymentVersionInfo.drainage_info)
// - It is not in Draining status (see WorkerDeploymentVersionInfo.drainage_info). This condition
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// - It is not in Draining status (see WorkerDeploymentVersionInfo.drainage_info). This condition
// - It is not draining (see WorkerDeploymentVersionInfo.drainage_info). This condition

@ShahabT ShahabT merged commit 85f6dce into versioning-3.1 Feb 3, 2025
3 checks passed
@ShahabT ShahabT deleted the shahab/build-id branch February 3, 2025 20:56
ShahabT added a commit to temporalio/temporal that referenced this pull request Feb 3, 2025
## What changed?
<!-- Describe what has changed in this PR -->
Updated code to use latest API changes in which Deployment Versions are
represented by string fields rather than structs.
`WorkerDeploymentVersion` proto message still exists but only for the
internal APIs.

## Why?
<!-- Tell your future self why have you made these changes -->
See temporalio/api#547.

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->

---------

Co-authored-by: Carly de Frondeville <[email protected]>
ShahabT added a commit to temporalio/temporal that referenced this pull request Feb 4, 2025
## What changed?
<!-- Describe what has changed in this PR -->
Updated code to use latest API changes in which Deployment Versions are
represented by string fields rather than structs.
`WorkerDeploymentVersion` proto message still exists but only for the
internal APIs.

## Why?
<!-- Tell your future self why have you made these changes -->
See temporalio/api#547.

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->

---------

Co-authored-by: Carly de Frondeville <[email protected]>
ShahabT added a commit to temporalio/temporal that referenced this pull request Feb 4, 2025
## What changed?
<!-- Describe what has changed in this PR -->
Updated code to use latest API changes in which Deployment Versions are
represented by string fields rather than structs.
`WorkerDeploymentVersion` proto message still exists but only for the
internal APIs.

## Why?
<!-- Tell your future self why have you made these changes -->
See temporalio/api#547.

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->

---------

Co-authored-by: Carly de Frondeville <[email protected]>
ShahabT added a commit to temporalio/temporal that referenced this pull request Feb 4, 2025
## What changed?
<!-- Describe what has changed in this PR -->
Updated code to use latest API changes in which Deployment Versions are
represented by string fields rather than structs.
`WorkerDeploymentVersion` proto message still exists but only for the
internal APIs.

## Why?
<!-- Tell your future self why have you made these changes -->
See temporalio/api#547.

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->

---------

Co-authored-by: Carly de Frondeville <[email protected]>
ShahabT added a commit to temporalio/temporal that referenced this pull request Feb 5, 2025
## What changed?
<!-- Describe what has changed in this PR -->
Updated code to use latest API changes in which Deployment Versions are
represented by string fields rather than structs.
`WorkerDeploymentVersion` proto message still exists but only for the
internal APIs.

## Why?
<!-- Tell your future self why have you made these changes -->
See temporalio/api#547.

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->

---------

Co-authored-by: Carly de Frondeville <[email protected]>
ShahabT added a commit to temporalio/temporal that referenced this pull request Feb 5, 2025
## What changed?
<!-- Describe what has changed in this PR -->
Updated code to use latest API changes in which Deployment Versions are
represented by string fields rather than structs.
`WorkerDeploymentVersion` proto message still exists but only for the
internal APIs.

## Why?
<!-- Tell your future self why have you made these changes -->
See temporalio/api#547.

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->

---------

Co-authored-by: Carly de Frondeville <[email protected]>
ShahabT added a commit to temporalio/temporal that referenced this pull request Feb 6, 2025
## What changed?
<!-- Describe what has changed in this PR -->
Updated code to use latest API changes in which Deployment Versions are
represented by string fields rather than structs.
`WorkerDeploymentVersion` proto message still exists but only for the
internal APIs.

## Why?
<!-- Tell your future self why have you made these changes -->
See temporalio/api#547.

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->

---------

Co-authored-by: Carly de Frondeville <[email protected]>
ShahabT added a commit to temporalio/temporal that referenced this pull request Feb 6, 2025
## What changed?
<!-- Describe what has changed in this PR -->
Updated code to use latest API changes in which Deployment Versions are
represented by string fields rather than structs.
`WorkerDeploymentVersion` proto message still exists but only for the
internal APIs.

## Why?
<!-- Tell your future self why have you made these changes -->
See temporalio/api#547.

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->

---------

Co-authored-by: Carly de Frondeville <[email protected]>
ShahabT added a commit to temporalio/temporal that referenced this pull request Feb 6, 2025
## What changed?
<!-- Describe what has changed in this PR -->
Updated code to use latest API changes in which Deployment Versions are
represented by string fields rather than structs.
`WorkerDeploymentVersion` proto message still exists but only for the
internal APIs.

## Why?
<!-- Tell your future self why have you made these changes -->
See temporalio/api#547.

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->

---------

Co-authored-by: Carly de Frondeville <[email protected]>
ShahabT added a commit to temporalio/temporal that referenced this pull request Feb 6, 2025
## What changed?
<!-- Describe what has changed in this PR -->
Updated code to use latest API changes in which Deployment Versions are
represented by string fields rather than structs.
`WorkerDeploymentVersion` proto message still exists but only for the
internal APIs.

## Why?
<!-- Tell your future self why have you made these changes -->
See temporalio/api#547.

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->

---------

Co-authored-by: Carly de Frondeville <[email protected]>
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.

4 participants