MatrixSynapse/synapse
Andreas Rammhold e3e73e181b
Upsert redactions in case they already exists (#10343)
* Upsert redactions in case they already exists

Occasionally, in combination with retention, redactions aren't deleted
from the database whenever they are due for deletion. The server will
eventually try to backfill the deleted events and trip over the already
existing redaction events.

Switching to an UPSERT for those events allows us to recover from there
situations. The retention code still needs fixing but that is outside of
my current comfort zone on this code base.

This is related to #8707 where the error was discussed already.

Signed-off-by: Andreas Rammhold <andreas@rammhold.de>

* Also purge redactions when purging events

Previously redacints where left behind leading to backfilling issues
when the server stumbled across the already existing yet to be
backfilled redactions.

This issues has been discussed in #8707.

Signed-off-by: Andreas Rammhold <andreas@rammhold.de>
2021-07-09 11:03:02 +01:00
..
_scripts
api
app
appservice
config
crypto
events
federation
groups
handlers
http
logging
metrics
module_api
push
replication
res/templates
rest
server_notices
spam_checker_api
state
static
storage Upsert redactions in case they already exists (#10343) 2021-07-09 11:03:02 +01:00
streams
util
__init__.py
event_auth.py
notifier.py
python_dependencies.py
server.py
types.py
visibility.py