Add missing ordering to background updates (#8850)

It's important that we make sure our background updates happen in a defined
order, to avoid disasters like #6923.

Add an ordering to all of the background updates that have landed since #7190.
This commit is contained in:
Richard van der Hoff 2020-12-01 15:52:49 +00:00 committed by GitHub
parent 3f0cba657c
commit 9edff901d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 12 deletions

1
changelog.d/8850.misc Normal file
View File

@ -0,0 +1 @@
Add missing `ordering` to background database updates.

View File

@ -20,14 +20,14 @@
*/ */
-- add new index that includes method to local media -- add new index that includes method to local media
INSERT INTO background_updates (update_name, progress_json) VALUES INSERT INTO background_updates (ordering, update_name, progress_json) VALUES
('local_media_repository_thumbnails_method_idx', '{}'); (5807, 'local_media_repository_thumbnails_method_idx', '{}');
-- add new index that includes method to remote media -- add new index that includes method to remote media
INSERT INTO background_updates (update_name, progress_json, depends_on) VALUES INSERT INTO background_updates (ordering, update_name, progress_json, depends_on) VALUES
('remote_media_repository_thumbnails_method_idx', '{}', 'local_media_repository_thumbnails_method_idx'); (5807, 'remote_media_repository_thumbnails_method_idx', '{}', 'local_media_repository_thumbnails_method_idx');
-- drop old index -- drop old index
INSERT INTO background_updates (update_name, progress_json, depends_on) VALUES INSERT INTO background_updates (ordering, update_name, progress_json, depends_on) VALUES
('media_repository_drop_index_wo_method', '{}', 'remote_media_repository_thumbnails_method_idx'); (5807, 'media_repository_drop_index_wo_method', '{}', 'remote_media_repository_thumbnails_method_idx');

View File

@ -28,5 +28,5 @@
-- functionality as the old one. This effectively restarts the background job -- functionality as the old one. This effectively restarts the background job
-- from the beginning, without running it twice in a row, supporting both -- from the beginning, without running it twice in a row, supporting both
-- upgrade usecases. -- upgrade usecases.
INSERT INTO background_updates (update_name, progress_json) VALUES INSERT INTO background_updates (ordering, update_name, progress_json) VALUES
('populate_stats_process_rooms_2', '{}'); (5812, 'populate_stats_process_rooms_2', '{}');

View File

@ -1,2 +1,2 @@
INSERT INTO background_updates (update_name, progress_json) VALUES INSERT INTO background_updates (ordering, update_name, progress_json) VALUES
('users_have_local_media', '{}'); (5822, 'users_have_local_media', '{}');

View File

@ -13,5 +13,5 @@
* limitations under the License. * limitations under the License.
*/ */
INSERT INTO background_updates (update_name, progress_json) VALUES INSERT INTO background_updates (ordering, update_name, progress_json) VALUES
('e2e_cross_signing_keys_idx', '{}'); (5823, 'e2e_cross_signing_keys_idx', '{}');