Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Add a robustness check for partial-stated outliers
Browse files Browse the repository at this point in the history
  • Loading branch information
richvdh committed Feb 23, 2022
1 parent f499f40 commit 446fae6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions synapse/storage/databases/main/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -2142,6 +2142,14 @@ def _store_event_state_mappings_txn(
state_groups = {}
for event, context in events_and_contexts:
if event.internal_metadata.is_outlier():
# double-check that we don't have any events that claim to be outliers
# *and* have partial state (which is meaningless: we should have no
# state at all for an outlier)
if context.partial_state:
raise ValueError(
"Outlier event %s claims to have partial state", event.event_id
)

continue

# if the event was rejected, just give it the same state as its
Expand Down

0 comments on commit 446fae6

Please sign in to comment.