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

FederationClient.backfill: stop flagging events as outliers #11632

Merged
merged 1 commit into from
Jan 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/11632.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug introduced in Synapse 1.19.3 which could sometimes cause `AssertionError`s when backfilling rooms over federation.
2 changes: 1 addition & 1 deletion synapse/federation/federation_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ async def backfill(

# Check signatures and hash of pdus, removing any from the list that fail checks
pdus[:] = await self._check_sigs_and_hash_and_fetch(
dest, pdus, outlier=True, room_version=room_version
dest, pdus, room_version=room_version
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that the events returned by event_from_pdu_json a couple of lines above are not flagged as outliers. the outlier flag here tells _check_sigs_and_hash_and_fetch that, if it pulls another copy of the event due to an incorrect signature, it should flag it as an outlier.

(I think the existence of an outlier param on _check_sigs_and_hash_and_fetch is misguided, but that's a separate PR.)

)

return pdus
Expand Down
4 changes: 3 additions & 1 deletion synapse/handlers/federation_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,9 @@ async def _process_pulled_event(
logger.info("Processing pulled event %s", event)

# these should not be outliers.
assert not event.internal_metadata.is_outlier()
assert (
not event.internal_metadata.is_outlier()
), "pulled event unexpectedly flagged as outlier"

event_id = event.event_id

Expand Down