summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2022-07-26 12:47:31 +0100
committerGitHub <noreply@github.com>2022-07-26 11:47:31 +0000
commitca3db044a3b5a207ff8d65ad7b761427ab215ccc (patch)
tree82a100ebd57098e5a6cd0f4a471a1c782e580380 /synapse/handlers
parentFaster room joins: avoid blocking when pulling events with missing prevs (#13... (diff)
downloadsynapse-ca3db044a3b5a207ff8d65ad7b761427ab215ccc.tar.xz
Fix infinite loop in partial-state resync (#13353)
Make sure that we only pull out events from the db once they have no
prev-events with partial state.
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/federation_event.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/synapse/handlers/federation_event.py b/synapse/handlers/federation_event.py
index fc1254d2ad..2ba2b1527e 100644
--- a/synapse/handlers/federation_event.py
+++ b/synapse/handlers/federation_event.py
@@ -569,15 +569,15 @@ class FederationEventHandler:
 
             if context is None or 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.
+                # partial state. We were careful to only pick events from the db without
+                # partial-state prev events, so that implies that a prev event has
+                # been persisted (with partial state) since we did the query.
                 #
-                # 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
+                # So, let's just ignore `event` for now; when we re-run the db query
+                # we should instead get its partial-state prev event, which we will
+                # de-partial-state, and then come back to event.
                 logger.warning(
-                    "%s still has partial state: can't de-partial-state it yet",
+                    "%s still has prev_events with partial state: can't de-partial-state it yet",
                     event.event_id,
                 )
                 return