Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Fix duplicate remove_deleted_devices_... bg update #11353

Merged
merged 4 commits into from
Nov 16, 2021
Merged
Show file tree
Hide file tree
Changes from 3 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/11353.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix an issue which prevented the 'remove deleted devices from device_inbox column' background process from running when updating from a recent Synapse version.
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,17 @@
-- when a device was deleted using Synapse earlier than 1.47.0.
-- This runs as background task, but may take a bit to finish.

-- Remove any existing instances of this job running. It's OK to stop and restart this job,
-- as it's just deleting entries from a table - no progress will be lost.
--
-- This is necessary due a similar migration running the job accidentally
-- being included in schema version 64 during v1.47.0rc1,rc2. If a
-- homeserver had updated from Synapse <=v1.45.0 (schema version <=64),
-- then they would have started running this background update already.
-- If that update was still running, then simply inserting it again would
-- cause an SQL failure. So we effectively do an "upsert" here instead.

DELETE FROM background_updates WHERE update_name = 'remove_deleted_devices_from_device_inbox';

INSERT INTO background_updates (ordering, update_name, progress_json) VALUES
(6505, 'remove_deleted_devices_from_device_inbox', '{}');
(6506, 'remove_deleted_devices_from_device_inbox', '{}');