mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-07 11:42:11 -04:00
Only invalidate membership caches based on the cache stream
Before we completely invalidated get_users_in_room whenever we updated any current_state_events table. This was way too aggressive.
This commit is contained in:
parent
ac001dabdc
commit
458b6f4733
4 changed files with 5 additions and 41 deletions
|
@ -572,14 +572,6 @@ class EventsStore(SQLBaseStore):
|
|||
txn, self.get_users_in_room, (room_id,)
|
||||
)
|
||||
|
||||
# Add an entry to the current_state_resets table to record the point
|
||||
# where we clobbered the current state
|
||||
self._simple_insert_txn(
|
||||
txn,
|
||||
table="current_state_resets",
|
||||
values={"event_stream_ordering": max_stream_order}
|
||||
)
|
||||
|
||||
for room_id, new_extrem in new_forward_extremeties.items():
|
||||
self._simple_delete_txn(
|
||||
txn,
|
||||
|
@ -1610,15 +1602,6 @@ class EventsStore(SQLBaseStore):
|
|||
else:
|
||||
upper_bound = current_forward_id
|
||||
|
||||
sql = (
|
||||
"SELECT event_stream_ordering FROM current_state_resets"
|
||||
" WHERE ? < event_stream_ordering"
|
||||
" AND event_stream_ordering <= ?"
|
||||
" ORDER BY event_stream_ordering ASC"
|
||||
)
|
||||
txn.execute(sql, (last_forward_id, upper_bound))
|
||||
state_resets = txn.fetchall()
|
||||
|
||||
sql = (
|
||||
"SELECT event_stream_ordering, event_id, state_group"
|
||||
" FROM ex_outlier_stream"
|
||||
|
@ -1630,7 +1613,6 @@ class EventsStore(SQLBaseStore):
|
|||
forward_ex_outliers = txn.fetchall()
|
||||
else:
|
||||
new_forward_events = []
|
||||
state_resets = []
|
||||
forward_ex_outliers = []
|
||||
|
||||
sql = (
|
||||
|
@ -1670,7 +1652,6 @@ class EventsStore(SQLBaseStore):
|
|||
return AllNewEventsResult(
|
||||
new_forward_events, new_backfill_events,
|
||||
forward_ex_outliers, backward_ex_outliers,
|
||||
state_resets,
|
||||
)
|
||||
return self.runInteraction("get_all_new_events", get_all_new_events_txn)
|
||||
|
||||
|
@ -1896,5 +1877,4 @@ class EventsStore(SQLBaseStore):
|
|||
AllNewEventsResult = namedtuple("AllNewEventsResult", [
|
||||
"new_forward_events", "new_backfill_events",
|
||||
"forward_ex_outliers", "backward_ex_outliers",
|
||||
"state_resets"
|
||||
])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue