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

Commit dacc395

Browse files
committed
Merge remote-tracking branch 'origin/develop' into hs/hacked-together-event-cache
2 parents 6a20b4f + 63fb220 commit dacc395

File tree

364 files changed

+1599
-399
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

364 files changed

+1599
-399
lines changed

.buildkite/scripts/create_postgres_db.py

Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env python
2+
# Copyright 2019 The Matrix.org Foundation C.I.C.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
import sys
17+
18+
import psycopg2
19+
20+
# a very simple replacment for `psql`, to make up for the lack of the postgres client
21+
# libraries in the synapse docker image.
22+
23+
# We use "postgres" as a database because it's bound to exist and the "synapse" one
24+
# doesn't exist yet.
25+
db_conn = psycopg2.connect(
26+
user="postgres", host="postgres", password="postgres", dbname="postgres"
27+
)
28+
db_conn.autocommit = True
29+
cur = db_conn.cursor()
30+
for c in sys.argv[1:]:
31+
cur.execute(c)

.buildkite/scripts/test_synapse_port_db.sh

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/usr/bin/env bash
22
#
3-
# Test script for 'synapse_port_db', which creates a virtualenv, installs Synapse along
4-
# with additional dependencies needed for the test (such as coverage or the PostgreSQL
5-
# driver), update the schema of the test SQLite database and run background updates on it,
6-
# create an empty test database in PostgreSQL, then run the 'synapse_port_db' script to
7-
# test porting the SQLite database to the PostgreSQL database (with coverage).
3+
# Test script for 'synapse_port_db'.
4+
# - sets up synapse and deps
5+
# - runs the port script on a prepopulated test sqlite db
6+
# - also runs it against an new sqlite db
7+
88

99
set -xe
1010
cd `dirname $0`/../..
@@ -22,15 +22,32 @@ echo "--- Generate the signing key"
2222
# Generate the server's signing key.
2323
python -m synapse.app.homeserver --generate-keys -c .buildkite/sqlite-config.yaml
2424

25-
echo "--- Prepare the databases"
25+
echo "--- Prepare test database"
2626

2727
# Make sure the SQLite3 database is using the latest schema and has no pending background update.
2828
scripts-dev/update_database --database-config .buildkite/sqlite-config.yaml
2929

3030
# Create the PostgreSQL database.
31-
./.buildkite/scripts/create_postgres_db.py
31+
./.buildkite/scripts/postgres_exec.py "CREATE DATABASE synapse"
32+
33+
echo "+++ Run synapse_port_db against test database"
34+
coverage run scripts/synapse_port_db --sqlite-database .buildkite/test_db.db --postgres-config .buildkite/postgres-config.yaml
35+
36+
#####
37+
38+
# Now do the same again, on an empty database.
39+
40+
echo "--- Prepare empty SQLite database"
41+
42+
# we do this by deleting the sqlite db, and then doing the same again.
43+
rm .buildkite/test_db.db
44+
45+
scripts-dev/update_database --database-config .buildkite/sqlite-config.yaml
3246

33-
echo "+++ Run synapse_port_db"
47+
# re-create the PostgreSQL database.
48+
./.buildkite/scripts/postgres_exec.py \
49+
"DROP DATABASE synapse" \
50+
"CREATE DATABASE synapse"
3451

35-
# Run the script
52+
echo "+++ Run synapse_port_db against empty database"
3653
coverage run scripts/synapse_port_db --sqlite-database .buildkite/test_db.db --postgres-config .buildkite/postgres-config.yaml

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ jobs:
273273
python-version: ${{ matrix.python-version }}
274274
- name: Patch Buildkite-specific test scripts
275275
run: |
276-
sed -i -e 's/host="postgres"/host="localhost"/' .buildkite/scripts/create_postgres_db.py
276+
sed -i -e 's/host="postgres"/host="localhost"/' .buildkite/scripts/postgres_exec.py
277277
sed -i -e 's/host: postgres/host: localhost/' .buildkite/postgres-config.yaml
278278
sed -i -e 's|/src/||' .buildkite/{sqlite,postgres}-config.yaml
279279
sed -i -e 's/\$TOP/\$GITHUB_WORKSPACE/' .coveragerc

CHANGES.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
Synapse 1.33.2 (2021-05-11)
2+
===========================
3+
4+
Due to the security issue highlighted below, server administrators are encouraged to update Synapse. We are not aware of these vulnerabilities being exploited in the wild.
5+
6+
Security advisory
7+
-----------------
8+
9+
This release fixes a denial of service attack ([CVE-2021-29471](https://github.com/matrix-org/synapse/security/advisories/GHSA-x345-32rc-8h85)) against Synapse's push rules implementation. Server admins are encouraged to upgrade.
10+
11+
Internal Changes
12+
----------------
13+
14+
- Unpin attrs dependency. ([\#9946](https://github.com/matrix-org/synapse/issues/9946))
15+
16+
17+
Synapse 1.33.1 (2021-05-06)
18+
===========================
19+
20+
Bugfixes
21+
--------
22+
23+
- Fix bug where `/sync` would break if using the latest version of `attrs` dependency, by pinning to a previous version. ([\#9937](https://github.com/matrix-org/synapse/issues/9937))
24+
25+
126
Synapse 1.33.0 (2021-05-05)
227
===========================
328

UPGRADE.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,35 @@ for example:
8585
wget https://packages.matrix.org/debian/pool/main/m/matrix-synapse-py3/matrix-synapse-py3_1.3.0+stretch1_amd64.deb
8686
dpkg -i matrix-synapse-py3_1.3.0+stretch1_amd64.deb
8787
88+
Upgrading to v1.34.0
89+
====================
90+
91+
`room_invite_state_types` configuration setting
92+
-----------------------------------------------
93+
94+
The ``room_invite_state_types`` configuration setting has been deprecated and
95+
replaced with ``room_prejoin_state``. See the `sample configuration file <https://github.com/matrix-org/synapse/blob/v1.34.0/docs/sample_config.yaml#L1515>`_.
96+
97+
If you have set ``room_invite_state_types`` to the default value you should simply
98+
remove it from your configuration file. The default value used to be:
99+
100+
.. code:: yaml
101+
102+
room_invite_state_types:
103+
- "m.room.join_rules"
104+
- "m.room.canonical_alias"
105+
- "m.room.avatar"
106+
- "m.room.encryption"
107+
- "m.room.name"
108+
109+
If you have customised this value by adding addition state types, you should
110+
remove ``room_invite_state_types`` and configure ``additional_event_types`` with
111+
your customisations.
112+
113+
If you have customised this value by removing state types, you should rename
114+
``room_invite_state_types`` to ``additional_event_types``, and set
115+
``disable_default_event_types`` to ``true``.
116+
88117
Upgrading to v1.33.0
89118
====================
90119

changelog.d/9881.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add experimental option to track memory usage of the caches.

changelog.d/9882.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Export jemalloc stats to Prometheus if it is being used.

changelog.d/9902.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add limits to how often Synapse will GC, ensuring that large servers do not end up GC thrashing if `gc_thresholds` has not been correctly set.

changelog.d/9905.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improve performance of sending events for worker-based deployments using Redis.

0 commit comments

Comments
 (0)