This repository was archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Faster joins: potential infinite loop in resync #13001
Copy link
Copy link
Closed
Labels
A-Federated-Joinjoins over federation generally suckjoins over federation generally suckT-DefectBugs, crashes, hangs, security vulnerabilities, or other reported issues.Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Description
Resyncing the state for a room follows the following algorithm:
- Find a batch of events with partial state. We choose the first 100 events ordered by arrival time. For each event in the batch:
- Skip if we have
prev_events
with partial state - Request the state at any completely missing
prev_events
- Resolve the state across the
prev_events
and persist
- Skip if we have
It's possible for that to get into a loop, where we pull out the first 100 events, fail to make progress on any of them, and repeat.
synapse/synapse/handlers/federation_event.py
Lines 527 to 540 in 7c6b220
if context.partial_state: | |
# this can happen if some or all of the event's prev_events still have | |
# partial state - ie, an event has an earlier stream_ordering than one | |
# or more of its prev_events, so we de-partial-state it before its | |
# prev_events. | |
# | |
# TODO(faster_joins): we probably need to be more intelligent, and | |
# exclude partial-state prev_events from consideration | |
# https://github.com/matrix-org/synapse/issues/13001 | |
logger.warning( | |
"%s still has partial state: can't de-partial-state it yet", | |
event.event_id, | |
) | |
return |
part of #12646
Metadata
Metadata
Assignees
Labels
A-Federated-Joinjoins over federation generally suckjoins over federation generally suckT-DefectBugs, crashes, hangs, security vulnerabilities, or other reported issues.Bugs, crashes, hangs, security vulnerabilities, or other reported issues.