Skip to content

Commit 20004e3

Browse files
committed
Introduce a device lists worker for Synapse
As per element-hq/synapse#18581
1 parent 6b42574 commit 20004e3

File tree

10 files changed

+358
-2
lines changed

10 files changed

+358
-2
lines changed

charts/matrix-stack/ci/fragments/synapse-all-workers-running.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ synapse:
1010
enabled: true
1111
client-reader:
1212
enabled: true
13+
device-lists:
14+
enabled: true
1315
encryption:
1416
enabled: true
1517
event-creator:

charts/matrix-stack/ci/synapse-worker-example-values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ synapse:
2525
enabled: true
2626
client-reader:
2727
enabled: true
28+
device-lists:
29+
enabled: true
2830
encryption:
2931
enabled: true
3032
event-creator:

charts/matrix-stack/configs/synapse/path_map_file_get.tpl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ workers instead if these requests path are under high load.
2626
^/\_matrix/client/(api/v1|r0|v3|unstable)/presence/
2727
*/}}
2828
^/_matrix/client/unstable/org.matrix.msc4140/delayed_events client-reader
29-
^/_matrix/client/(api/v1|r0|v3|unstable)/devices/ client-reader
3029
{{- end }}
3130
{{ if dig "sso-login" "enabled" false $root.Values.synapse.workers }}
3231
{{- if (and $root.Values.matrixAuthenticationService.enabled (not $root.Values.matrixAuthenticationService.preMigrationSynapseHandlesAuth)) }}

charts/matrix-stack/source/synapse.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@
196196
"encryption": {
197197
"$ref": "file://synapse/single_worker.json"
198198
},
199+
"device-lists": {
200+
"$ref": "file://synapse/scalable_worker.json"
201+
},
199202
"event-creator": {
200203
"$ref": "file://synapse/scalable_worker.json"
201204
},

charts/matrix-stack/source/synapse.yaml.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ workers:
5454
{{- synapse_sub_schema_values.single_worker('appservice') | indent(2) }}
5555
{{- synapse_sub_schema_values.single_worker('background') | indent(2) }}
5656
{{- synapse_sub_schema_values.scalable_worker('client-reader') | indent(2) }}
57+
{{- synapse_sub_schema_values.scalable_worker('device-lists') | indent(2) }}
5758
{{- synapse_sub_schema_values.single_worker('encryption') | indent(2) }}
5859
{{- synapse_sub_schema_values.scalable_worker('event-creator') | indent(2) }}
5960
{{- synapse_sub_schema_values.scalable_worker('event-persister') | indent(2) }}

charts/matrix-stack/templates/synapse/_synapse_details.tpl

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ SPDX-License-Identifier: AGPL-3.0-only
99
{{- with required "element-io.synapse.process.hasHttp missing context" .context -}}
1010
{{ $hasHttp := (list "main"
1111
"client-reader"
12+
"device-lists"
1213
"encryption"
1314
"event-creator"
1415
"federation-inbound"
@@ -33,6 +34,7 @@ hasHttp
3334
{{- $root := .root -}}
3435
{{- with required "element-io.synapse.process.hasReplication missing context" .context -}}
3536
{{- $hasReplication := (list "main"
37+
"device-lists"
3638
"encryption"
3739
"event-persister"
3840
"push-rules"
@@ -131,7 +133,9 @@ responsibleForMedia
131133
{{- define "element-io.synapse.process.streamWriters" -}}
132134
{{- $root := .root -}}
133135
{{- with required "element-io.synapse.process.streamWriters missing context" .context -}}
134-
{{- if eq . "encryption" }}
136+
{{- if eq . "device-lists" }}
137+
{{ list "device_lists" | toJson }}
138+
{{- else if eq . "encryption" }}
135139
{{ list "to_device" | toJson }}
136140
{{- else if eq . "event-persister" }}
137141
{{ list "events" | toJson }}
@@ -283,7 +287,16 @@ responsibleForMedia
283287
{{ $workerPaths = concat $workerPaths (list
284288
"^/_matrix/client/(r0|v3|unstable)/keys/claim$"
285289
"^/_matrix/client/(r0|v3|unstable)/room_keys/"
290+
) }}
291+
{{- end }}
292+
293+
{{- if eq .workerType "device-lists" }}
294+
{{ $workerPaths = concat $workerPaths (list
295+
"^/_matrix/client/(r0|v3)/delete_devices$"
296+
"^/_matrix/client/(api/v1|r0|v3|unstable)/devices(/|$)"
286297
"^/_matrix/client/(r0|v3|unstable)/keys/upload"
298+
"^/_matrix/client/(api/v1|r0|v3|unstable)/keys/device_signing/upload$"
299+
"^/_matrix/client/(api/v1|r0|v3|unstable)/keys/signatures/upload$"
287300
) }}
288301
{{- end }}
289302

charts/matrix-stack/values.schema.json

Lines changed: 276 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7104,6 +7104,282 @@
71047104
"type": "object",
71057105
"additionalProperties": false
71067106
},
7107+
"device-lists": {
7108+
"required": [
7109+
"replicas"
7110+
],
7111+
"properties": {
7112+
"enabled": {
7113+
"type": "boolean"
7114+
},
7115+
"replicas": {
7116+
"type": "integer",
7117+
"minimum": 1
7118+
},
7119+
"resources": {
7120+
"properties": {
7121+
"limits": {
7122+
"additionalProperties": {
7123+
"anyOf": [
7124+
{
7125+
"type": "integer"
7126+
},
7127+
{
7128+
"type": "string"
7129+
}
7130+
],
7131+
"pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
7132+
},
7133+
"type": "object"
7134+
},
7135+
"requests": {
7136+
"additionalProperties": {
7137+
"anyOf": [
7138+
{
7139+
"type": "integer"
7140+
},
7141+
{
7142+
"type": "string"
7143+
}
7144+
],
7145+
"pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
7146+
},
7147+
"type": "object"
7148+
}
7149+
},
7150+
"type": "object",
7151+
"additionalProperties": false
7152+
},
7153+
"topologySpreadConstraints": {
7154+
"type": "array",
7155+
"items": {
7156+
"required": [
7157+
"maxSkew",
7158+
"topologyKey"
7159+
],
7160+
"properties": {
7161+
"labelSelector": {
7162+
"type": "object",
7163+
"properties": {
7164+
"matchExpressions": {
7165+
"type": "array",
7166+
"items": {
7167+
"type": "object",
7168+
"required": [
7169+
"key",
7170+
"operator"
7171+
],
7172+
"properties": {
7173+
"key": {
7174+
"type": "string"
7175+
},
7176+
"operator": {
7177+
"type": "string",
7178+
"enum": [
7179+
"In",
7180+
"NotIn",
7181+
"Exists",
7182+
"DoesNotExist"
7183+
]
7184+
},
7185+
"values": {
7186+
"type": "array",
7187+
"items": {
7188+
"type": "string"
7189+
}
7190+
}
7191+
},
7192+
"additionalProperties": false
7193+
}
7194+
},
7195+
"matchLabels": {
7196+
"type": [
7197+
"object",
7198+
"null"
7199+
],
7200+
"additionalProperties": {
7201+
"type": [
7202+
"string",
7203+
"null"
7204+
]
7205+
}
7206+
}
7207+
},
7208+
"additionalProperties": false
7209+
},
7210+
"matchLabelKeys": {
7211+
"type": [
7212+
"array",
7213+
"null"
7214+
],
7215+
"items": {
7216+
"type": "string"
7217+
}
7218+
},
7219+
"maxSkew": {
7220+
"type": "integer",
7221+
"minium": 1
7222+
},
7223+
"minDomains": {
7224+
"type": "integer",
7225+
"minium": 0
7226+
},
7227+
"nodeAffinityPolicy": {
7228+
"type": "string",
7229+
"enum": [
7230+
"Honor",
7231+
"Ignore"
7232+
]
7233+
},
7234+
"nodeTaintsPolicy": {
7235+
"type": "string",
7236+
"enum": [
7237+
"Honor",
7238+
"Ignore"
7239+
]
7240+
},
7241+
"topologyKey": {
7242+
"type": "string"
7243+
},
7244+
"whenUnsatisfiable": {
7245+
"type": "string",
7246+
"enum": [
7247+
"DoNotSchedule",
7248+
"ScheduleAnyway"
7249+
]
7250+
}
7251+
},
7252+
"type": "object",
7253+
"additionalProperties": false
7254+
}
7255+
},
7256+
"livenessProbe": {
7257+
"type": "object",
7258+
"properties": {
7259+
"failureThreshold": {
7260+
"type": [
7261+
"integer",
7262+
"null"
7263+
],
7264+
"minimum": 1
7265+
},
7266+
"initialDelaySeconds": {
7267+
"type": [
7268+
"integer",
7269+
"null"
7270+
],
7271+
"minimum": 0
7272+
},
7273+
"periodSeconds": {
7274+
"type": [
7275+
"integer",
7276+
"null"
7277+
],
7278+
"minimum": 1
7279+
},
7280+
"successThreshold": {
7281+
"type": [
7282+
"integer",
7283+
"null"
7284+
],
7285+
"minimum": 1
7286+
},
7287+
"timeoutSeconds": {
7288+
"type": [
7289+
"integer",
7290+
"null"
7291+
],
7292+
"minimum": 1
7293+
}
7294+
},
7295+
"additionalProperties": false
7296+
},
7297+
"readinessProbe": {
7298+
"type": "object",
7299+
"properties": {
7300+
"failureThreshold": {
7301+
"type": [
7302+
"integer",
7303+
"null"
7304+
],
7305+
"minimum": 1
7306+
},
7307+
"initialDelaySeconds": {
7308+
"type": [
7309+
"integer",
7310+
"null"
7311+
],
7312+
"minimum": 0
7313+
},
7314+
"periodSeconds": {
7315+
"type": [
7316+
"integer",
7317+
"null"
7318+
],
7319+
"minimum": 1
7320+
},
7321+
"successThreshold": {
7322+
"type": [
7323+
"integer",
7324+
"null"
7325+
],
7326+
"minimum": 1
7327+
},
7328+
"timeoutSeconds": {
7329+
"type": [
7330+
"integer",
7331+
"null"
7332+
],
7333+
"minimum": 1
7334+
}
7335+
},
7336+
"additionalProperties": false
7337+
},
7338+
"startupProbe": {
7339+
"type": "object",
7340+
"properties": {
7341+
"failureThreshold": {
7342+
"type": [
7343+
"integer",
7344+
"null"
7345+
],
7346+
"minimum": 1
7347+
},
7348+
"initialDelaySeconds": {
7349+
"type": [
7350+
"integer",
7351+
"null"
7352+
],
7353+
"minimum": 0
7354+
},
7355+
"periodSeconds": {
7356+
"type": [
7357+
"integer",
7358+
"null"
7359+
],
7360+
"minimum": 1
7361+
},
7362+
"successThreshold": {
7363+
"type": [
7364+
"integer",
7365+
"null"
7366+
],
7367+
"minimum": 1
7368+
},
7369+
"timeoutSeconds": {
7370+
"type": [
7371+
"integer",
7372+
"null"
7373+
],
7374+
"minimum": 1
7375+
}
7376+
},
7377+
"additionalProperties": false
7378+
}
7379+
},
7380+
"type": "object",
7381+
"additionalProperties": false
7382+
},
71077383
"event-creator": {
71087384
"required": [
71097385
"replicas"

0 commit comments

Comments
 (0)