Skip to content

Commit e02a846

Browse files
authored
Worker Heartbeat: Use Worker Grouping instead of Runtime for Key in nexus TQ (#637)
_**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 --> **What changed?** use `worker_grouping_key` instead of `runtime_key` for worker command nexus task queue <!-- Tell your future self why have you made these changes --> **Why?** There can be multiple clients (i.e. with different auths) within the same runtime/namespace, so we want a more specific category for these nexus worker command requests <!-- Are there any breaking changes on binary or code level? --> **Breaking changes** No, WIP feature <!-- If this breaks the Server, please provide the Server PR to merge right after this PR was merged. --> **Server PR**
1 parent d8216ae commit e02a846

File tree

4 files changed

+13
-16
lines changed

4 files changed

+13
-16
lines changed

buf.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ breaking:
1313
- WIRE_JSON
1414
ignore:
1515
- google
16+
# TODO (yuandrew): remove this. Added for "heartbeat" changes
17+
- temporal/api/worker/v1/message.proto
1618
lint:
1719
use:
1820
- DEFAULT

openapi/openapiv2.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16307,13 +16307,13 @@
1630716307
"type": "string",
1630816308
"description": "Worker host identifier."
1630916309
},
16310-
"processKey": {
16310+
"workerGroupingKey": {
1631116311
"type": "string",
16312-
"title": "Worker process identifier. This id should be unique for all _processes_\nrunning workers in the namespace, and should be shared by all workers\nin the same process.\nThis will be used to build the worker command nexus task queue name:\n\"temporal-sys/worker-commands/{process_key}\""
16312+
"title": "Worker grouping identifier. A key to group workers that share the same client+namespace+process.\nThis will be used to build the worker command nexus task queue name:\n\"temporal-sys/worker-commands/{worker_grouping_key}\""
1631316313
},
1631416314
"processId": {
1631516315
"type": "string",
16316-
"description": "Worker process identifier. Unlike process_key, this id only needs to be unique\nwithin one host (so using e.g. a unix pid would be appropriate)."
16316+
"description": "Worker process identifier. This id only needs to be unique\nwithin one host (so using e.g. a unix pid would be appropriate)."
1631716317
},
1631816318
"currentHostCpuUsage": {
1631916319
"type": "number",

openapi/openapiv3.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13648,18 +13648,16 @@ components:
1364813648
hostName:
1364913649
type: string
1365013650
description: Worker host identifier.
13651-
processKey:
13651+
workerGroupingKey:
1365213652
type: string
1365313653
description: |-
13654-
Worker process identifier. This id should be unique for all _processes_
13655-
running workers in the namespace, and should be shared by all workers
13656-
in the same process.
13654+
Worker grouping identifier. A key to group workers that share the same client+namespace+process.
1365713655
This will be used to build the worker command nexus task queue name:
13658-
"temporal-sys/worker-commands/{process_key}"
13656+
"temporal-sys/worker-commands/{worker_grouping_key}"
1365913657
processId:
1366013658
type: string
1366113659
description: |-
13662-
Worker process identifier. Unlike process_key, this id only needs to be unique
13660+
Worker process identifier. This id only needs to be unique
1366313661
within one host (so using e.g. a unix pid would be appropriate).
1366413662
currentHostCpuUsage:
1366513663
type: number

temporal/api/worker/v1/message.proto

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,12 @@ message WorkerHostInfo {
5454
// Worker host identifier.
5555
string host_name = 1;
5656

57-
58-
// Worker process identifier. This id should be unique for all _processes_
59-
// running workers in the namespace, and should be shared by all workers
60-
// in the same process.
57+
// Worker grouping identifier. A key to group workers that share the same client+namespace+process.
6158
// This will be used to build the worker command nexus task queue name:
62-
// "temporal-sys/worker-commands/{process_key}"
63-
string process_key = 5;
59+
// "temporal-sys/worker-commands/{worker_grouping_key}"
60+
string worker_grouping_key = 5;
6461

65-
// Worker process identifier. Unlike process_key, this id only needs to be unique
62+
// Worker process identifier. This id only needs to be unique
6663
// within one host (so using e.g. a unix pid would be appropriate).
6764
string process_id = 2;
6865

0 commit comments

Comments
 (0)