Skip to content

Commit bcbfb7f

Browse files
committed
Synapse: fix requests being routed to initial-synchrotron incorrectly
1 parent 2975fa1 commit bcbfb7f

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

charts/matrix-stack/configs/synapse/partial-haproxy.cfg.tpl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,18 @@ frontend synapse-http-in
7474
http-request set-var(req.backend) path,map_reg(/synapse/path_map_file,main) unless { var(req.backend) -m found }
7575
{{- if dig "initial-synchrotron" "enabled" false .workers }}
7676

77-
acl is_initial_sync path -m reg ^/_matrix/client/(api/v1|r0|v3)/initialSync$
78-
acl is_initial_sync path -m reg ^/_matrix/client/(api/v1|r0|v3)/rooms/[^/]+/initialSync$
79-
# https://spec.matrix.org/v1.14/client-server-api/#get_matrixclientv3sync
80-
acl is_initial_sync path -m reg ^/_matrix/client/(r0|v3)/sync$ { urlp("full_state") -m str true }
81-
acl is_initial_sync path -m reg ^/_matrix/client/(r0|v3)/sync$ !{ urlp("since") -m found }
82-
# https://spec.matrix.org/latest/client-server-api/#get_matrixclientv3events
83-
acl is_initial_sync path -m reg ^/_matrix/client/(api/v1|r0|v3)/events$ !{ urlp("from") -m found }
77+
acl has_available_initial_syncs nbsrv('synapse-initial-synchrotron') ge 1
8478

8579
# Set to the initial-synchrotron backend if it is one of these magic paths AND we have workers in the initial-synchrotron backend
8680
# This means that we don't update the backend from synchrotron if that's configured but there's no initial-synchrotron servers available
8781
# And then can it fallback to main if there are no synchrotron servers either
88-
http-request set-var(req.backend) str('initial-synchrotron') if is_initial_sync { nbsrv('synapse-initial-synchrotron') ge 1 }
82+
http-request set-var(req.backend) str('initial-synchrotron') if has_available_initial_syncs { path -m reg ^/_matrix/client/(api/v1|r0|v3)/initialSync$ }
83+
http-request set-var(req.backend) str('initial-synchrotron') if has_available_initial_syncs { path -m reg ^/_matrix/client/(api/v1|r0|v3)/rooms/[^/]+/initialSync$ }
84+
# https://spec.matrix.org/v1.14/client-server-api/#get_matrixclientv3sync
85+
http-request set-var(req.backend) str('initial-synchrotron') if has_available_initial_syncs { path -m reg ^/_matrix/client/(r0|v3)/sync$ } { urlp("full_state") -m str true }
86+
http-request set-var(req.backend) str('initial-synchrotron') if has_available_initial_syncs { path -m reg ^/_matrix/client/(r0|v3)/sync$ } !{ urlp("since") -m found }
87+
# https://spec.matrix.org/latest/client-server-api/#get_matrixclientv3events
88+
http-request set-var(req.backend) str('initial-synchrotron') if has_available_initial_syncs { path -m reg ^/_matrix/client/(api/v1|r0|v3)/events$ } !{ urlp("from") -m found }
8989
{{- end }}
9090

9191
{{- if include "element-io.matrix-authentication-service.readyToHandleAuth" (dict "root" $root) }}

newsfragments/632.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Synapse: fix requests being routed to initial-synchrotron incorrectly.

0 commit comments

Comments
 (0)