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

Use a sequence to generate AS transaction IDs, drop last_txn AS state #12209

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion changelog.d/12209.misc
@@ -1 +1 @@
Switch to using a sequence to generate AS transaction IDs. Contributed by Nick Beeper.
Switch to using a sequence to generate AS transaction IDs. Contributed by Nick Beeper. If running synapse with a dedicated appservice worker, this MUST be shutdown before upgrading the main process and database.
richvdh marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion synapse/storage/databases/main/appservice.py
Expand Up @@ -31,7 +31,7 @@
from synapse.storage.databases.main.roommember import RoomMemberWorkerStore
from synapse.storage.types import Cursor
from synapse.storage.util.sequence import build_sequence_generator
from synapse.types import JsonDict
from synapse.types import DeviceListUpdates, JsonDict
from synapse.util import json_encoder
from synapse.util.caches.descriptors import _CacheContext, cached

Expand Down
5 changes: 4 additions & 1 deletion synapse/storage/schema/__init__.py
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

SCHEMA_VERSION = 68 # remember to update the list below when updating
SCHEMA_VERSION = 69 # remember to update the list below when updating
"""Represents the expectations made by the codebase about the database schema

This should be incremented whenever the codebase changes its requirements on the
Expand Down Expand Up @@ -58,6 +58,9 @@
- event_reference_hashes is no longer read.
- `events` has `state_key` and `rejection_reason` columns, which are populated for
new events.

Changes in SCHEMA_VERSION = 69:
- Use sequence to generate future `application_services_txns.txn_id`s
"""


Expand Down
Expand Up @@ -42,7 +42,3 @@ def run_create(cur, database_engine, *args, **kwargs):
"CREATE SEQUENCE application_services_txn_id_seq START WITH %s",
(start_val,),
)


def run_upgrade(*args, **kwargs):
pass