Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/18439.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix startup being blocked on creating a new index. Introduced in v1.130.0rc1.
8 changes: 8 additions & 0 deletions synapse/storage/databases/main/sliding_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ def __init__(
columns=("membership_event_id",),
)

self.db_pool.updates.register_background_index_update(
update_name="sliding_sync_membership_snapshots_user_id_stream_ordering",
index_name="sliding_sync_membership_snapshots_user_id",
table="sliding_sync_membership_snapshots",
columns=("user_id" "event_stream_ordering",),
replaces_index="sliding_sync_membership_snapshots_user_id",
)

async def get_latest_bump_stamp_for_room(
self,
room_id: str,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
-- <https://www.gnu.org/licenses/agpl-3.0.html>.

-- So we can fetch all rooms for a given user sorted by stream order
DROP INDEX IF EXISTS sliding_sync_membership_snapshots_user_id;
CREATE INDEX IF NOT EXISTS sliding_sync_membership_snapshots_user_id ON sliding_sync_membership_snapshots(user_id, event_stream_ordering);
INSERT INTO background_updates (ordering, update_name, progress_json) VALUES
(9203, 'sliding_sync_membership_snapshots_user_id_stream_ordering', '{}');
Loading