From ab8f82c105287b47e310b9c9252c24b3b1ccd095 Mon Sep 17 00:00:00 2001 From: Roey Berman Date: Fri, 14 Apr 2023 15:23:48 -0700 Subject: [PATCH] Worker versioning related updates (#272) Decided not to expose (the yet unused) `CompatibleVersionSet.version_set_id`, the set will have multiple IDs internally. The affected projects have been updated: - [x] [Server PR](https://github.com/temporalio/temporal/pull/4170) - [x] [Go SDK PR](https://github.com/temporalio/sdk-go/pull/1089) Also added a `use_versioning` flag to `RespondWorkflowTaskCompletedRequest` to differentiate between the version stamp being used for versioning (matching) purposes or just as a marker. --- temporal/api/taskqueue/v1/message.proto | 11 ++++------- .../api/workflowservice/v1/request_response.proto | 5 +++++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/temporal/api/taskqueue/v1/message.proto b/temporal/api/taskqueue/v1/message.proto index d790dac5..353e7f7a 100644 --- a/temporal/api/taskqueue/v1/message.proto +++ b/temporal/api/taskqueue/v1/message.proto @@ -87,12 +87,9 @@ message StickyExecutionAttributes { google.protobuf.Duration schedule_to_start_timeout = 2 [(gogoproto.stdduration) = true]; } -// Used by the worker versioning APIs, represents an ordering of one or more versions which are -// considered to be compatible with each other. Currently the versions are always worker build ids. +// Used by the worker versioning APIs, represents an unordered set of one or more versions which are +// considered to be compatible with each other. Currently the versions are always worker build IDs. message CompatibleVersionSet { - // A unique identifier for this version set. Users don't need to understand or care about this - // value, but it has value for debugging purposes. - string version_set_id = 1; - // All the compatible versions, ordered from oldest to newest - repeated string build_ids = 2; + // All the compatible versions, unordered, except for the last element, which is considered the set "default". + repeated string build_ids = 1; } diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index a4f0c5ad..7b8d23cb 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -327,6 +327,11 @@ message RespondWorkflowTaskCompletedRequest { temporal.api.sdk.v1.WorkflowTaskCompletedMetadata sdk_metadata = 12; // Local usage data collected for metering temporal.api.common.v1.MeteringMetadata metering_metadata = 13; + + // If set, the worker is opting in to worker versioning. Otherwise, worker_version_stamp is used as a marker for + // workflow reset points and the BuildId search attibute. + // This flag must only be set if worker_version_stamp is provided. + bool use_versioning = 14; } message RespondWorkflowTaskCompletedResponse {