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

Fix using MSC2716 batch sending with event persistence workers #11220

Merged
merged 5 commits into from
Nov 29, 2021
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/11220.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix using MSC2716 batch sending in combination with event persistence workers. Contributed by @tulir at Beeper.
2 changes: 2 additions & 0 deletions synapse/app/generic_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
)
from synapse.storage.databases.main.presence import PresenceStore
from synapse.storage.databases.main.room import RoomWorkerStore
from synapse.storage.databases.main.room_batch import RoomBatchStore
from synapse.storage.databases.main.search import SearchStore
from synapse.storage.databases.main.session import SessionStore
from synapse.storage.databases.main.stats import StatsStore
Expand Down Expand Up @@ -240,6 +241,7 @@ class GenericWorkerSlavedStore(
SlavedEventStore,
SlavedKeyStore,
RoomWorkerStore,
RoomBatchStore,
Copy link
Contributor

Choose a reason for hiding this comment

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

@tulir Might be good to split out this missing import fix for worker mode in a separate PR so we can merge it while we figure out the other problem.

DirectoryStore,
SlavedApplicationServiceStore,
SlavedRegistrationStore,
Expand Down
5 changes: 5 additions & 0 deletions synapse/events/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,11 @@ async def _fill_out_state(self) -> None:
attributes by loading from the database.
"""
if self.state_group is None:
# No state group means the event is an outlier. Usually the state_ids dicts are also
# pre-set to empty dicts, but they get reset when the context is serialized, so set
# them to empty dicts again here.
self._current_state_ids = {}
self._prev_state_ids = {}
return

current_state_ids = await self._storage.state.get_state_ids_for_group(
Expand Down