MatrixSynapse/synapse/config
Erik Johnston 5c9e39e619
Track device list updates per room. (#12321)
This is a first step in dealing with #7721.

The idea is basically that rather than calculating the full set of users a device list update needs to be sent to up front, we instead simply record the rooms the user was in at the time of the change. This will allow a few things:

1. we can defer calculating the set of remote servers that need to be poked about the change; and
2. during `/sync` and `/keys/changes` we can avoid also avoid calculating users who share rooms with other users, and instead just look at the rooms that have changed.

However, care needs to be taken to correctly handle server downgrades. As such this PR writes to both `device_lists_changes_in_room` and the `device_lists_outbound_pokes` table synchronously. In a future release we can then bump the database schema compat version to `69` and then we can assume that the new `device_lists_changes_in_room` exists and is handled.

There is a temporary option to disable writing to `device_lists_outbound_pokes` synchronously, allowing us to test the new code path does work (and by implication upgrading to a future release and downgrading to this one will work correctly).

Note: Ideally we'd do the calculation of room to servers on a worker (e.g. the background worker), but currently only master can write to the `device_list_outbound_pokes` table.
2022-04-04 15:25:20 +01:00
..
__init__.py
__main__.py
_base.py
_base.pyi
_util.py
account_validity.py
api.py
appservice.py
auth.py
background_updates.py
cache.py
captcha.py
cas.py
consent.py
database.py
emailconfig.py
experimental.py
federation.py
groups.py
homeserver.py
jwt.py
key.py
logger.py
metrics.py
modules.py
oembed.py
oidc.py
password_auth_providers.py
push.py
ratelimiting.py
redis.py
registration.py
repository.py
retention.py
room.py
room_directory.py
saml2.py
server.py Track device list updates per room. (#12321) 2022-04-04 15:25:20 +01:00
server_notices.py
spam_checker.py
sso.py
stats.py
third_party_event_rules.py
tls.py
tracer.py
user_directory.py
voip.py
workers.py