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

Prefill more stream change caches. #12372

Merged
merged 7 commits into from
Apr 5, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fixup
  • Loading branch information
erikjohnston committed Apr 5, 2022
commit b6c6eb04e7686b1d88d942a8df21443c42d795ce
1 change: 0 additions & 1 deletion synapse/replication/slave/storage/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from synapse.storage.database import DatabasePool, LoggingDatabaseConnection
from synapse.storage.databases.main.devices import DeviceWorkerStore
from synapse.storage.databases.main.end_to_end_keys import EndToEndKeyWorkerStore
from synapse.util.caches.stream_change_cache import StreamChangeCache

if TYPE_CHECKING:
from synapse.server import HomeServer
Expand Down
4 changes: 2 additions & 2 deletions synapse/storage/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -2050,9 +2050,9 @@ def get_cache_dict(

# The rows come out in reverse stream ID order, so we want to keep the
# stream ID of the first row for each entity.
cache = {}
cache: Dict[Any, int] = {}
for row in txn:
cache[0].setdefault(row[0], int(row[1]))
cache.setdefault(row[0], int(row[1]))

txn.close()

Expand Down