summary refs log tree commit diff
path: root/synapse/storage/databases/main/events.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Combine `LruCache.invalidate` and `invalidate_many` (#9973)Richard van der Hoff2021-05-271-4/+4
| | | | | | | | | | * 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
* Fix (final) Bugbear violations (#9838)Jonathan de Jong2021-04-201-5/+5
|
* Small speed up joining large remote rooms (#9825)Erik Johnston2021-04-161-21/+33
| | | | | There are a couple of points in `persist_events` where we are doing a query per event in series, which we can replace.
* 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>`
* Bugbear: Add Mutable Parameter fixes (#9682)Jonathan de Jong2021-04-081-2/+5
| | | | | | | Part of #9366 Adds in fixes for B006 and B008, both relating to mutable parameter lint errors. Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>
* Prep work for removing `outlier` from `internal_metadata` (#9411)Richard van der Hoff2021-03-171-2/+17
| | | | | | | | | | | | * Populate `internal_metadata.outlier` based on `events` table Rather than relying on `outlier` being in the `internal_metadata` column, populate it based on the `events.outlier` column. * Move `outlier` out of InternalMetadata._dict Ultimately, this will allow us to stop writing it to the database. For now, we have to grandfather it back in so as to maintain compatibility with older versions of Synapse.
* Refactor to ensure we call check_consistency (#9470)Erik Johnston2021-02-241-7/+6
| | | The idea here is to stop people forgetting to call `check_consistency`. Folks can still just pass in `None` to the new args in `build_sequence_generator`, but hopefully they won't.
* Include newly added sequences in the port DB script. (#9449)Patrick Cloke2021-02-231-1/+12
| | | And ensure the consistency of `event_auth_chain_id`.
* Update black, and run auto formatting over the codebase (#9381)Eric Eastwood2021-02-161-14/+29
| | | | | | | - Update black version to the latest - Run black auto formatting over the codebase - Run autoformatting according to [`docs/code_style.md `](https://github.com/matrix-org/synapse/blob/80d6dc9783aa80886a133756028984dbf8920168/docs/code_style.md) - Update `code_style.md` docs around installing black to use the correct version
* Fix some typos.Patrick Cloke2021-02-121-1/+1
|
* Speed up chain cover calculation (#9176)Erik Johnston2021-01-211-55/+144
|
* Use execute_batch instead of executemany in places (#9181)Erik Johnston2021-01-211-9/+9
| | | `execute_batch` does fewer round trips in postgres than `executemany`, but does not give a correct `txn.rowcount` result after.
* Fix chain cover background update to work with split out event persisters ↵Erik Johnston2021-01-141-23/+13
| | | | (#9115)
* Add background update for add chain cover index (#9029)Erik Johnston2021-01-141-14/+36
|
* Use a chain cover index to efficiently calculate auth chain difference (#8868)Erik Johnston2021-01-111-16/+519
|
* Ensure rejected events get added to some metadata tables (#9016)Erik Johnston2021-01-111-24/+25
| | | Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
* Remove frozendict_json_encoder and support frozendicts everywhereRichard van der Hoff2020-10-281-6/+4
| | | | | | Not being able to serialise `frozendicts` is fragile, and it's annoying to have to think about which serialiser you want. There's no real downside to supporting frozendicts, so let's just have one json encoder.
* Replace DeferredCache with LruCache where possible (#8563)Richard van der Hoff2020-10-191-3/+1
| | | Most of these uses don't need a full-blown DeferredCache; LruCache is lighter and more appropriate.
* Make sure a retention policy is a state event (#8527)Brendan Abolivier2020-10-141-0/+4
| | | | | * Make sure a retention policy is a state event * Changelog
* Fix message duplication if something goes wrong after persisting the event ↵Erik Johnston2020-10-131-0/+31
| | | | | (#8476) Should fix #3365.
* Only send RDATA for instance local events. (#8496)Erik Johnston2020-10-091-5/+7
| | | | | When pulling events out of the DB to send over replication we were not filtering by instance name, and so we were sending events for other instances.
* Remove stream ordering from Metadata dict (#8452)Richard van der Hoff2020-10-051-0/+4
| | | | | | | | There's no need for it to be in the dict as well as the events table. Instead, we store it in a separate attribute in the EventInternalMetadata object, and populate that on load. This means that we can rely on it being correctly populated for any event which has been persited to the database.
* Enable mypy checking for unreachable code and fix instances. (#8432)Patrick Cloke2020-10-011-13/+5
|
* Fix bug which caused failure on join with malformed membership events (#8385)Richard van der Hoff2020-09-231-3/+7
|
* Use `async with` for ID gens (#8383)Erik Johnston2020-09-231-3/+3
| | | This will allow us to hit the DB after we've finished using the generated stream ID.
* Add experimental support for sharding event persister. Again. (#8294)Erik Johnston2020-09-141-4/+8
| | | | | | This is *not* ready for production yet. Caveats: 1. We should write some tests... 2. The stream token that we use for events can get stalled at the minimum position of all writers. This means that new events may not be processed and e.g. sent down sync streams if a writer isn't writing or is slow.
* Make `StreamToken.room_key` be a `RoomStreamToken` instance. (#8281)Erik Johnston2020-09-111-6/+15
|
* Revert "Add experimental support for sharding event persister. (#8170)" (#8242)Brendan Abolivier2020-09-041-3/+1
| | | | | | | * Revert "Add experimental support for sharding event persister. (#8170)" This reverts commit 82c1ee1c22a87b9e6e3179947014b0f11c0a1ac3. * Changelog
* Re-implement unread counts (again) (#8059)Brendan Abolivier2020-09-021-2/+2
|
* Add experimental support for sharding event persister. (#8170)Erik Johnston2020-09-021-1/+3
| | | | | | This is *not* ready for production yet. Caveats: 1. We should write some tests... 2. The stream token that we use for events can get stalled at the minimum position of all writers. This means that new events may not be processed and e.g. sent down sync streams if a writer isn't writing or is slow.
* Make StreamIdGen `get_next` and `get_next_mult` async (#8161)Erik Johnston2020-08-251-2/+2
| | | | This is mainly so that `StreamIdGenerator` and `MultiWriterIdGenerator` will have the same interface, allowing them to be used interchangeably.
* Convert receipts and events databases to async/await. (#8076)Patrick Cloke2020-08-141-19/+14
|
* Revert #7736 (#8039)Brendan Abolivier2020-08-061-47/+1
|
* Rename database classes to make some sense (#8033)Erik Johnston2020-08-051-0/+1527