Document that most streams can only have a single writer. (#12196)

This includes the `typing`, `to_device`, `account_data`, `receipts`, and `presence`
streams (really anything except the `events` stream).
This commit is contained in:
~creme 2022-03-10 19:15:19 +01:00 committed by GitHub
parent ed9aea42fa
commit 7577894bec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 14 deletions

1
changelog.d/12196.doc Normal file
View file

@ -0,0 +1 @@
Document that the `typing`, `to_device`, `account_data`, `receipts`, and `presence` stream writer can only be used on a single worker.

View file

@ -351,8 +351,11 @@ is only supported with Redis-based replication.)
To enable this, the worker must have a HTTP replication listener configured, To enable this, the worker must have a HTTP replication listener configured,
have a `worker_name` and be listed in the `instance_map` config. The same worker have a `worker_name` and be listed in the `instance_map` config. The same worker
can handle multiple streams. For example, to move event persistence off to a can handle multiple streams, but unless otherwise documented, each stream can only
dedicated worker, the shared configuration would include: have a single writer.
For example, to move event persistence off to a dedicated worker, the shared
configuration would include:
```yaml ```yaml
instance_map: instance_map:
@ -370,8 +373,8 @@ streams and the endpoints associated with them:
##### The `events` stream ##### The `events` stream
The `events` stream also experimentally supports having multiple writers, where The `events` stream experimentally supports having multiple writers, where work
work is sharded between them by room ID. Note that you *must* restart all worker is sharded between them by room ID. Note that you *must* restart all worker
instances when adding or removing event persisters. An example `stream_writers` instances when adding or removing event persisters. An example `stream_writers`
configuration with multiple writers: configuration with multiple writers:
@ -384,38 +387,38 @@ stream_writers:
##### The `typing` stream ##### The `typing` stream
The following endpoints should be routed directly to the workers configured as The following endpoints should be routed directly to the worker configured as
stream writers for the `typing` stream: the stream writer for the `typing` stream:
^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/typing ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/typing
##### The `to_device` stream ##### The `to_device` stream
The following endpoints should be routed directly to the workers configured as The following endpoints should be routed directly to the worker configured as
stream writers for the `to_device` stream: the stream writer for the `to_device` stream:
^/_matrix/client/(api/v1|r0|v3|unstable)/sendToDevice/ ^/_matrix/client/(api/v1|r0|v3|unstable)/sendToDevice/
##### The `account_data` stream ##### The `account_data` stream
The following endpoints should be routed directly to the workers configured as The following endpoints should be routed directly to the worker configured as
stream writers for the `account_data` stream: the stream writer for the `account_data` stream:
^/_matrix/client/(api/v1|r0|v3|unstable)/.*/tags ^/_matrix/client/(api/v1|r0|v3|unstable)/.*/tags
^/_matrix/client/(api/v1|r0|v3|unstable)/.*/account_data ^/_matrix/client/(api/v1|r0|v3|unstable)/.*/account_data
##### The `receipts` stream ##### The `receipts` stream
The following endpoints should be routed directly to the workers configured as The following endpoints should be routed directly to the worker configured as
stream writers for the `receipts` stream: the stream writer for the `receipts` stream:
^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/receipt ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/receipt
^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/read_markers ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/read_markers
##### The `presence` stream ##### The `presence` stream
The following endpoints should be routed directly to the workers configured as The following endpoints should be routed directly to the worker configured as
stream writers for the `presence` stream: the stream writer for the `presence` stream:
^/_matrix/client/(api/v1|r0|v3|unstable)/presence/ ^/_matrix/client/(api/v1|r0|v3|unstable)/presence/