Skip to content

Commit

Permalink
Add flags and response info for questions about build ids
Browse files Browse the repository at this point in the history
  • Loading branch information
Sushisource committed Nov 2, 2022
1 parent 5fee586 commit 2f4d2c0
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
3 changes: 3 additions & 0 deletions temporal/api/workflow/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ message PendingWorkflowTaskInfo {
google.protobuf.Timestamp original_scheduled_time = 3 [(gogoproto.stdtime) = true];
google.protobuf.Timestamp started_time = 4 [(gogoproto.stdtime) = true];
int32 attempt = 5;
// If set, this pending workflow task will need to be (or is currently being) handled by a
// a worker using this build id.
string will_use_build_id = 6;
}

message ResetPoints {
Expand Down
35 changes: 35 additions & 0 deletions temporal/api/workflowservice/v1/request_response.proto
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,9 @@ message QueryWorkflowResponse {
message DescribeWorkflowExecutionRequest {
string namespace = 1;
temporal.api.common.v1.WorkflowExecution execution = 2;
// If set, the response will include which build id shall be used to process the pending
// workflow task, if any.
bool include_pending_workflow_task_build_id = 3;
}

message DescribeWorkflowExecutionResponse {
Expand Down Expand Up @@ -1058,6 +1061,12 @@ message GetWorkerBuildIdOrderingRequest {
// Limits how many compatible sets will be returned. Specify 1 to only return the current
// default major version set. 0 returns all sets.
int32 max_sets = 3;
// If set, the response will include information about worker versions which are ready to be
// retired.
bool include_retirement_candidates = 4;
// If set, the response will include information about which versions have open workflows, and
// whether or not there are currently polling workers who are compatible with those versions.
bool include_poller_compatability = 5;
}
message GetWorkerBuildIdOrderingResponse {
// Major version sets, in order from oldest to newest. The last element of the list will always
Expand All @@ -1066,6 +1075,32 @@ message GetWorkerBuildIdOrderingResponse {
//
// There may be fewer sets returned than exist, if the request chose to limit this response.
repeated temporal.api.taskqueue.v1.CompatibleVersionSet major_version_sets = 1;

message RetirementCandidate {
// The worker build id which is ready for retirement
string build_id = 1;
// If true, there are no open *or* closed workflows, meaning there is no reason at all
// to keep the worker alive, not even to service queries on closed workflows. If not true,
// then there are no open workflows, but some closed ones.
bool no_closed_workflows = 2;
// Currently polling workers who match the build id ready for retirement
repeated temporal.api.taskqueue.v1.PollerInfo pollers = 3;
}

// A list of workers who are still live and polling the task queue, but may no longer be needed
// to make progress on open workflows.
repeated RetirementCandidate retirement_candidates = 2;

message VersionsWithCompatiblePollers {
// The latest build id which completed a workflow task on some open workflow
string most_recent_build_id = 1;
// Currently polling workers who are compatible with `most_recent_build_id`.
repeated temporal.api.taskqueue.v1.PollerInfo pollers = 2;
}

// A list of versions and pollers who are capable of processing tasks at that version (if any)
// for which there are currently open workflows.
repeated VersionsWithCompatiblePollers active_versions_and_pollers = 3;
}

// (-- api-linter: core::0134=disabled
Expand Down

0 comments on commit 2f4d2c0

Please sign in to comment.