Skip to content

Commit df4181f

Browse files
authored
Add weak consistency option to DescribeNamespaceRequest (#775)
<!-- Describe what has changed in this PR --> **What changed?** Added weak_consistency boolean field to `DescribeNamespaceRequest`. When set to `true`, the server may serve the response from an eventually-consistent source (e.g. the in-memory namespace registry) instead of reading through to persistence. <!-- Tell your future self why have you made these changes --> **Why?** `DescribeNamespace` currently always reads through to the persistence store. The new field lets clients opt into eventually-consistent reads where read-after-write semantics aren't required, while preserving the existing strong-consistency contract for operator/admin callers (default behavior unchanged). <!-- Are there any breaking changes on binary or code level? --> **Breaking changes** None. Additive field with default `false`, preserving current behavior for clients that don't set it. <!-- If this breaks the Server, please provide the Server PR to merge right after this PR was merged. --> **Server PR** temporalio/temporal#10103
1 parent f1e7757 commit df4181f

3 files changed

Lines changed: 37 additions & 0 deletions

File tree

openapi/openapiv2.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,13 @@
150150
"in": "query",
151151
"required": false,
152152
"type": "string"
153+
},
154+
{
155+
"name": "weakConsistency",
156+
"description": "If true, the server may serve the response from an eventually-consistent\nsource instead of reading through to persistence. Defaults to false,\nwhich preserves read-after-write consistency. SDKs should set this when\nfetching namespace capabilities on worker/client startup.",
157+
"in": "query",
158+
"required": false,
159+
"type": "boolean"
153160
}
154161
],
155162
"tags": [
@@ -5013,6 +5020,13 @@
50135020
"in": "query",
50145021
"required": false,
50155022
"type": "string"
5023+
},
5024+
{
5025+
"name": "weakConsistency",
5026+
"description": "If true, the server may serve the response from an eventually-consistent\nsource instead of reading through to persistence. Defaults to false,\nwhich preserves read-after-write consistency. SDKs should set this when\nfetching namespace capabilities on worker/client startup.",
5027+
"in": "query",
5028+
"required": false,
5029+
"type": "boolean"
50165030
}
50175031
],
50185032
"tags": [

openapi/openapiv3.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,15 @@ paths:
109109
in: query
110110
schema:
111111
type: string
112+
- name: weakConsistency
113+
in: query
114+
description: |-
115+
If true, the server may serve the response from an eventually-consistent
116+
source instead of reading through to persistence. Defaults to false,
117+
which preserves read-after-write consistency. SDKs should set this when
118+
fetching namespace capabilities on worker/client startup.
119+
schema:
120+
type: boolean
112121
responses:
113122
"200":
114123
description: OK
@@ -4466,6 +4475,15 @@ paths:
44664475
in: query
44674476
schema:
44684477
type: string
4478+
- name: weakConsistency
4479+
in: query
4480+
description: |-
4481+
If true, the server may serve the response from an eventually-consistent
4482+
source instead of reading through to persistence. Defaults to false,
4483+
which preserves read-after-write consistency. SDKs should set this when
4484+
fetching namespace capabilities on worker/client startup.
4485+
schema:
4486+
type: boolean
44694487
responses:
44704488
"200":
44714489
description: OK

temporal/api/workflowservice/v1/request_response.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ message ListNamespacesResponse {
8686
message DescribeNamespaceRequest {
8787
string namespace = 1;
8888
string id = 2;
89+
// If true, the server may serve the response from an eventually-consistent
90+
// source instead of reading through to persistence. Defaults to false,
91+
// which preserves read-after-write consistency. SDKs should set this when
92+
// fetching namespace capabilities on worker/client startup.
93+
bool weak_consistency = 3;
8994
}
9095

9196
message DescribeNamespaceResponse {

0 commit comments

Comments
 (0)