forked-synapse/synapse/storage
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
..
databases Upsert redactions in case they already exists (#10343) 2021-07-09 11:03:02 +01:00
engines Fix the inbound PDU metric (#10279) 2021-06-30 12:07:16 +01:00
schema Remove functionality associated with unused historical stats tables (#9721) 2021-07-08 16:57:13 +01:00
util Fix bug when running presence off master (#10149) 2021-06-11 10:27:12 +01:00
__init__.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
_base.py Remove unnecessary SystemRandom from SQLBaseStore (#9987) 2021-05-14 10:59:10 +01:00
background_updates.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
database.py Add script for getting info about recently registered users (#10290) 2021-07-06 13:03:16 +01:00
keys.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
persist_events.py Fix persist_events to stop leaking opentracing contexts (#10193) 2021-06-17 11:21:53 +01:00
prepare_database.py Support for database schema version ranges (#9933) 2021-06-11 14:45:53 +01:00
purge_events.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
push_rule.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
relations.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
roommember.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
state.py Fix get_state_ids_for_event return type typo to match what the function actually does (#10050) 2021-05-24 10:43:33 +01:00
types.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00