summary refs log tree commit diff
path: root/packages/overlays/matrix-synapse/patches/0053-Move-index-creation-to-background-update-18439.patch
diff options
context:
space:
mode:
Diffstat (limited to 'packages/overlays/matrix-synapse/patches/0053-Move-index-creation-to-background-update-18439.patch')
-rw-r--r--packages/overlays/matrix-synapse/patches/0053-Move-index-creation-to-background-update-18439.patch63
1 files changed, 0 insertions, 63 deletions
diff --git a/packages/overlays/matrix-synapse/patches/0053-Move-index-creation-to-background-update-18439.patch b/packages/overlays/matrix-synapse/patches/0053-Move-index-creation-to-background-update-18439.patch
deleted file mode 100644

index ee1cfc7..0000000 --- a/packages/overlays/matrix-synapse/patches/0053-Move-index-creation-to-background-update-18439.patch +++ /dev/null
@@ -1,63 +0,0 @@ -From f5ed52c1e24b5649d7d81dd9690bb606e387961b Mon Sep 17 00:00:00 2001 -From: Erik Johnston <erikj@element.io> -Date: Thu, 15 May 2025 12:43:24 +0100 -Subject: [PATCH 53/74] Move index creation to background update (#18439) - -Follow on from #18375. This prevents blocking startup on creating the -index, which can take a while - ---------- - -Co-authored-by: Devon Hudson <devon.dmytro@gmail.com> ---- - changelog.d/18439.bugfix | 1 + - synapse/storage/databases/main/sliding_sync.py | 8 ++++++++ - ...snapshot_idx.sql => 04_ss_membership_snapshot_idx.sql} | 4 ++-- - 3 files changed, 11 insertions(+), 2 deletions(-) - create mode 100644 changelog.d/18439.bugfix - rename synapse/storage/schema/main/delta/92/{03_ss_membership_snapshot_idx.sql => 04_ss_membership_snapshot_idx.sql} (73%) - -diff --git a/changelog.d/18439.bugfix b/changelog.d/18439.bugfix -new file mode 100644 -index 0000000000..5ee9bda474 ---- /dev/null -+++ b/changelog.d/18439.bugfix -@@ -0,0 +1 @@ -+Fix startup being blocked on creating a new index. Introduced in v1.130.0rc1. -diff --git a/synapse/storage/databases/main/sliding_sync.py b/synapse/storage/databases/main/sliding_sync.py -index a287fd2a3f..6a62b11d1e 100644 ---- a/synapse/storage/databases/main/sliding_sync.py -+++ b/synapse/storage/databases/main/sliding_sync.py -@@ -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, -diff --git a/synapse/storage/schema/main/delta/92/03_ss_membership_snapshot_idx.sql b/synapse/storage/schema/main/delta/92/04_ss_membership_snapshot_idx.sql -similarity index 73% -rename from synapse/storage/schema/main/delta/92/03_ss_membership_snapshot_idx.sql -rename to synapse/storage/schema/main/delta/92/04_ss_membership_snapshot_idx.sql -index c694203f95..6f5b7cb06e 100644 ---- a/synapse/storage/schema/main/delta/92/03_ss_membership_snapshot_idx.sql -+++ b/synapse/storage/schema/main/delta/92/04_ss_membership_snapshot_idx.sql -@@ -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', '{}'); --- -2.49.0 -