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

Commit 643c0c5

Browse files
authored
Update UPGRADE notes to include more details about v1.57 upgrade failure mode (#12448)
1 parent e31d06f commit 643c0c5

File tree

1 file changed

+47
-8
lines changed

1 file changed

+47
-8
lines changed

docs/upgrade.md

Lines changed: 47 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,45 @@ without any risk of reusing transaction IDs.
9898
Deployments which do not use separate worker processes can be upgraded as normal. Similarly,
9999
deployments where no applciation services are in use can be upgraded as normal.
100100

101+
<details>
102+
<summary><b>Recovering from an incorrect upgrade</b></summary>
103+
104+
If the database schema is upgraded *without* stopping the worker responsible
105+
for AS traffic, then the following error may be given when attempting to start
106+
a Synapse worker or master process:
107+
108+
```
109+
**********************************************************************************
110+
Error during initialisation:
111+
112+
Postgres sequence 'application_services_txn_id_seq' is inconsistent with associated
113+
table 'application_services_txns'. This can happen if Synapse has been downgraded and
114+
then upgraded again, or due to a bad migration.
115+
116+
To fix this error, shut down Synapse (including any and all workers)
117+
and run the following SQL:
118+
119+
SELECT setval('application_services_txn_id_seq', (
120+
SELECT GREATEST(MAX(txn_id), 0) FROM application_services_txns
121+
));
122+
123+
See docs/postgres.md for more information.
124+
125+
There may be more information in the logs.
126+
**********************************************************************************
127+
```
128+
129+
This error may also be seen if Synapse is *downgraded* to an earlier version,
130+
and then upgraded again to v1.57.0 or later.
131+
132+
In either case:
133+
134+
1. Ensure that the worker responsible for AS traffic is stopped.
135+
2. Run the SQL command given in the error message via `psql`.
136+
137+
Synapse should then start correctly.
138+
</details>
139+
101140
# Upgrading to v1.56.0
102141
103142
## Open registration without verification is now disabled by default
@@ -132,15 +171,15 @@ The `synctl` script
132171
[has been made](https://github.com/matrix-org/synapse/pull/12140) an
133172
[entry point](https://packaging.python.org/en/latest/specifications/entry-points/)
134173
and no longer exists at the root of Synapse's source tree. If you wish to use
135-
`synctl` to manage your homeserver, you should invoke `synctl` directly, e.g.
136-
`synctl start` instead of `./synctl start` or `/path/to/synctl start`.
174+
`synctl` to manage your homeserver, you should invoke `synctl` directly, e.g.
175+
`synctl start` instead of `./synctl start` or `/path/to/synctl start`.
137176

138177
You will need to ensure `synctl` is on your `PATH`.
139178
- This is automatically the case when using
140179
[Debian packages](https://packages.matrix.org/debian/) or
141180
[docker images](https://hub.docker.com/r/matrixdotorg/synapse)
142181
provided by Matrix.org.
143-
- When installing from a wheel, sdist, or PyPI, a `synctl` executable is added
182+
- When installing from a wheel, sdist, or PyPI, a `synctl` executable is added
144183
to your Python installation's `bin`. This should be on your `PATH`
145184
automatically, though you might need to activate a virtual environment
146185
depending on how you installed Synapse.
@@ -176,8 +215,8 @@ the `/_matrix/client/` path.
176215

177216
## Stablisation of MSC3231
178217

179-
The unstable validity-check endpoint for the
180-
[Registration Tokens](https://spec.matrix.org/v1.2/client-server-api/#get_matrixclientv1registermloginregistration_tokenvalidity)
218+
The unstable validity-check endpoint for the
219+
[Registration Tokens](https://spec.matrix.org/v1.2/client-server-api/#get_matrixclientv1registermloginregistration_tokenvalidity)
181220
feature has been stabilised and moved from:
182221

183222
`/_matrix/client/unstable/org.matrix.msc3231/register/org.matrix.msc3231.login.registration_token/validity`
@@ -191,9 +230,9 @@ Please update any relevant reverse proxy or firewall configurations appropriatel
191230
## Time-based cache expiry is now enabled by default
192231

193232
Formerly, entries in the cache were not evicted regardless of whether they were accessed after storing.
194-
This behavior has now changed. By default entries in the cache are now evicted after 30m of not being accessed.
195-
To change the default behavior, go to the `caches` section of the config and change the `expire_caches` and
196-
`cache_entry_ttl` flags as necessary. Please note that these flags replace the `expiry_time` flag in the config.
233+
This behavior has now changed. By default entries in the cache are now evicted after 30m of not being accessed.
234+
To change the default behavior, go to the `caches` section of the config and change the `expire_caches` and
235+
`cache_entry_ttl` flags as necessary. Please note that these flags replace the `expiry_time` flag in the config.
197236
The `expiry_time` flag will still continue to work, but it has been deprecated and will be removed in the future.
198237

199238
## Deprecation of `capability` `org.matrix.msc3283.*`

0 commit comments

Comments
 (0)