Merge pull request #837 from matrix-org/markjh/synchrotron_presence_list

Add get_presence_list_accepted to the broken caches in synchrotron
This commit is contained in:
Mark Haines 2016-06-03 18:28:08 +01:00
commit 040a560a48
1 changed files with 10 additions and 5 deletions

View File

@ -39,7 +39,7 @@ from synapse.replication.slave.storage.presence import SlavedPresenceStore
from synapse.server import HomeServer from synapse.server import HomeServer
from synapse.storage.client_ips import ClientIpStore from synapse.storage.client_ips import ClientIpStore
from synapse.storage.engines import create_engine from synapse.storage.engines import create_engine
from synapse.storage.presence import UserPresenceState from synapse.storage.presence import PresenceStore, UserPresenceState
from synapse.storage.roommember import RoomMemberStore from synapse.storage.roommember import RoomMemberStore
from synapse.util.async import sleep from synapse.util.async import sleep
from synapse.util.httpresourcetree import create_resource_tree from synapse.util.httpresourcetree import create_resource_tree
@ -122,11 +122,8 @@ class SynchrotronSlavedStore(
SlavedFilteringStore, SlavedFilteringStore,
SlavedPresenceStore, SlavedPresenceStore,
BaseSlavedStore, BaseSlavedStore,
ClientIpStore, # After BaseSlavedStre because the constructor is different ClientIpStore, # After BaseSlavedStore because the constructor is different
): ):
def get_presence_list_accepted(self, user_localpart):
return ()
# XXX: This is a bit broken because we don't persist forgotten rooms # XXX: This is a bit broken because we don't persist forgotten rooms
# in a way that they can be streamed. This means that we don't have a # in a way that they can be streamed. This means that we don't have a
# way to invalidate the forgotten rooms cache correctly. # way to invalidate the forgotten rooms cache correctly.
@ -136,6 +133,13 @@ class SynchrotronSlavedStore(
RoomMemberStore.__dict__["who_forgot_in_room"] RoomMemberStore.__dict__["who_forgot_in_room"]
) )
# XXX: This is a bit broken because we don't persist the accepted list in a
# way that can be replicated. This means that we don't have a way to
# invalidate the cache correctly.
get_presence_list_accepted = PresenceStore.__dict__[
"get_presence_list_accepted"
]
UPDATE_SYNCING_USERS_MS = 10 * 1000 UPDATE_SYNCING_USERS_MS = 10 * 1000
@ -357,6 +361,7 @@ class SynchrotronServer(HomeServer):
def expire_broken_caches(): def expire_broken_caches():
store.who_forgot_in_room.invalidate_all() store.who_forgot_in_room.invalidate_all()
store.get_presence_list_accepted.invalidate_all()
def notify_from_stream( def notify_from_stream(
result, stream_name, stream_key, room=None, user=None result, stream_name, stream_key, room=None, user=None