summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Robertson <davidr@element.io>2021-11-15 15:41:32 +0000
committerDavid Robertson <davidr@element.io>2021-11-16 18:46:51 +0000
commit1dea20ca75476cce6a72d790868b127d945bd769 (patch)
tree175a798c84cc5989be75bb3e508f60aed8b8fbc3
parentLoggingDatabaseConnection.__enter__ returns itself (diff)
downloadsynapse-1dea20ca75476cce6a72d790868b127d945bd769.tar.xz
CacheInvalidationWorkerStore needs RelationsWorkerStore
for e.g. get_relations_for_event.

Remove it from SlavedEventsStore. (Still there via SlavedEventsStore ->
BaseSlavedStore -> CacheInvalidationWorkerStore -> RelationsWorkerStore.
-rw-r--r--synapse/replication/slave/storage/events.py1
-rw-r--r--synapse/storage/databases/main/cache.py3
2 files changed, 2 insertions, 2 deletions
diff --git a/synapse/replication/slave/storage/events.py b/synapse/replication/slave/storage/events.py
index 6080d9fb29..5856425c17 100644
--- a/synapse/replication/slave/storage/events.py
+++ b/synapse/replication/slave/storage/events.py
@@ -52,7 +52,6 @@ class SlavedEventStore(
     StreamWorkerStore,
     StateGroupWorkerStore,
     UserErasureWorkerStore,
-    RelationsWorkerStore,
     BaseSlavedStore,
 ):
     def __init__(self, database: DatabasePool, db_conn, hs: "HomeServer"):
diff --git a/synapse/storage/databases/main/cache.py b/synapse/storage/databases/main/cache.py
index 41eec27427..d5fab29905 100644
--- a/synapse/storage/databases/main/cache.py
+++ b/synapse/storage/databases/main/cache.py
@@ -30,6 +30,7 @@ from synapse.storage.database import (
     LoggingTransaction,
 )
 from synapse.storage.databases.main.event_federation import EventFederationWorkerStore
+from synapse.storage.databases.main.relations import RelationsWorkerStore
 from synapse.storage.engines import PostgresEngine
 from synapse.storage.util.id_generators import MultiWriterIdGenerator
 from synapse.util.caches.descriptors import _CachedFunction
@@ -49,7 +50,7 @@ CURRENT_STATE_CACHE_NAME = "cs_cache_fake"
 _CacheData = Tuple[str, Optional[List[str]], Optional[int]]
 
 
-class CacheInvalidationWorkerStore(EventFederationWorkerStore):
+class CacheInvalidationWorkerStore(EventFederationWorkerStore, RelationsWorkerStore):
     # This class must be mixed in with a child class which provides the following
     # attribute. TODO: can we get static analysis to enforce this?
     _cache_id_gen: Optional[MultiWriterIdGenerator]