forked-synapse/synapse/storage/schema/main/delta
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
..
12
13
14
15
16
17
18
19
20
21
22
24
25
26
27
28
29
30 Remove unnecessary pass statements. (#12206) 2022-03-11 07:06:21 -05:00
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57 Use direct references for some configuration variables (#10798) 2021-09-13 13:07:12 -04:00
58
59 Merge branch 'release-v1.37' into develop 2021-06-29 20:25:47 +01:00
60 fix ordering of bg update (#10291) 2021-07-01 18:45:55 +01:00
61 Make historical events discoverable from backfill for servers without any scrollback history (MSC2716) (#10245) 2021-07-28 10:46:37 -05:00
62 Move the sessions delta to the latest schema version. (#10725) 2021-08-31 16:38:43 +00:00
63 Add a partial index to presence_stream to speed up startups (#10748) 2021-09-03 17:16:56 +01:00
64 Move sql file for remove_deleted_devices_from_device_inbox into v65 (#11303) 2021-11-15 11:47:30 +00:00
65 Save the OIDC session ID (sid) with the device on login (#11482) 2021-12-06 12:43:06 -05:00
67 Drop unused table public_room_list_stream. (#11795) 2022-01-21 09:19:56 +00:00
68 Send device list updates to application services (MSC3202) - part 1 (#11881) 2022-03-30 14:39:27 +01:00
69 Track device list updates per room. (#12321) 2022-04-04 15:25:20 +01:00