Skip to content
Snippets Groups Projects
Forked from Maunium / synapse
Source project has a limited visibility.
  • David Robertson's avatar
    06ba7108
    Fix order of partial state tables when purging (#15068) · 06ba7108
    David Robertson authored
    
    * 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: default avatarSean Quah <8349537+squahtx@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: default avatarSean Quah <8349537+squahtx@users.noreply.github.com>
    06ba7108
    History
    Fix order of partial state tables when purging (#15068)
    David Robertson authored
    
    * 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: default avatarSean Quah <8349537+squahtx@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: default avatarSean Quah <8349537+squahtx@users.noreply.github.com>