This repository was archived by the owner on Apr 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ Fix a long-standing bug where the `cache_invalidation_stream_seq` sequence would begin at 1 instead of 2.
Original file line number Diff line number Diff line change 7676 - event_edges.(room_id, is_state) are no longer written to.
7777 - Tables related to groups are dropped.
7878 - Unused column application_services_state.last_txn is dropped
79+ - Cache invalidation stream id sequence now begins at 2 to match code expectation.
7980"""
8081
8182
Original file line number Diff line number Diff line change 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+
17+ -- The sequence needs to begin at 2 because a bunch of code assumes that
18+ -- get_next_id_txn will return values >= 2, cf this comment:
19+ -- https://github.com/matrix-org/synapse/blob/b93bd95e8ab64d27ae26841020f62ee61272a5f2/synapse/storage/util/id_generators.py#L344
20+
21+ SELECT setval('cache_invalidation_stream_seq', (
22+ SELECT COALESCE(MAX(last_value), 1) FROM cache_invalidation_stream_seq
23+ ));
You can’t perform that action at this time.
0 commit comments