forked-synapse/synapse/storage/databases/main
David Robertson 06ba71083e
Fix order of partial state tables when purging (#15068)
* Fix order of partial state tables when purging

`partial_state_rooms` has an FK on `events` pointing to the join event we
get from `/send_join`, so we must delete from that table before deleting
from `events`.

**NB:** It would be nice to cancel any resync processes for the room
being purged. We do not do this at present. To do so reliably we'd need
an internal HTTP "replication" endpoint, because the worker doing the
resync process may be different to that handling the purge request.

The first time the resync process tries to write data after the deletion
it will fail because we have deleted necessary data e.g. auth
events. AFAICS it will not retry the resync, so the only downside to
not cancelling the resync is a scary-looking traceback.

(This is presumably extremely race-sensitive.)

* Changelog

* admist(?) -> between

* Warn about a race

* Fix typo, thanks Sean

Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>

---------

Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>
2023-02-14 23:42:29 +00:00
..
__init__.py Add helper to parse an enum from query args & use it. (#14956) 2023-02-01 21:35:24 +00:00
account_data.py Return read-only collections from @cached methods (#13755) 2023-02-10 23:29:00 +00:00
appservice.py Return read-only collections from @cached methods (#13755) 2023-02-10 23:29:00 +00:00
cache.py Always notify replication when a stream advances (#14877) 2023-01-20 18:02:18 +00:00
censor_events.py Safe async event cache (#13308) 2022-07-19 11:25:29 +00:00
client_ips.py Optimise _update_client_ips_batch_txn to batch together database operations. (#12252) 2022-04-08 15:29:13 +01:00
deviceinbox.py Always notify replication when a stream advances (#14877) 2023-01-20 18:02:18 +00:00
devices.py Return read-only collections from @cached methods (#13755) 2023-02-10 23:29:00 +00:00
directory.py Return read-only collections from @cached methods (#13755) 2023-02-10 23:29:00 +00:00
e2e_room_keys.py Remove redundant types from comments. (#14412) 2022-11-16 15:25:24 +00:00
end_to_end_keys.py Fix clashing DB txn name (#15070) 2023-02-14 11:20:25 +00:00
event_federation.py Return read-only collections from @cached methods (#13755) 2023-02-10 23:29:00 +00:00
event_push_actions.py Skip calculating unread push actions in /sync when enable_push is false. (#14980) 2023-02-14 11:10:29 +00:00
events_bg_updates.py Change collection[str] to StrCollection in event_auth code (#14929) 2023-02-14 09:37:08 +00:00
events_forward_extremities.py Fix returned count of delete extremities admin API (#12496) 2022-04-19 16:49:45 +01:00
events_worker.py Disambiguate get_ex_outlier_stream_rows query 2023-02-07 15:33:33 +00:00
events.py Change collection[str] to StrCollection in event_auth code (#14929) 2023-02-14 09:37:08 +00:00
filtering.py Merge/remove Slaved* stores into WorkerStores (#14375) 2022-11-11 10:51:49 +00:00
keys.py Add some type hints to datastore (#12485) 2022-04-27 13:05:00 +01:00
lock.py Require SQLite >= 3.27.0 (#13760) 2022-09-09 11:14:10 +01:00
media_repository.py Add helper to parse an enum from query args & use it. (#14956) 2023-02-01 21:35:24 +00:00
metrics.py Add some type hints to datastore (#12717) 2022-05-17 15:29:06 +01:00
monthly_active_users.py Return read-only collections from @cached methods (#13755) 2023-02-10 23:29:00 +00:00
openid.py Add type hints to some storage classes (#11307) 2021-11-11 08:47:31 -05:00
presence.py Always notify replication when a stream advances (#14877) 2023-01-20 18:02:18 +00:00
profile.py Remove remaining pieces of groups code. (#12966) 2022-06-06 13:20:05 -04:00
purge_events.py Fix order of partial state tables when purging (#15068) 2023-02-14 23:42:29 +00:00
push_rule.py Implement MSC3958: suppress notifications from edits (#14960) 2023-02-03 14:31:14 -05:00
pusher.py Always notify replication when a stream advances (#14877) 2023-01-20 18:02:18 +00:00
receipts.py Return read-only collections from @cached methods (#13755) 2023-02-10 23:29:00 +00:00
registration.py Return read-only collections from @cached methods (#13755) 2023-02-10 23:29:00 +00:00
rejections.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
relations.py Return read-only collections from @cached methods (#13755) 2023-02-10 23:29:00 +00:00
room_batch.py Remove option to skip locking of tables during emulated upserts (#14469) 2022-11-28 13:42:06 +00:00
room.py Faster joins: Refactor handling of servers in room (#14954) 2023-02-03 15:39:59 +00:00
roommember.py Return read-only collections from @cached methods (#13755) 2023-02-10 23:29:00 +00:00
search.py Drop support for Postgres 10 in full text search code. (#14397) 2022-11-09 09:55:34 -05:00
session.py Run pyupgrade --py37-plus --keep-percent-format on Synapse (#11685) 2022-01-05 09:53:05 -08:00
signatures.py Return read-only collections from @cached methods (#13755) 2023-02-10 23:29:00 +00:00
state_deltas.py Wait for lazy join to complete when getting current state (#12872) 2022-06-01 16:02:53 +01:00
state.py Enable Faster Remote Room Joins against worker-mode Synapse. (#14752) 2023-01-22 21:10:11 +00:00
stats.py Add helper to parse an enum from query args & use it. (#14956) 2023-02-01 21:35:24 +00:00
stream.py Use an enum for direction. (#14927) 2023-01-27 07:27:55 -05:00
tags.py Return read-only collections from @cached methods (#13755) 2023-02-10 23:29:00 +00:00
transactions.py Add helper to parse an enum from query args & use it. (#14956) 2023-02-01 21:35:24 +00:00
ui_auth.py Add some type hints to datastore (#12485) 2022-04-27 13:05:00 +01:00
user_directory.py Return read-only collections from @cached methods (#13755) 2023-02-10 23:29:00 +00:00
user_erasure_store.py Annotations for user_erasure_store (#11313) 2021-11-11 19:22:19 +00:00