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

Faster joins: potential infinite loop in resync  #13001

@richvdh

Description

@richvdh

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

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.

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 suckT-DefectBugs, crashes, hangs, security vulnerabilities, or other reported issues.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions