From 7c805f00a787b53b0eacddb9cb4b5470b9c8d135 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Tue, 6 Feb 2024 16:33:19 +0000 Subject: [PATCH 1/3] 1.101.0rc1 --- CHANGES.md | 32 ++++++++++++++++++++++++++++++++ changelog.d/16842.misc | 1 - changelog.d/16853.doc | 1 - changelog.d/16854.doc | 1 - changelog.d/16880.doc | 1 - debian/changelog | 6 ++++++ pyproject.toml | 2 +- 7 files changed, 39 insertions(+), 5 deletions(-) delete mode 100644 changelog.d/16842.misc delete mode 100644 changelog.d/16853.doc delete mode 100644 changelog.d/16854.doc delete mode 100644 changelog.d/16880.doc diff --git a/CHANGES.md b/CHANGES.md index 10361b73e4..e48e97eeff 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,35 @@ +# Synapse 1.101.0rc1 (2024-02-06) + +### Improved Documentation + +- Fix broken links in the documentation. ([\#16853](https://github.com/element-hq/synapse/issues/16853)) +- Update MacOS installation instructions to mention that libicu is optional. ([\#16854](https://github.com/element-hq/synapse/issues/16854)) +- The version picker now correctly lists versions after `v1.98.0`. ([\#16880](https://github.com/element-hq/synapse/issues/16880)) + +### Internal Changes + +- Add support for stabilised [MSC3981](https://github.com/matrix-org/matrix-spec-proposals/pull/3981) that adds a `recurse` parameter on the `/relations` API. ([\#16842](https://github.com/element-hq/synapse/issues/16842)) + + + +### Updates to locked dependencies + +* Bump dorny/paths-filter from 2 to 3. ([\#16869](https://github.com/element-hq/synapse/issues/16869)) +* Bump gitpython from 3.1.40 to 3.1.41. ([\#16850](https://github.com/element-hq/synapse/issues/16850)) +* Bump hiredis from 2.2.3 to 2.3.2. ([\#16862](https://github.com/element-hq/synapse/issues/16862)) +* Bump jsonschema from 4.20.0 to 4.21.1. ([\#16887](https://github.com/element-hq/synapse/issues/16887)) +* Bump lxml-stubs from 0.4.0 to 0.5.1. ([\#16885](https://github.com/element-hq/synapse/issues/16885)) +* Bump mypy-zope from 1.0.1 to 1.0.3. ([\#16865](https://github.com/element-hq/synapse/issues/16865)) +* Bump phonenumbers from 8.13.26 to 8.13.29. ([\#16868](https://github.com/element-hq/synapse/issues/16868)) +* Bump pydantic from 2.5.3 to 2.6.0. ([\#16888](https://github.com/element-hq/synapse/issues/16888)) +* Bump sentry-sdk from 1.39.1 to 1.40.0. ([\#16889](https://github.com/element-hq/synapse/issues/16889)) +* Bump serde from 1.0.195 to 1.0.196. ([\#16867](https://github.com/element-hq/synapse/issues/16867)) +* Bump serde_json from 1.0.111 to 1.0.113. ([\#16866](https://github.com/element-hq/synapse/issues/16866)) +* Bump sigstore/cosign-installer from 3.3.0 to 3.4.0. ([\#16890](https://github.com/element-hq/synapse/issues/16890)) +* Bump types-pillow from 10.1.0.2 to 10.2.0.20240125. ([\#16864](https://github.com/element-hq/synapse/issues/16864)) +* Bump types-requests from 2.31.0.10 to 2.31.0.20240125. ([\#16886](https://github.com/element-hq/synapse/issues/16886)) +* Bump types-setuptools from 69.0.0.0 to 69.0.0.20240125. ([\#16863](https://github.com/element-hq/synapse/issues/16863)) + # Synapse 1.100.0 (2024-01-30) No significant changes since 1.100.0rc3. diff --git a/changelog.d/16842.misc b/changelog.d/16842.misc deleted file mode 100644 index 022ace7d95..0000000000 --- a/changelog.d/16842.misc +++ /dev/null @@ -1 +0,0 @@ -Add support for stabilised [MSC3981](https://github.com/matrix-org/matrix-spec-proposals/pull/3981) that adds a `recurse` parameter on the `/relations` API. diff --git a/changelog.d/16853.doc b/changelog.d/16853.doc deleted file mode 100644 index 9ac13ed29f..0000000000 --- a/changelog.d/16853.doc +++ /dev/null @@ -1 +0,0 @@ -Fix broken links in the documentation. diff --git a/changelog.d/16854.doc b/changelog.d/16854.doc deleted file mode 100644 index f08a5f4be2..0000000000 --- a/changelog.d/16854.doc +++ /dev/null @@ -1 +0,0 @@ -Update MacOS installation instructions to mention that libicu is optional. diff --git a/changelog.d/16880.doc b/changelog.d/16880.doc deleted file mode 100644 index 0500cb3eca..0000000000 --- a/changelog.d/16880.doc +++ /dev/null @@ -1 +0,0 @@ -The version picker now correctly lists versions after `v1.98.0`. diff --git a/debian/changelog b/debian/changelog index d5262653ad..48604eb1d0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +matrix-synapse-py3 (1.101.0~rc1) stable; urgency=medium + + * New Synapse release 1.101.0rc1. + + -- Synapse Packaging team Tue, 06 Feb 2024 16:02:02 +0000 + matrix-synapse-py3 (1.100.0) stable; urgency=medium * New Synapse release 1.100.0. diff --git a/pyproject.toml b/pyproject.toml index a3c5c242ed..4bd4439694 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -96,7 +96,7 @@ module-name = "synapse.synapse_rust" [tool.poetry] name = "matrix-synapse" -version = "1.100.0" +version = "1.101.0rc1" description = "Homeserver for the Matrix decentralised comms protocol" authors = ["Matrix.org Team and Contributors "] license = "AGPL-3.0-or-later" From 02a147039cc1694b1ea3d80636697b11e6a4461b Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 9 Feb 2024 10:51:00 +0000 Subject: [PATCH 2/3] Increase batching when fetching auth chains (#16893) This basically reverts a change that was in https://github.com/element-hq/synapse/pull/16833, where we reduced the batching. The smaller batching can cause performance issues on busy servers and databases. --- changelog.d/16893.bugfix | 1 + synapse/storage/databases/main/event_federation.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changelog.d/16893.bugfix diff --git a/changelog.d/16893.bugfix b/changelog.d/16893.bugfix new file mode 100644 index 0000000000..7222cd765c --- /dev/null +++ b/changelog.d/16893.bugfix @@ -0,0 +1 @@ +Fix performance regression when fetching auth chains from the DB. Introduced in v1.100.0. diff --git a/synapse/storage/databases/main/event_federation.py b/synapse/storage/databases/main/event_federation.py index 12e882062a..846c3f363a 100644 --- a/synapse/storage/databases/main/event_federation.py +++ b/synapse/storage/databases/main/event_federation.py @@ -310,7 +310,7 @@ class EventFederationWorkerStore(SignatureWorkerStore, EventsWorkerStore, SQLBas # Add all linked chains reachable from initial set of chains. chains_to_fetch = set(event_chains.keys()) while chains_to_fetch: - batch2 = tuple(itertools.islice(chains_to_fetch, 100)) + batch2 = tuple(itertools.islice(chains_to_fetch, 1000)) chains_to_fetch.difference_update(batch2) clause, args = make_in_list_sql_clause( txn.database_engine, "origin_chain_id", batch2 @@ -593,7 +593,7 @@ class EventFederationWorkerStore(SignatureWorkerStore, EventsWorkerStore, SQLBas # the loop) chains_to_fetch = set(seen_chains) while chains_to_fetch: - batch2 = tuple(itertools.islice(chains_to_fetch, 100)) + batch2 = tuple(itertools.islice(chains_to_fetch, 1000)) clause, args = make_in_list_sql_clause( txn.database_engine, "origin_chain_id", batch2 ) From bfa93d1d3ba880244cbb8e8420832db1563bf6c3 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 9 Feb 2024 10:51:11 +0000 Subject: [PATCH 3/3] Only do one concurrent fetch per server in keyring (#16894) Otherwise if we've stacked a bunch of requests for the keys of a server, we'll end up sending lots of concurrent requests for its keys, needlessly. --- changelog.d/16894.bugfix | 1 + synapse/crypto/keyring.py | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 changelog.d/16894.bugfix diff --git a/changelog.d/16894.bugfix b/changelog.d/16894.bugfix new file mode 100644 index 0000000000..7e05370be7 --- /dev/null +++ b/changelog.d/16894.bugfix @@ -0,0 +1 @@ +Do not send multiple concurrent requests for keys for the same server. diff --git a/synapse/crypto/keyring.py b/synapse/crypto/keyring.py index 1e7e5f70fe..8c301e077c 100644 --- a/synapse/crypto/keyring.py +++ b/synapse/crypto/keyring.py @@ -839,11 +839,12 @@ class ServerKeyFetcher(BaseV2KeyFetcher): Map from server_name -> key_id -> FetchKeyResult """ + # We only need to do one request per server. + servers_to_fetch = {k.server_name for k in keys_to_fetch} + results = {} - async def get_keys(key_to_fetch_item: _FetchKeyRequest) -> None: - server_name = key_to_fetch_item.server_name - + async def get_keys(server_name: str) -> None: try: keys = await self.get_server_verify_keys_v2_direct(server_name) results[server_name] = keys @@ -852,7 +853,7 @@ class ServerKeyFetcher(BaseV2KeyFetcher): except Exception: logger.exception("Error getting keys from %s", server_name) - await yieldable_gather_results(get_keys, keys_to_fetch) + await yieldable_gather_results(get_keys, servers_to_fetch) return results async def get_server_verify_keys_v2_direct(