Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 7577894

Browse files
authored
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).
1 parent ed9aea4 commit 7577894

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

changelog.d/12196.doc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Document that the `typing`, `to_device`, `account_data`, `receipts`, and `presence` stream writer can only be used on a single worker.

docs/workers.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,11 @@ is only supported with Redis-based replication.)
351351

352352
To enable this, the worker must have a HTTP replication listener configured,
353353
have a `worker_name` and be listed in the `instance_map` config. The same worker
354-
can handle multiple streams. For example, to move event persistence off to a
355-
dedicated worker, the shared configuration would include:
354+
can handle multiple streams, but unless otherwise documented, each stream can only
355+
have a single writer.
356+
357+
For example, to move event persistence off to a dedicated worker, the shared
358+
configuration would include:
356359

357360
```yaml
358361
instance_map:
@@ -370,8 +373,8 @@ streams and the endpoints associated with them:
370373

371374
##### The `events` stream
372375

373-
The `events` stream also experimentally supports having multiple writers, where
374-
work is sharded between them by room ID. Note that you *must* restart all worker
376+
The `events` stream experimentally supports having multiple writers, where work
377+
is sharded between them by room ID. Note that you *must* restart all worker
375378
instances when adding or removing event persisters. An example `stream_writers`
376379
configuration with multiple writers:
377380

@@ -384,38 +387,38 @@ stream_writers:
384387

385388
##### The `typing` stream
386389

387-
The following endpoints should be routed directly to the workers configured as
388-
stream writers for the `typing` stream:
390+
The following endpoints should be routed directly to the worker configured as
391+
the stream writer for the `typing` stream:
389392

390393
^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/typing
391394

392395
##### The `to_device` stream
393396

394-
The following endpoints should be routed directly to the workers configured as
395-
stream writers for the `to_device` stream:
397+
The following endpoints should be routed directly to the worker configured as
398+
the stream writer for the `to_device` stream:
396399

397400
^/_matrix/client/(api/v1|r0|v3|unstable)/sendToDevice/
398401

399402
##### The `account_data` stream
400403

401-
The following endpoints should be routed directly to the workers configured as
402-
stream writers for the `account_data` stream:
404+
The following endpoints should be routed directly to the worker configured as
405+
the stream writer for the `account_data` stream:
403406

404407
^/_matrix/client/(api/v1|r0|v3|unstable)/.*/tags
405408
^/_matrix/client/(api/v1|r0|v3|unstable)/.*/account_data
406409

407410
##### The `receipts` stream
408411

409-
The following endpoints should be routed directly to the workers configured as
410-
stream writers for the `receipts` stream:
412+
The following endpoints should be routed directly to the worker configured as
413+
the stream writer for the `receipts` stream:
411414

412415
^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/receipt
413416
^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/read_markers
414417

415418
##### The `presence` stream
416419

417-
The following endpoints should be routed directly to the workers configured as
418-
stream writers for the `presence` stream:
420+
The following endpoints should be routed directly to the worker configured as
421+
the stream writer for the `presence` stream:
419422

420423
^/_matrix/client/(api/v1|r0|v3|unstable)/presence/
421424

0 commit comments

Comments
 (0)