forked-synapse/synapse
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
..
_scripts Always notify replication when a stream advances (#14877) 2023-01-20 18:02:18 +00:00
api Faster joins: don't stall when a user joins during a fast join (#14606) 2023-02-10 23:31:05 +00:00
app Return read-only collections from @cached methods (#13755) 2023-02-10 23:29:00 +00:00
appservice Type hints for tests.appservice (#14990) 2023-02-06 12:49:06 +00:00
config Implement MSC3966: Add a push rule condition to search for a value in an array. (#15045) 2023-02-14 14:02:19 -05:00
crypto Add some clarifying comments and refactor a portion of the Keyring class for readability (#14804) 2023-01-13 12:37:28 +00:00
events Change collection[str] to StrCollection in event_auth code (#14929) 2023-02-14 09:37:08 +00:00
federation Faster joins: don't stall when a user joins during a fast join (#14606) 2023-02-10 23:31:05 +00:00
handlers Fix order of partial state tables when purging (#15068) 2023-02-14 23:42:29 +00:00
http Respond correctly to unknown methods on known endpoints (#14605) 2023-02-09 13:04:24 -05:00
logging Tag federation request spans with the worker name (#15042) 2023-02-09 22:33:39 +00:00
metrics Fix logging context warnings due to common usage metrics setup (#14574) 2022-11-28 15:25:18 +00:00
module_api Fix a bug in the send_local_online_presence_to module API (#14880) 2023-01-25 21:34:37 +00:00
push Implement MSC3966: Add a push rule condition to search for a value in an array. (#15045) 2023-02-14 14:02:19 -05:00
replication Fix bug in replication where response is cached (#15024) 2023-02-08 16:41:55 +00:00
res Fix #11308 : Remove dependency on jquery on reCAPTCHA page (#14672) 2022-12-14 12:02:28 +00:00
rest Prevent clients from reporting nonexistent events. (#13779) 2023-02-14 15:50:59 +00:00
server_notices Remove redundant types from comments. (#14412) 2022-11-16 15:25:24 +00:00
spam_checker_api Fix import in module_api module and docs on the new check_event_for_spam signature (#12918) 2022-05-31 12:04:53 +02:00
state Return read-only collections from @cached methods (#13755) 2023-02-10 23:29:00 +00:00
static Add viewport directive to HTML templates to optimise for mobile (#13493) 2022-08-11 14:04:20 +01:00
storage Fix order of partial state tables when purging (#15068) 2023-02-14 23:42:29 +00:00
streams Add helper to parse an enum from query args & use it. (#14956) 2023-02-01 21:35:24 +00:00
types Implement MSC3966: Add a push rule condition to search for a value in an array. (#15045) 2023-02-14 14:02:19 -05:00
util Remove unnecessary reactor reference from _PerHostRatelimiter (#14842) 2023-01-16 13:16:19 +00:00
__init__.py Parse SYNAPSE_ASYNC_IO_REACTOR env variable & log the reactor on startup (#14092) 2022-10-07 15:19:59 +01:00
event_auth.py Change collection[str] to StrCollection in event_auth code (#14929) 2023-02-14 09:37:08 +00:00
notifier.py Fix a bug in the send_local_online_presence_to module API (#14880) 2023-01-25 21:34:37 +00:00
py.typed Mark Module API error imports as re-exported and mark Synapse as containing type annotations (#11054) 2021-10-13 08:42:41 +01:00
server.py Add final type hint to synapse.server. (#15035) 2023-02-09 09:49:04 -05:00
visibility.py Move StateFilter to synapse.types (#14668) 2022-12-12 16:19:30 +00:00