Skip to content

Commit 0259329

Browse files
committed
Introduce a device lists worker for Synapse
As per element-hq/synapse#18581
1 parent 4b4384d commit 0259329

File tree

10 files changed

+357
-1
lines changed

10 files changed

+357
-1
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
@@ -12,6 +12,8 @@ synapse:
1212
enabled: true
1313
client-reader:
1414
enabled: true
15+
device-lists:
16+
enabled: true
1517
encryption:
1618
enabled: true
1719
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
@@ -27,6 +27,8 @@ synapse:
2727
enabled: true
2828
client-reader:
2929
enabled: true
30+
device-lists:
31+
enabled: true
3032
encryption:
3133
enabled: true
3234
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
@@ -199,6 +199,9 @@
199199
"encryption": {
200200
"$ref": "file://synapse/single_worker.json"
201201
},
202+
"device-lists": {
203+
"$ref": "file://synapse/scalable_worker.json"
204+
},
202205
"event-creator": {
203206
"$ref": "file://synapse/scalable_worker.json"
204207
},

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

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

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ SPDX-License-Identifier: AGPL-3.0-only
1010
{{ $hasHttp := (list "main"
1111
"account-data"
1212
"client-reader"
13+
"device-lists"
1314
"encryption"
1415
"event-creator"
1516
"federation-inbound"
@@ -35,6 +36,7 @@ hasHttp
3536
{{- with required "element-io.synapse.process.hasReplication missing context" .context -}}
3637
{{- $hasReplication := (list "main"
3738
"account-data"
39+
"device-lists"
3840
"encryption"
3941
"event-persister"
4042
"push-rules"
@@ -134,6 +136,8 @@ responsibleForMedia
134136
{{- with required "element-io.synapse.process.streamWriters missing context" .context -}}
135137
{{- if eq . "account-data" }}
136138
{{ list "account_data" | toJson }}
139+
{{- else if eq . "device-lists" }}
140+
{{ list "device_lists" | toJson }}
137141
{{- else if eq . "encryption" }}
138142
{{ list "to_device" | toJson }}
139143
{{- else if eq . "event-persister" }}
@@ -293,7 +297,16 @@ responsibleForMedia
293297
{{ $workerPaths = concat $workerPaths (list
294298
"^/_matrix/client/(r0|v3|unstable)/keys/claim$"
295299
"^/_matrix/client/(r0|v3|unstable)/room_keys/"
300+
) }}
301+
{{- end }}
302+
303+
{{- if eq .workerType "device-lists" }}
304+
{{ $workerPaths = concat $workerPaths (list
305+
"^/_matrix/client/(r0|v3)/delete_devices$"
306+
"^/_matrix/client/(api/v1|r0|v3|unstable)/devices(/|$)"
296307
"^/_matrix/client/(r0|v3|unstable)/keys/upload"
308+
"^/_matrix/client/(api/v1|r0|v3|unstable)/keys/device_signing/upload$"
309+
"^/_matrix/client/(api/v1|r0|v3|unstable)/keys/signatures/upload$"
297310
) }}
298311
{{- end }}
299312

charts/matrix-stack/values.schema.json

Lines changed: 276 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7270,6 +7270,282 @@
72707270
"type": "object",
72717271
"additionalProperties": false
72727272
},
7273+
"device-lists": {
7274+
"required": [
7275+
"replicas"
7276+
],
7277+
"properties": {
7278+
"enabled": {
7279+
"type": "boolean"
7280+
},
7281+
"replicas": {
7282+
"type": "integer",
7283+
"minimum": 1
7284+
},
7285+
"resources": {
7286+
"properties": {
7287+
"limits": {
7288+
"additionalProperties": {
7289+
"anyOf": [
7290+
{
7291+
"type": "integer"
7292+
},
7293+
{
7294+
"type": "string"
7295+
}
7296+
],
7297+
"pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
7298+
},
7299+
"type": "object"
7300+
},
7301+
"requests": {
7302+
"additionalProperties": {
7303+
"anyOf": [
7304+
{
7305+
"type": "integer"
7306+
},
7307+
{
7308+
"type": "string"
7309+
}
7310+
],
7311+
"pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
7312+
},
7313+
"type": "object"
7314+
}
7315+
},
7316+
"type": "object",
7317+
"additionalProperties": false
7318+
},
7319+
"topologySpreadConstraints": {
7320+
"type": "array",
7321+
"items": {
7322+
"required": [
7323+
"maxSkew",
7324+
"topologyKey"
7325+
],
7326+
"properties": {
7327+
"labelSelector": {
7328+
"type": "object",
7329+
"properties": {
7330+
"matchExpressions": {
7331+
"type": "array",
7332+
"items": {
7333+
"type": "object",
7334+
"required": [
7335+
"key",
7336+
"operator"
7337+
],
7338+
"properties": {
7339+
"key": {
7340+
"type": "string"
7341+
},
7342+
"operator": {
7343+
"type": "string",
7344+
"enum": [
7345+
"In",
7346+
"NotIn",
7347+
"Exists",
7348+
"DoesNotExist"
7349+
]
7350+
},
7351+
"values": {
7352+
"type": "array",
7353+
"items": {
7354+
"type": "string"
7355+
}
7356+
}
7357+
},
7358+
"additionalProperties": false
7359+
}
7360+
},
7361+
"matchLabels": {
7362+
"type": [
7363+
"object",
7364+
"null"
7365+
],
7366+
"additionalProperties": {
7367+
"type": [
7368+
"string",
7369+
"null"
7370+
]
7371+
}
7372+
}
7373+
},
7374+
"additionalProperties": false
7375+
},
7376+
"matchLabelKeys": {
7377+
"type": [
7378+
"array",
7379+
"null"
7380+
],
7381+
"items": {
7382+
"type": "string"
7383+
}
7384+
},
7385+
"maxSkew": {
7386+
"type": "integer",
7387+
"minium": 1
7388+
},
7389+
"minDomains": {
7390+
"type": "integer",
7391+
"minium": 0
7392+
},
7393+
"nodeAffinityPolicy": {
7394+
"type": "string",
7395+
"enum": [
7396+
"Honor",
7397+
"Ignore"
7398+
]
7399+
},
7400+
"nodeTaintsPolicy": {
7401+
"type": "string",
7402+
"enum": [
7403+
"Honor",
7404+
"Ignore"
7405+
]
7406+
},
7407+
"topologyKey": {
7408+
"type": "string"
7409+
},
7410+
"whenUnsatisfiable": {
7411+
"type": "string",
7412+
"enum": [
7413+
"DoNotSchedule",
7414+
"ScheduleAnyway"
7415+
]
7416+
}
7417+
},
7418+
"type": "object",
7419+
"additionalProperties": false
7420+
}
7421+
},
7422+
"livenessProbe": {
7423+
"type": "object",
7424+
"properties": {
7425+
"failureThreshold": {
7426+
"type": [
7427+
"integer",
7428+
"null"
7429+
],
7430+
"minimum": 1
7431+
},
7432+
"initialDelaySeconds": {
7433+
"type": [
7434+
"integer",
7435+
"null"
7436+
],
7437+
"minimum": 0
7438+
},
7439+
"periodSeconds": {
7440+
"type": [
7441+
"integer",
7442+
"null"
7443+
],
7444+
"minimum": 1
7445+
},
7446+
"successThreshold": {
7447+
"type": [
7448+
"integer",
7449+
"null"
7450+
],
7451+
"minimum": 1
7452+
},
7453+
"timeoutSeconds": {
7454+
"type": [
7455+
"integer",
7456+
"null"
7457+
],
7458+
"minimum": 1
7459+
}
7460+
},
7461+
"additionalProperties": false
7462+
},
7463+
"readinessProbe": {
7464+
"type": "object",
7465+
"properties": {
7466+
"failureThreshold": {
7467+
"type": [
7468+
"integer",
7469+
"null"
7470+
],
7471+
"minimum": 1
7472+
},
7473+
"initialDelaySeconds": {
7474+
"type": [
7475+
"integer",
7476+
"null"
7477+
],
7478+
"minimum": 0
7479+
},
7480+
"periodSeconds": {
7481+
"type": [
7482+
"integer",
7483+
"null"
7484+
],
7485+
"minimum": 1
7486+
},
7487+
"successThreshold": {
7488+
"type": [
7489+
"integer",
7490+
"null"
7491+
],
7492+
"minimum": 1
7493+
},
7494+
"timeoutSeconds": {
7495+
"type": [
7496+
"integer",
7497+
"null"
7498+
],
7499+
"minimum": 1
7500+
}
7501+
},
7502+
"additionalProperties": false
7503+
},
7504+
"startupProbe": {
7505+
"type": "object",
7506+
"properties": {
7507+
"failureThreshold": {
7508+
"type": [
7509+
"integer",
7510+
"null"
7511+
],
7512+
"minimum": 1
7513+
},
7514+
"initialDelaySeconds": {
7515+
"type": [
7516+
"integer",
7517+
"null"
7518+
],
7519+
"minimum": 0
7520+
},
7521+
"periodSeconds": {
7522+
"type": [
7523+
"integer",
7524+
"null"
7525+
],
7526+
"minimum": 1
7527+
},
7528+
"successThreshold": {
7529+
"type": [
7530+
"integer",
7531+
"null"
7532+
],
7533+
"minimum": 1
7534+
},
7535+
"timeoutSeconds": {
7536+
"type": [
7537+
"integer",
7538+
"null"
7539+
],
7540+
"minimum": 1
7541+
}
7542+
},
7543+
"additionalProperties": false
7544+
}
7545+
},
7546+
"type": "object",
7547+
"additionalProperties": false
7548+
},
72737549
"event-creator": {
72747550
"required": [
72757551
"replicas"

0 commit comments

Comments
 (0)