Skip to content

Commit 8b2950a

Browse files
authored
Merge pull request #640 from element-hq/bbz/split-accounts-and-receipts-workers
Split account-data and receipts workers
2 parents 725c4b9 + 0670c47 commit 8b2950a

File tree

10 files changed

+378
-23
lines changed

10 files changed

+378
-23
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
synapse:
66
workers:
7+
account-data:
8+
enabled: true
79
appservice:
810
enabled: true
911
background:
@@ -34,7 +36,7 @@ synapse:
3436
pusher:
3537
enabled: true
3638
replicas: 2
37-
receipts-account:
39+
receipts:
3840
enabled: true
3941
sliding-sync:
4042
enabled: true

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ synapse:
1919
ingress:
2020
host: synapse.ess.localhost
2121
workers:
22+
account-data:
23+
enabled: true
2224
appservice:
2325
enabled: true
2426
background:
@@ -49,7 +51,7 @@ synapse:
4951
pusher:
5052
enabled: true
5153
replicas: 2
52-
receipts-account:
54+
receipts:
5355
enabled: true
5456
sliding-sync:
5557
enabled: true

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ workers instead if these requests path are under high load.
1818
# push-rules
1919
^/\_matrix/client/(api/v1|r0|v3|unstable)/pushrules/
2020
21-
# receipts-account
21+
# account-data
2222
^/\_matrix/client/(r0|v3|unstable)/._/tags
2323
^/\_matrix/client/(r0|v3|unstable)/._/account\_data
2424

charts/matrix-stack/source/synapse.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@
184184
"workers": {
185185
"type": "object",
186186
"properties": {
187+
"account-data": {
188+
"$ref": "file://synapse/single_worker.json"
189+
},
187190
"appservice": {
188191
"$ref": "file://synapse/single_worker.json"
189192
},
@@ -226,8 +229,8 @@
226229
"pusher": {
227230
"$ref": "file://synapse/scalable_worker.json"
228231
},
229-
"receipts-account": {
230-
"$ref": "file://synapse/single_worker.json"
232+
"receipts": {
233+
"$ref": "file://synapse/scalable_worker.json"
231234
},
232235
"sliding-sync": {
233236
"$ref": "file://synapse/scalable_worker.json"

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ appservices: []
5151
## event-creator:
5252
## enabled: true
5353
workers:
54+
{{- synapse_sub_schema_values.single_worker('account-data') | indent(2) }}
5455
{{- synapse_sub_schema_values.single_worker('appservice') | indent(2) }}
5556
{{- synapse_sub_schema_values.single_worker('background') | indent(2) }}
5657
{{- synapse_sub_schema_values.scalable_worker('client-reader') | indent(2) }}
@@ -65,7 +66,7 @@ workers:
6566
{{- synapse_sub_schema_values.single_worker('presence-writer') | indent(2) }}
6667
{{- synapse_sub_schema_values.single_worker('push-rules') | indent(2) }}
6768
{{- synapse_sub_schema_values.scalable_worker('pusher') | indent(2) }}
68-
{{- synapse_sub_schema_values.single_worker('receipts-account') | indent(2) }}
69+
{{- synapse_sub_schema_values.scalable_worker('receipts') | indent(2) }}
6970
{{- synapse_sub_schema_values.scalable_worker('sliding-sync') | indent(2) }}
7071
{{- synapse_sub_schema_values.single_worker('sso-login') | indent(2) }}
7172
{{- synapse_sub_schema_values.scalable_worker('synchrotron') | indent(2) }}

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

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ SPDX-License-Identifier: AGPL-3.0-only
88
{{- $root := .root -}}
99
{{- with required "element-io.synapse.process.hasHttp missing context" .context -}}
1010
{{ $hasHttp := (list "main"
11+
"account-data"
1112
"client-reader"
1213
"encryption"
1314
"event-creator"
@@ -17,7 +18,7 @@ SPDX-License-Identifier: AGPL-3.0-only
1718
"media-repository"
1819
"presence-writer"
1920
"push-rules"
20-
"receipts-account"
21+
"receipts"
2122
"sliding-sync"
2223
"sso-login"
2324
"synchrotron"
@@ -33,11 +34,12 @@ hasHttp
3334
{{- $root := .root -}}
3435
{{- with required "element-io.synapse.process.hasReplication missing context" .context -}}
3536
{{- $hasReplication := (list "main"
37+
"account-data"
3638
"encryption"
3739
"event-persister"
3840
"push-rules"
3941
"presence-writer"
40-
"receipts-account"
42+
"receipts"
4143
"typing-persister") }}
4244
{{- if has . $hasReplication -}}
4345
hasReplication
@@ -49,13 +51,14 @@ hasReplication
4951
{{- $root := .root -}}
5052
{{- with required "element-io.synapse.process.isSingle missing context" .context -}}
5153
{{ $isSingle := (list "main"
54+
"account-data"
5255
"appservice"
5356
"background"
5457
"encryption"
5558
"media-repository"
5659
"presence-writer"
5760
"push-rules"
58-
"receipts-account"
61+
"receipts"
5962
"sso-login"
6063
"typing-persister"
6164
"user-dir") }}
@@ -92,8 +95,6 @@ initial-sync
9295
media-repo
9396
{{- else if eq . "presence-writer" -}}
9497
presence-write
95-
{{- else if eq . "receipts-account" -}}
96-
receipts-accnt
9798
{{- else if eq . "typing-persister" -}}
9899
typing
99100
{{- else -}}
@@ -131,16 +132,18 @@ responsibleForMedia
131132
{{- define "element-io.synapse.process.streamWriters" -}}
132133
{{- $root := .root -}}
133134
{{- with required "element-io.synapse.process.streamWriters missing context" .context -}}
134-
{{- if eq . "encryption" }}
135+
{{- if eq . "account-data" }}
136+
{{ list "account_data" | toJson }}
137+
{{- else if eq . "encryption" }}
135138
{{ list "to_device" | toJson }}
136139
{{- else if eq . "event-persister" }}
137140
{{ list "events" | toJson }}
138141
{{- else if eq . "presence-writer" }}
139142
{{ list "presence" | toJson }}
140143
{{- else if eq . "push-rules" }}
141144
{{ list "push_rules" | toJson }}
142-
{{- else if eq . "receipts-account" }}
143-
{{ list "account_data" "receipts" | toJson }}
145+
{{- else if eq . "receipts" }}
146+
{{ list "receipts" | toJson }}
144147
{{- else if eq . "typing-persister" }}
145148
{{ list "typing" | toJson }}
146149
{{- else -}}
@@ -225,6 +228,13 @@ responsibleForMedia
225228
{{- with required "element-io.synapse.process.workerPaths missing context" .context -}}
226229
{{ $workerPaths := list }}
227230

231+
{{- if eq .workerType "account-data" }}
232+
{{ $workerPaths = concat $workerPaths (list
233+
"^/_matrix/client/(r0|v3|unstable)/.*/tags"
234+
"^/_matrix/client/(r0|v3|unstable)/.*/account_data"
235+
) }}
236+
{{- end }}
237+
228238
{{- if eq .workerType "client-reader" }}
229239
{{- /* Client API requests (apart from createRoom which is eventCreator) */}}
230240
{{ $workerPaths = concat $workerPaths (list
@@ -374,10 +384,8 @@ responsibleForMedia
374384
) }}
375385
{{- end }}
376386
377-
{{- if eq .workerType "receipts-account" }}
387+
{{- if eq .workerType "receipts" }}
378388
{{ $workerPaths = concat $workerPaths (list
379-
"^/_matrix/client/(r0|v3|unstable)/.*/tags"
380-
"^/_matrix/client/(r0|v3|unstable)/.*/account_data"
381389
"^/_matrix/client/(r0|v3|unstable)/rooms/.*/receipt"
382390
"^/_matrix/client/(r0|v3|unstable)/rooms/.*/read_markers"
383391
) }}

0 commit comments

Comments
 (0)