anonymousland-synapse/synapse/storage/databases/main/schema/delta/58
Erik Johnston 52a50e8686
Use vector clocks for room stream tokens. (#8439)
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`).
2020-10-07 15:15:33 +01:00
..
02remove_dup_outbound_pokes.sql Rename database classes to make some sense (#8033) 2020-08-05 21:38:57 +01:00
03persist_ui_auth.sql Rename database classes to make some sense (#8033) 2020-08-05 21:38:57 +01:00
05cache_instance.sql.postgres Rename database classes to make some sense (#8033) 2020-08-05 21:38:57 +01:00
06dlols_unique_idx.py Rename database classes to make some sense (#8033) 2020-08-05 21:38:57 +01:00
07add_method_to_thumbnail_constraint.sql.postgres Include method in thumbnail media name (#7124) 2020-09-08 17:19:50 +01:00
07add_method_to_thumbnail_constraint.sql.sqlite Include method in thumbnail media name (#7124) 2020-09-08 17:19:50 +01:00
07persist_ui_auth_ips.sql Allow denying or shadow banning registrations via the spam checker (#8034) 2020-08-20 15:42:58 -04:00
08_media_safe_from_quarantine.sql.postgres Rename database classes to make some sense (#8033) 2020-08-05 21:38:57 +01:00
08_media_safe_from_quarantine.sql.sqlite Rename database classes to make some sense (#8033) 2020-08-05 21:38:57 +01:00
09shadow_ban.sql Add a shadow-banned flag to users. (#8092) 2020-08-14 12:37:59 -04:00
10_pushrules_enabled_delete_obsolete.sql Don't remember enabled of deleted push rules and properly return 404 for missing push rules in .../actions and .../enabled (#7796) 2020-09-09 11:39:39 +01:00
10drop_local_rejections_stream.sql Rename database classes to make some sense (#8033) 2020-08-05 21:38:57 +01:00
10federation_pos_instance_name.sql Rename database classes to make some sense (#8033) 2020-08-05 21:38:57 +01:00
11dehydration.sql Add support for MSC2697: Dehydrated devices (#8380) 2020-10-07 08:00:17 -04:00
11fallback.sql Add support for MSC2732: olm fallback keys (#8312) 2020-10-06 13:26:29 -04:00
11user_id_seq.py Rename database classes to make some sense (#8033) 2020-08-05 21:38:57 +01:00
12room_stats.sql Rename database classes to make some sense (#8033) 2020-08-05 21:38:57 +01:00
13remove_presence_allow_inbound.sql Remove some unused database functions. (#8085) 2020-08-14 09:25:40 -04:00
14events_instance_name.sql Add experimental support for sharding event persister. Again. (#8294) 2020-09-14 10:16:41 +01:00
14events_instance_name.sql.postgres Fix schema delta for servers that have not backfilled (#8396) 2020-09-25 09:58:32 +01:00
15_catchup_destination_rooms.sql In light of #8255, use BIGINTs for destination_rooms (#8256) 2020-09-04 15:07:29 +01:00
15unread_count.sql Unread counts fixes (#8254) 2020-09-04 14:14:22 +01:00
16populate_stats_process_rooms_fix.sql Rename 'populate_stats_process_rooms_2' background job back to 'populate_stats_process_rooms' again (#8243) 2020-09-08 11:05:59 +01:00
17_catchup_last_successful.sql Catch up after Federation Outage (split, 2): Track last successful stream ordering after transmission (#8247) 2020-09-04 15:06:51 +01:00
18stream_positions.sql Fix MultiWriteIdGenerator's handling of restarts. (#8374) 2020-09-24 16:53:51 +01:00
19instance_map.sql.postgres Use vector clocks for room stream tokens. (#8439) 2020-10-07 15:15:33 +01:00