summary refs log tree commit diff
path: root/synapse/replication/slave/storage/devices.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Use cache store remove base slaved (#13329)Nick Mills-Barrett2022-07-211-2/+1
| | | This comes from two identical definitions in each of the base stores, and means the base slaved store is now empty and can be removed.
* Revert "Make all `process_replication_rows` methods async (#13304)" (#13312)Erik Johnston2022-07-181-4/+2
| | | This reverts commit 5d4028f217f178fcd384d5bfddd92225b4e78c51.
* Make all `process_replication_rows` methods async (#13304)Nick Mills-Barrett2022-07-171-2/+4
| | | | | More prep work for asyncronous caching, also makes all process_replication_rows methods consistent (presence handler already is so). Signed off by Nick @ Beeper (@Fizzadar)
* Type annotations in `synapse.databases.main.devices` (#13025)David Robertson2022-06-151-2/+1
| | | Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
* Prefill more stream change caches. (#12372)Erik Johnston2022-04-051-23/+2
|
* Prefill the device_list_stream_cache (#12367)Erik Johnston2022-04-041-1/+11
| | | | | | | * Prefill the device_list_stream_cache * Newsfile * Newsfile
* Track device list updates per room. (#12321)Erik Johnston2022-04-041-0/+1
| | | | | | | | | | | | | | 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.
* Add missing type hints to synapse.replication. (#11938)Patrick Cloke2022-02-081-3/+7
|
* Type hint the constructors of the data store classes (#11555)Sean Quah2021-12-131-2/+7
|
* Add type hints for most `HomeServer` parameters (#11095)Sean Quah2021-10-221-1/+6
|
* Combine `LruCache.invalidate` and `invalidate_many` (#9973)Richard van der Hoff2021-05-271-1/+1
| | | | | | | | | | * Make `invalidate` and `invalidate_many` do the same thing ... so that we can do either over the invalidation replication stream, and also because they always confused me a bit. * Kill off `invalidate_many` * changelog
* Remove redundant "coding: utf-8" lines (#9786)Jonathan de Jong2021-04-141-1/+0
| | | | | | | Part of #9744 Removes all redundant `# -*- coding: utf-8 -*-` lines from files, as python 3 automatically reads source code as utf-8 now. `Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>`
* Simplify super() calls to Python 3 syntax. (#8344)Patrick Cloke2020-09-181-1/+1
| | | | | | | This converts calls like super(Foo, self) -> super(). Generated with: sed -i "" -Ee 's/super\([^\(]+\)/super()/g' **/*.py
* Move and rename `get_devices_with_keys_by_user` (#8204)Richard van der Hoff2020-09-011-0/+3
| | | | | | | | | | | | | | | | | | * Move `get_devices_with_keys_by_user` to `EndToEndKeyWorkerStore` this seems a better fit for it. This commit simply moves the existing code: no other changes at all. * Rename `get_devices_with_keys_by_user` to better reflect what it does. * get_device_stream_token abstract method To avoid referencing fields which are declared in the derived classes, make `get_device_stream_token` abstract, and define that in the classes which define `_device_list_id_gen`.
* Make SlavedIdTracker.advance have same interface as MultiWriterIDGenerator ↵Erik Johnston2020-08-261-2/+2
| | | | (#8171)
* Rename database classes to make some sense (#8033)Erik Johnston2020-08-051-4/+4
|
* Support any process writing to cache invalidation stream. (#7436)Erik Johnston2020-05-071-4/+2
|
* Use `stream.current_token()` and remove `stream_positions()` (#7172)Erik Johnston2020-05-011-10/+0
| | | | We move the processing of typing and federation replication traffic into their handlers so that `Stream.current_token()` points to a valid token. This allows us to remove `get_streams_to_replicate()` and `stream_positions()`.
* Comments from reviewErik Johnston2020-03-181-0/+3
|
* Change device list replication to match new semantics.Erik Johnston2020-02-281-12/+13
| | | | | Instead of sending down batches of user ID/host tuples, send down a row per entity (user ID or host).
* Add 'device_lists_outbound_pokes' as extra table.Erik Johnston2020-02-281-1/+7
| | | | | | | | | This makes sure we check all the relevant tables to get the current max stream ID. Currently not doing so isn't problematic as the max stream ID in `device_lists_outbound_pokes` is the same as in `device_lists_stream`, however that will change.
* Detect unknown remote devices and mark cache as stale (#6776)Erik Johnston2020-01-281-1/+1
| | | | We just mark the fact that the cache may be stale in the database for now.
* Change DataStores to accept 'database' param.Erik Johnston2019-12-061-2/+3
|
* clean up code a bitHubert Chathi2019-10-311-5/+9
|
* make user signatures a separate streamHubert Chathi2019-10-301-2/+6
|
* make notification of signatures work with workersHubert Chathi2019-10-241-0/+1
|
* Merge branch 'develop' of github.com:matrix-org/synapse into ↵Erik Johnston2019-10-221-0/+3
|\ | | | | | | erikj/refactor_stores
| * add user signature stream change cache to slaved device storeHubert Chathi2019-09-041-0/+3
| |
* | Move storage classes into a main "data store".Erik Johnston2019-10-211-2/+2
|/ | | | | This is in preparation for having multiple data stores that offer different functionality, e.g. splitting out state or event storage.
* Run Black. (#5482)Amber Brown2019-06-201-9/+5
|
* Fixup slave storesErik Johnston2019-03-041-24/+21
|
* Make workers work on Py3 (#4027)Amber Brown2018-10-131-10/+1
|
* merge (#3576)Amber Brown2018-09-141-7/+16
|
* run isortAmber Brown2018-07-091-2/+3
|
* Add missing storage function to slave storeErik Johnston2017-05-221-0/+2
|
* Change slave storage to use new replication interfaceErik Johnston2017-04-031-14/+10
| | | | | | | As the TCP replication uses a slightly different API and streams than the HTTP replication. This breaks HTTP replication.
* Hook device list updates to replicationErik Johnston2017-01-271-0/+72