Skip to content

Commit

Permalink
Revert "Handle large chain calc better (#17291)" (#17334)
Browse files Browse the repository at this point in the history
This reverts commit bdf82ef  (#17291)

This seems to have stopped persisting auth chains for new events, and so
is causing state res to fall back to the slow methods
  • Loading branch information
erikjohnston committed Jun 19, 2024
1 parent 3239b74 commit 4243c1f
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 230 deletions.
1 change: 0 additions & 1 deletion changelog.d/17291.misc

This file was deleted.

12 changes: 0 additions & 12 deletions synapse/storage/controllers/persist_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,25 +617,13 @@ async def _persist_event_batch(
room_id, chunk
)

with Measure(self._clock, "calculate_chain_cover_index_for_events"):
# We now calculate chain ID/sequence numbers for any state events we're
# persisting. We ignore out of band memberships as we're not in the room
# and won't have their auth chain (we'll fix it up later if we join the
# room).
#
# See: docs/auth_chain_difference_algorithm.md
new_event_links = await self.persist_events_store.calculate_chain_cover_index_for_events(
room_id, [e for e, _ in chunk]
)

await self.persist_events_store._persist_events_and_state_updates(
room_id,
chunk,
state_delta_for_room=state_delta_for_room,
new_forward_extremities=new_forward_extremities,
use_negative_stream_ordering=backfilled,
inhibit_local_membership_updates=backfilled,
new_event_links=new_event_links,
)

return replaced_events
Expand Down
Loading

0 comments on commit 4243c1f

Please sign in to comment.