|
| 1 | +/* Copyright 2022 The Matrix.org Foundation C.I.C |
| 2 | + * |
| 3 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | + * you may not use this file except in compliance with the License. |
| 5 | + * You may obtain a copy of the License at |
| 6 | + * |
| 7 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | + * |
| 9 | + * Unless required by applicable law or agreed to in writing, software |
| 10 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | + * See the License for the specific language governing permissions and |
| 13 | + * limitations under the License. |
| 14 | + */ |
| 15 | + |
| 16 | +-- If a Synapse deployment made a large jump in versions (from < 1.62.0 to >= 1.70.0) |
| 17 | +-- in a single upgrade then it might be possible for the event_push_summary_unique_index |
| 18 | +-- to be created in the background from delta 71/02event_push_summary_unique.sql after |
| 19 | +-- delta 73/06thread_notifications_thread_id_idx.sql is executed, causing it to |
| 20 | +-- not drop the event_push_summary_unique_index index. |
| 21 | +-- |
| 22 | +-- See https://github.com/matrix-org/synapse/issues/14641 |
| 23 | + |
| 24 | +-- Stop the index from being scheduled for creation in the background. |
| 25 | +DELETE FROM background_updates WHERE update_name = 'event_push_summary_unique_index'; |
| 26 | + |
| 27 | +-- The above background job also replaces another index, so ensure that side-effect |
| 28 | +-- is applied. |
| 29 | +DROP INDEX IF EXISTS event_push_summary_user_rm; |
| 30 | + |
| 31 | +-- Fix deployments which ran the 73/06thread_notifications_thread_id_idx.sql delta |
| 32 | +-- before the event_push_summary_unique_index background job was run. |
| 33 | +DROP INDEX IF EXISTS event_push_summary_unique_index; |
0 commit comments