From 420573a8ea744f42b3a111d406e254ea476a4b2d Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Wed, 8 Jul 2020 14:55:35 +0100 Subject: [PATCH] Process the cache stream first for incoming replication Receiving new data about e.g. events, read receipts, etc., is likely to result in some database actions. An example of that is that we send a push on new read receipts, which involves calculating a badge from unread counts. Because of this, we probably want to process cache updates/invalidations first so these actions are not using outdated cache data. In the previous example, we want to make sure we invalidate the cache on calculating the unread count for the user/room the read receipt is for before sending a push. --- synapse/replication/tcp/streams/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synapse/replication/tcp/streams/__init__.py b/synapse/replication/tcp/streams/__init__.py index d1a61c331480..34db0ff298e9 100644 --- a/synapse/replication/tcp/streams/__init__.py +++ b/synapse/replication/tcp/streams/__init__.py @@ -48,6 +48,7 @@ STREAMS_MAP = { stream.NAME: stream for stream in ( + CachesStream, EventsStream, BackfillStream, PresenceStream, @@ -55,7 +56,6 @@ ReceiptsStream, PushRulesStream, PushersStream, - CachesStream, PublicRoomsStream, DeviceListsStream, ToDeviceStream,