Compare commits

...

4 Commits

Author SHA1 Message Date
David Robertson
42a37fcb68 Changelog 2021-11-22 22:08:46 +00:00
David Robertson
ad30e4f4d7 Import CacheInvalidationWorkers from cache.py
Missed one!
2021-11-22 22:08:44 +00:00
David Robertson
a6bb41019a Remove redundant inheritances from DataStore
DataStore continues to inherit from SearchStore via
['DataStore', 'RoomStore', 'SearchStore']
DataStore continues to inherit inherits from MonthlyActiveUsersStore via
['DataStore', 'ClientIpStore', 'MonthlyActiveUsersStore']
DataStore inherits from StatsStore via redundantly
['DataStore', 'RegistrationStore', 'StatsStore']
DataStore inherits from CacheInvalidationWorkerStore via e.g
['DataStore', 'EventForwardExtremitiesStore', 'CacheInvalidationWorkerStore']

lint
2021-11-22 22:06:06 +00:00
David Robertson
53be2556e3 Prune AdminCmdSlavedStore and GenericWorkerSlavedStore
both continue to inherit both removed classes via
... -> SlavedPushRuleStore -> SlavedEventStore -> BaseSlavedStore
2021-11-22 22:05:30 +00:00
8 changed files with 5 additions and 20 deletions

1
changelog.d/11400.misc Normal file
View File

@@ -0,0 +1 @@
Trim redundant DataStore inheritance.

View File

@@ -28,13 +28,11 @@ from synapse.config.homeserver import HomeServerConfig
from synapse.config.logger import setup_logging
from synapse.events import EventBase
from synapse.handlers.admin import ExfiltrationWriter
from synapse.replication.slave.storage._base import BaseSlavedStore
from synapse.replication.slave.storage.account_data import SlavedAccountDataStore
from synapse.replication.slave.storage.appservice import SlavedApplicationServiceStore
from synapse.replication.slave.storage.client_ips import SlavedClientIpStore
from synapse.replication.slave.storage.deviceinbox import SlavedDeviceInboxStore
from synapse.replication.slave.storage.devices import SlavedDeviceStore
from synapse.replication.slave.storage.events import SlavedEventStore
from synapse.replication.slave.storage.filtering import SlavedFilteringStore
from synapse.replication.slave.storage.groups import SlavedGroupServerStore
from synapse.replication.slave.storage.push_rule import SlavedPushRuleStore
@@ -59,9 +57,7 @@ class AdminCmdSlavedStore(
SlavedDeviceInboxStore,
SlavedDeviceStore,
SlavedPushRuleStore,
SlavedEventStore,
SlavedClientIpStore,
BaseSlavedStore,
RoomWorkerStore,
):
pass

View File

@@ -48,14 +48,12 @@ from synapse.http.site import SynapseRequest, SynapseSite
from synapse.logging.context import LoggingContext
from synapse.metrics import METRICS_PREFIX, MetricsResource, RegistryProxy
from synapse.replication.http import REPLICATION_PREFIX, ReplicationRestResource
from synapse.replication.slave.storage._base import BaseSlavedStore
from synapse.replication.slave.storage.account_data import SlavedAccountDataStore
from synapse.replication.slave.storage.appservice import SlavedApplicationServiceStore
from synapse.replication.slave.storage.client_ips import SlavedClientIpStore
from synapse.replication.slave.storage.deviceinbox import SlavedDeviceInboxStore
from synapse.replication.slave.storage.devices import SlavedDeviceStore
from synapse.replication.slave.storage.directory import DirectoryStore
from synapse.replication.slave.storage.events import SlavedEventStore
from synapse.replication.slave.storage.filtering import SlavedFilteringStore
from synapse.replication.slave.storage.groups import SlavedGroupServerStore
from synapse.replication.slave.storage.keys import SlavedKeyStore
@@ -237,7 +235,6 @@ class GenericWorkerSlavedStore(
SlavedPusherStore,
CensorEventsStore,
ClientIpWorkerStore,
SlavedEventStore,
SlavedKeyStore,
RoomWorkerStore,
DirectoryStore,
@@ -253,7 +250,6 @@ class GenericWorkerSlavedStore(
TransactionWorkerStore,
LockStore,
SessionStore,
BaseSlavedStore,
):
# Properties that multiple storage classes define. Tell mypy what the
# expected type is.

View File

@@ -31,7 +31,6 @@ from synapse.util.caches.stream_change_cache import StreamChangeCache
from .account_data import AccountDataStore
from .appservice import ApplicationServiceStore, ApplicationServiceTransactionStore
from .cache import CacheInvalidationWorkerStore
from .censor_events import CensorEventsStore
from .client_ips import ClientIpStore
from .deviceinbox import DeviceInboxStore
@@ -49,7 +48,6 @@ from .keys import KeyStore
from .lock import LockStore
from .media_repository import MediaRepositoryStore
from .metrics import ServerMetricsStore
from .monthly_active_users import MonthlyActiveUsersStore
from .openid import OpenIdStore
from .presence import PresenceStore
from .profile import ProfileStore
@@ -63,11 +61,9 @@ from .relations import RelationsStore
from .room import RoomStore
from .room_batch import RoomBatchStore
from .roommember import RoomMemberStore
from .search import SearchStore
from .session import SessionStore
from .signatures import SignatureStore
from .state import StateStore
from .stats import StatsStore
from .stream import StreamStore
from .tags import TagsStore
from .transactions import TransactionWorkerStore
@@ -107,7 +103,6 @@ class DataStore(
ReceiptsStore,
EndToEndKeyStore,
EndToEndRoomKeyStore,
SearchStore,
TagsStore,
AccountDataStore,
EventPushActionsStore,
@@ -118,13 +113,10 @@ class DataStore(
UserDirectoryStore,
GroupServerStore,
UserErasureStore,
MonthlyActiveUsersStore,
StatsStore,
RelationsStore,
CensorEventsStore,
UIAuthStore,
EventForwardExtremitiesStore,
CacheInvalidationWorkerStore,
ServerMetricsStore,
LockStore,
SessionStore,

View File

@@ -17,7 +17,7 @@ from typing import Iterable, List, Optional, Tuple
from synapse.api.errors import SynapseError
from synapse.storage.database import LoggingTransaction
from synapse.storage.databases.main import CacheInvalidationWorkerStore
from synapse.storage.databases.main.cache import CacheInvalidationWorkerStore
from synapse.types import RoomAlias
from synapse.util.caches.descriptors import cached

View File

@@ -17,7 +17,7 @@ from typing import Any, Dict, List
from synapse.api.errors import SynapseError
from synapse.storage.database import LoggingTransaction
from synapse.storage.databases.main import CacheInvalidationWorkerStore
from synapse.storage.databases.main.cache import CacheInvalidationWorkerStore
from synapse.storage.databases.main.event_federation import EventFederationWorkerStore
logger = logging.getLogger(__name__)

View File

@@ -16,7 +16,7 @@ import logging
from typing import Any, List, Set, Tuple
from synapse.api.errors import SynapseError
from synapse.storage.databases.main import CacheInvalidationWorkerStore
from synapse.storage.databases.main.cache import CacheInvalidationWorkerStore
from synapse.storage.databases.main.state import StateGroupWorkerStore
from synapse.types import RoomStreamToken

View File

@@ -15,7 +15,7 @@
from typing import Dict, Iterable
from synapse.storage.database import LoggingTransaction
from synapse.storage.databases.main import CacheInvalidationWorkerStore
from synapse.storage.databases.main.cache import CacheInvalidationWorkerStore
from synapse.util.caches.descriptors import cached, cachedList