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

Commit 190f49d

Browse files
authored
Use cache store remove base slaved (#13329)
This comes from two identical definitions in each of the base stores, and means the base slaved store is now empty and can be removed.
1 parent 4f57ef0 commit 190f49d

File tree

16 files changed

+39
-114
lines changed

16 files changed

+39
-114
lines changed

changelog.d/13329.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove old base slaved store and de-duplicate cache ID generators. Contributed by Nick @ Beeper (@fizzadar).

synapse/app/admin_cmd.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
from synapse.config.logger import setup_logging
2929
from synapse.events import EventBase
3030
from synapse.handlers.admin import ExfiltrationWriter
31-
from synapse.replication.slave.storage._base import BaseSlavedStore
3231
from synapse.replication.slave.storage.account_data import SlavedAccountDataStore
3332
from synapse.replication.slave.storage.appservice import SlavedApplicationServiceStore
3433
from synapse.replication.slave.storage.deviceinbox import SlavedDeviceInboxStore
@@ -58,7 +57,6 @@ class AdminCmdSlavedStore(
5857
SlavedDeviceStore,
5958
SlavedPushRuleStore,
6059
SlavedEventStore,
61-
BaseSlavedStore,
6260
RoomWorkerStore,
6361
):
6462
def __init__(

synapse/app/generic_worker.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
from synapse.logging.context import LoggingContext
4949
from synapse.metrics import METRICS_PREFIX, MetricsResource, RegistryProxy
5050
from synapse.replication.http import REPLICATION_PREFIX, ReplicationRestResource
51-
from synapse.replication.slave.storage._base import BaseSlavedStore
5251
from synapse.replication.slave.storage.account_data import SlavedAccountDataStore
5352
from synapse.replication.slave.storage.appservice import SlavedApplicationServiceStore
5453
from synapse.replication.slave.storage.deviceinbox import SlavedDeviceInboxStore
@@ -251,7 +250,6 @@ class GenericWorkerSlavedStore(
251250
TransactionWorkerStore,
252251
LockStore,
253252
SessionStore,
254-
BaseSlavedStore,
255253
):
256254
# Properties that multiple storage classes define. Tell mypy what the
257255
# expected type is.

synapse/replication/slave/storage/_base.py

Lines changed: 0 additions & 58 deletions
This file was deleted.

synapse/replication/slave/storage/account_data.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
from synapse.replication.slave.storage._base import BaseSlavedStore
1716
from synapse.storage.databases.main.account_data import AccountDataWorkerStore
1817
from synapse.storage.databases.main.tags import TagsWorkerStore
1918

2019

21-
class SlavedAccountDataStore(TagsWorkerStore, AccountDataWorkerStore, BaseSlavedStore):
20+
class SlavedAccountDataStore(TagsWorkerStore, AccountDataWorkerStore):
2221
pass

synapse/replication/slave/storage/deviceinbox.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from synapse.replication.slave.storage._base import BaseSlavedStore
1615
from synapse.storage.databases.main.deviceinbox import DeviceInboxWorkerStore
1716

1817

19-
class SlavedDeviceInboxStore(DeviceInboxWorkerStore, BaseSlavedStore):
18+
class SlavedDeviceInboxStore(DeviceInboxWorkerStore):
2019
pass

synapse/replication/slave/storage/devices.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
from typing import TYPE_CHECKING, Any, Iterable
1616

17-
from synapse.replication.slave.storage._base import BaseSlavedStore
1817
from synapse.replication.slave.storage._slaved_id_tracker import SlavedIdTracker
1918
from synapse.replication.tcp.streams._base import DeviceListsStream, UserSignatureStream
2019
from synapse.storage.database import DatabasePool, LoggingDatabaseConnection
@@ -24,7 +23,7 @@
2423
from synapse.server import HomeServer
2524

2625

27-
class SlavedDeviceStore(DeviceWorkerStore, BaseSlavedStore):
26+
class SlavedDeviceStore(DeviceWorkerStore):
2827
def __init__(
2928
self,
3029
database: DatabasePool,

synapse/replication/slave/storage/directory.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
from synapse.storage.databases.main.directory import DirectoryWorkerStore
1616

17-
from ._base import BaseSlavedStore
1817

19-
20-
class DirectoryStore(DirectoryWorkerStore, BaseSlavedStore):
18+
class DirectoryStore(DirectoryWorkerStore):
2119
pass

synapse/replication/slave/storage/events.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
from synapse.storage.databases.main.user_erasure_store import UserErasureWorkerStore
3030
from synapse.util.caches.stream_change_cache import StreamChangeCache
3131

32-
from ._base import BaseSlavedStore
33-
3432
if TYPE_CHECKING:
3533
from synapse.server import HomeServer
3634

@@ -56,7 +54,6 @@ class SlavedEventStore(
5654
EventsWorkerStore,
5755
UserErasureWorkerStore,
5856
RelationsWorkerStore,
59-
BaseSlavedStore,
6057
):
6158
def __init__(
6259
self,

synapse/replication/slave/storage/filtering.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,15 @@
1414

1515
from typing import TYPE_CHECKING
1616

17+
from synapse.storage._base import SQLBaseStore
1718
from synapse.storage.database import DatabasePool, LoggingDatabaseConnection
1819
from synapse.storage.databases.main.filtering import FilteringStore
1920

20-
from ._base import BaseSlavedStore
21-
2221
if TYPE_CHECKING:
2322
from synapse.server import HomeServer
2423

2524

26-
class SlavedFilteringStore(BaseSlavedStore):
25+
class SlavedFilteringStore(SQLBaseStore):
2726
def __init__(
2827
self,
2928
database: DatabasePool,

0 commit comments

Comments
 (0)