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

Commit d7a94a7

Browse files
authored
Add upgrade notes about disk space for events migration (#10314)
1 parent 7a58732 commit d7a94a7

File tree

3 files changed

+44
-1
lines changed

3 files changed

+44
-1
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Synapse 1.38.0 (**UNRELEASED**)
2+
===============================
3+
This release includes a database schema update which could result in elevated disk usage. See the [upgrade notes](https://matrix-org.github.io/synapse/develop/upgrade.md#upgrading-to-v1380) for more information.
4+
15
Synapse 1.37.1 (2021-06-30)
26
===========================
37

changelog.d/10314.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix a long-standing bug where Synapse would return errors after 2<sup>31</sup> events were handled by the server.

docs/upgrade.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,45 @@ process, for example:
8484
wget https://packages.matrix.org/debian/pool/main/m/matrix-synapse-py3/matrix-synapse-py3_1.3.0+stretch1_amd64.deb
8585
dpkg -i matrix-synapse-py3_1.3.0+stretch1_amd64.deb
8686
```
87-
87+
88+
89+
# Upgrading to v1.38.0
90+
91+
## Re-indexing of `events` table on Postgres databases
92+
93+
This release includes a database schema update which requires re-indexing one of
94+
the larger tables in the database, `events`. This could result in increased
95+
disk I/O for several hours or days after upgrading while the migration
96+
completes. Furthermore, because we have to keep the old indexes until the new
97+
indexes are ready, it could result in a significant, temporary, increase in
98+
disk space.
99+
100+
To get a rough idea of the disk space required, check the current size of one
101+
of the indexes. For example, from a `psql` shell, run the following sql:
102+
103+
```sql
104+
SELECT pg_size_pretty(pg_relation_size('events_order_room'));
105+
```
106+
107+
We need to rebuild **four** indexes, so you will need to multiply this result
108+
by four to give an estimate of the disk space required. For example, on one
109+
particular server:
110+
111+
```
112+
synapse=# select pg_size_pretty(pg_relation_size('events_order_room'));
113+
pg_size_pretty
114+
----------------
115+
288 MB
116+
(1 row)
117+
```
118+
119+
On this server, it would be wise to ensure that at least 1152MB are free.
120+
121+
The additional disk space will be freed once the migration completes.
122+
123+
SQLite databases are unaffected by this change.
124+
125+
88126
# Upgrading to v1.37.0
89127

90128
## Deprecation of the current spam checker interface

0 commit comments

Comments
 (0)