Compare commits

...

5 Commits

Author SHA1 Message Date
Erik Johnston
bdd4498f5e Fixup 2025-05-14 16:11:09 +01:00
Erik Johnston
3f4cc73f5f Move schema delta 2025-05-14 16:04:09 +01:00
Erik Johnston
288f61773b Update synapse/storage/databases/main/sliding_sync.py
Co-authored-by: Devon Hudson <devon.dmytro@gmail.com>
2025-05-14 15:59:10 +01:00
Erik Johnston
9f805fa36d Newsfile 2025-05-14 15:45:58 +01:00
Erik Johnston
98a35edc23 Move index creatin to background update 2025-05-14 15:44:41 +01:00
3 changed files with 11 additions and 2 deletions

1
changelog.d/18439.bugfix Normal file
View File

@@ -0,0 +1 @@
Fix startup being blocked on creating a new index. Introduced in v1.130.0rc1.

View File

@@ -68,6 +68,14 @@ class SlidingSyncStore(SQLBaseStore):
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_stream_ordering",
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,

View File

@@ -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
(9204, 'sliding_sync_membership_snapshots_user_id_stream_ordering', '{}');