-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sliding sync: don't fetch room summary for named rooms. (#17683)
For rooms with a name we can skip fetching a full room summary, as we don't need to calculate heroes, and instead just fetch the room counts directly. This also changes things to not return counts and heroes for non-joined rooms. For left/banned rooms we were returning zero values anyway, and for invite/knock rooms we don't really want to leak such information (even if some of is included in the stripped state).
- Loading branch information
1 parent
a7fcac5
commit f6c2b0e
Showing
7 changed files
with
121 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Speed up sliding sync by reducing amount of data pulled out of the database for large rooms. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
synapse/storage/schema/main/delta/87/03_current_state_index.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
-- | ||
-- This file is licensed under the Affero General Public License (AGPL) version 3. | ||
-- | ||
-- Copyright (C) 2024 New Vector, Ltd | ||
-- | ||
-- This program is free software: you can redistribute it and/or modify | ||
-- it under the terms of the GNU Affero General Public License as | ||
-- published by the Free Software Foundation, either version 3 of the | ||
-- License, or (at your option) any later version. | ||
-- | ||
-- See the GNU Affero General Public License for more details: | ||
-- <https://www.gnu.org/licenses/agpl-3.0.html>. | ||
|
||
|
||
-- Add a background updates to add a new index: | ||
-- `current_state_events(room_id, membership) WHERE type = 'm.room.member' | ||
-- This makes counting membership in rooms (for syncs) much faster | ||
INSERT INTO background_updates (ordering, update_name, progress_json) VALUES | ||
(8701, 'current_state_events_members_room_index', '{}'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters