mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
52a50e8686
Currently when using multiple event persisters we (in the worst case) don't tell clients about events until all event persisters have persisted new events after the original event. This is a suboptimal, especially if one of the event persisters goes down. To handle this, we encode the position of each event persister in the room tokens so that we can send events to clients immediately. To reduce the size of the token we do two things: 1. We create a unique immutable persistent mapping between instance names and a generated small integer ID, which we can encode in the tokens instead of the instance name; and 2. We encode the "persisted upto position" of the room token and then only explicitly include instances that have positions strictly greater than that. The new tokens look something like: `m3478~1.3488~2.3489`, where the first number is the min position, and the subsequent `-` separated pairs are the instance ID to positions map. (We use `.` and `~` as separators as they're URL safe and not already used by `StreamToken`). |
||
---|---|---|
.. | ||
02remove_dup_outbound_pokes.sql | ||
03persist_ui_auth.sql | ||
05cache_instance.sql.postgres | ||
06dlols_unique_idx.py | ||
07add_method_to_thumbnail_constraint.sql.postgres | ||
07add_method_to_thumbnail_constraint.sql.sqlite | ||
07persist_ui_auth_ips.sql | ||
08_media_safe_from_quarantine.sql.postgres | ||
08_media_safe_from_quarantine.sql.sqlite | ||
09shadow_ban.sql | ||
10_pushrules_enabled_delete_obsolete.sql | ||
10drop_local_rejections_stream.sql | ||
10federation_pos_instance_name.sql | ||
11dehydration.sql | ||
11fallback.sql | ||
11user_id_seq.py | ||
12room_stats.sql | ||
13remove_presence_allow_inbound.sql | ||
14events_instance_name.sql | ||
14events_instance_name.sql.postgres | ||
15_catchup_destination_rooms.sql | ||
15unread_count.sql | ||
16populate_stats_process_rooms_fix.sql | ||
17_catchup_last_successful.sql | ||
18stream_positions.sql | ||
19instance_map.sql.postgres |