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

Commit 6e084b6

Browse files
Rename remove_deleted_devices_from_device_inbox to ensure it is always run (#11353)
Co-authored-by: reivilibre <oliverw@matrix.org>
1 parent 9c59e11 commit 6e084b6

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

changelog.d/11353.misc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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.

synapse/storage/schema/main/delta/65/05remove_deleted_devices_from_device_inbox.sql renamed to synapse/storage/schema/main/delta/65/06remove_deleted_devices_from_device_inbox.sql

+13-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,17 @@
1818
-- when a device was deleted using Synapse earlier than 1.47.0.
1919
-- This runs as background task, but may take a bit to finish.
2020

21+
-- Remove any existing instances of this job running. It's OK to stop and restart this job,
22+
-- as it's just deleting entries from a table - no progress will be lost.
23+
--
24+
-- This is necessary due a similar migration running the job accidentally
25+
-- being included in schema version 64 during v1.47.0rc1,rc2. If a
26+
-- homeserver had updated from Synapse <=v1.45.0 (schema version <=64),
27+
-- then they would have started running this background update already.
28+
-- If that update was still running, then simply inserting it again would
29+
-- cause an SQL failure. So we effectively do an "upsert" here instead.
30+
31+
DELETE FROM background_updates WHERE update_name = 'remove_deleted_devices_from_device_inbox';
32+
2133
INSERT INTO background_updates (ordering, update_name, progress_json) VALUES
22-
(6505, 'remove_deleted_devices_from_device_inbox', '{}');
34+
(6506, 'remove_deleted_devices_from_device_inbox', '{}');

0 commit comments

Comments
 (0)