anonymousland-synapse/synapse/storage/data_stores/main
Erik Johnston 664409b169
Fix bug in account data replication stream. (#7656)
* Ensure account data stream IDs are unique.

The account data stream is shared between three tables, and the maximum
allocated ID was tracked in a dedicated table. Updating the max ID
happened outside the transaction that allocated the ID, leading to a
race where if the server was restarted then the same ID could be
allocated but the max ID failed to be updated, leading it to be reused.

The ID generators have support for tracking across multiple tables, so
we may as well use that instead of a dedicated table.

* Fix bug in account data replication stream.

If the same stream ID was used in both global and room account data then
the getting updates for the replication stream would fail due to
`heapq.merge(..)` trying to compare a `str` with a `None`. (This is
because you'd have two rows like `(534, '!room')` and `(534, None)` from
the room and global account data tables).

Fix is just to order by stream ID, since we don't rely on the ordering
beyond that. The bug where stream IDs can be reused should be fixed now,
so this case shouldn't happen going forward.

Fixes #7617
2020-06-09 16:28:57 +01:00
..
schema Replace device_27_unique_idx bg update with a fg one (#7562) 2020-05-26 11:43:17 +01:00
__init__.py Move event stream handling out of slave store. (#7491) 2020-05-15 16:43:59 +01:00
account_data.py Fix bug in account data replication stream. (#7656) 2020-06-09 16:28:57 +01:00
appservice.py Fix a couple of small typos 2020-05-15 18:54:32 +01:00
cache.py Move event stream handling out of slave store. (#7491) 2020-05-15 16:43:59 +01:00
censor_events.py Allow censoring of events to happen on workers. (#7492) 2020-05-13 17:15:40 +01:00
client_ips.py Allow configuration of Synapse's cache without using synctl or environment variables (#6391) 2020-05-11 18:45:23 +01:00
deviceinbox.py Move catchup of replication streams to worker. (#7024) 2020-03-25 14:54:01 +00:00
devices.py Replace device_27_unique_idx bg update with a fg one (#7562) 2020-05-26 11:43:17 +01:00
directory.py Transfer alias mappings when joining an upgraded room (#6946) 2020-03-30 17:53:25 +01:00
e2e_room_keys.py Ensure is_verified on /_matrix/client/r0/room_keys/keys is a boolean (#7150) 2020-03-27 13:30:22 +00:00
end_to_end_keys.py Make get_e2e_cross_signing_key delegate to get_e2e_cross_signing_keys_bulk 2020-05-06 11:59:19 +01:00
event_federation.py Shuffle persist event data store functions. (#7440) 2020-05-13 13:38:22 +01:00
event_push_actions.py Shuffle persist event data store functions. (#7440) 2020-05-13 13:38:22 +01:00
events_bg_updates.py Clarify list/set/dict/tuple comprehensions and enforce via flake8 (#6957) 2020-02-21 07:15:07 -05:00
events_worker.py Add option to move event persistence off master (#7517) 2020-05-22 16:11:35 +01:00
events.py Add option to move event persistence off master (#7517) 2020-05-22 16:11:35 +01:00
filtering.py Move DB pool and helper functions into dedicated Database class 2019-12-05 10:46:37 +00:00
group_server.py Prevent 0-member/null room_version rooms from appearing in group room queries (#7465) 2020-05-15 17:17:42 +01:00
keys.py remove builtins.buffer code from storage code 2020-05-15 19:37:41 +01:00
media_repository.py Convert delete_url_cache_media to async/await. (#7241) 2020-04-07 21:56:34 +01:00
metrics.py Shuffle persist event data store functions. (#7440) 2020-05-13 13:38:22 +01:00
monthly_active_users.py async/await get_user_id_by_threepid (#7620) 2020-06-03 17:15:57 +01:00
openid.py Move DB pool and helper functions into dedicated Database class 2019-12-05 10:46:37 +00:00
presence.py Remove concept of a non-limited stream. (#7011) 2020-03-20 14:40:47 +00:00
profile.py Fix a small typo in the arguments of simple_update in update_remote_profile_cache (#7511) 2020-05-15 16:17:12 +01:00
purge_events.py Shuffle persist event data store functions. (#7440) 2020-05-13 13:38:22 +01:00
push_rule.py Move event stream handling out of slave store. (#7491) 2020-05-15 16:43:59 +01:00
pusher.py Merge worker apps into one. (#6964) 2020-02-25 16:56:55 +00:00
receipts.py Use upsert when inserting read receipts (#7607) 2020-06-01 10:53:06 +01:00
registration.py async/await get_user_id_by_threepid (#7620) 2020-06-03 17:15:57 +01:00
rejections.py Shuffle persist event data store functions. (#7440) 2020-05-13 13:38:22 +01:00
relations.py Shuffle persist event data store functions. (#7440) 2020-05-13 13:38:22 +01:00
room.py Shuffle persist event data store functions. (#7440) 2020-05-13 13:38:22 +01:00
roommember.py Add option to move event persistence off master (#7517) 2020-05-22 16:11:35 +01:00
search.py Add a worker store for search insertion. (#7516) 2020-05-15 17:22:47 +01:00
signatures.py Shuffle persist event data store functions. (#7440) 2020-05-13 13:38:22 +01:00
state_deltas.py Always return a deferred from get_current_state_deltas. (#7019) 2020-03-02 16:52:15 +00:00
state.py remove to_ascii 2020-05-15 19:12:03 +01:00
stats.py Remove unused get_room_stats_state method. (#6869) 2020-02-07 15:30:26 +00:00
stream.py Remove stream before/after debug log lines (#7207) 2020-04-06 12:40:34 +01:00
tags.py Fix bug in account data replication stream. (#7656) 2020-06-09 16:28:57 +01:00
transactions.py remove builtins.buffer code from storage code 2020-05-15 19:37:41 +01:00
ui_auth.py Rework UI Auth session validation for registration (#7455) 2020-05-08 16:08:58 -04:00
user_directory.py Reduce amount of logging at INFO level. (#6862) 2020-02-06 13:31:05 +00:00
user_erasure_store.py Clarify list/set/dict/tuple comprehensions and enforce via flake8 (#6957) 2020-02-21 07:15:07 -05:00