forked-synapse/changelog.d
Eric Eastwood 40bb37eb27
Stop getting missing prev_events after we already know their signature is invalid (#13816)
While https://github.com/matrix-org/synapse/pull/13635 stops us from doing the slow thing after we've already done it once, this PR stops us from doing one of the slow things in the first place.

Related to
 - https://github.com/matrix-org/synapse/issues/13622
    - https://github.com/matrix-org/synapse/pull/13635
 - https://github.com/matrix-org/synapse/issues/13676

Part of https://github.com/matrix-org/synapse/issues/13356

Follow-up to https://github.com/matrix-org/synapse/pull/13815 which tracks event signature failures.

With this PR, we avoid the call to the costly `_get_state_ids_after_missing_prev_event` because the signature failure will count as an attempt before and we filter events based on the backoff before calling `_get_state_ids_after_missing_prev_event` now.

For example, this will save us 156s out of the 185s total that this `matrix.org` `/messages` request. If you want to see the full Jaeger trace of this, you can drag and drop this `trace.json` into your own Jaeger, https://gist.github.com/MadLittleMods/4b12d0d0afe88c2f65ffcc907306b761

To explain this exact scenario around `/messages` -> backfill, we call `/backfill` and first check the signatures of the 100 events. We see bad signature for `$luA4l7QHhf_jadH3mI-AyFqho0U2Q-IXXUbGSMq6h6M` and `$zuOn2Rd2vsC7SUia3Hp3r6JSkSFKcc5j3QTTqW_0jDw` (both member events). Then we process the 98 events remaining that have valid signatures but one of the events references `$luA4l7QHhf_jadH3mI-AyFqho0U2Q-IXXUbGSMq6h6M` as a `prev_event`. So we have to do the whole `_get_state_ids_after_missing_prev_event` rigmarole which pulls in those same events which fail again because the signatures are still invalid.

 - `backfill`
    - `outgoing-federation-request` `/backfill`
    - `_check_sigs_and_hash_and_fetch`
       - `_check_sigs_and_hash_and_fetch_one` for each event received over backfill
          -  `$luA4l7QHhf_jadH3mI-AyFqho0U2Q-IXXUbGSMq6h6M` fails with `Signature on retrieved event was invalid.`: `unable to verify signature for sender domain xxx: 401: Failed to find any key to satisfy: _FetchKeyRequest(...)`
          -  `$zuOn2Rd2vsC7SUia3Hp3r6JSkSFKcc5j3QTTqW_0jDw` fails with `Signature on retrieved event was invalid.`: `unable to verify signature for sender domain xxx: 401: Failed to find any key to satisfy: _FetchKeyRequest(...)`
   - `_process_pulled_events`
      - `_process_pulled_event` for each validated event
         -  Event `$Q0iMdqtz3IJYfZQU2Xk2WjB5NDF8Gg8cFSYYyKQgKJ0` references `$luA4l7QHhf_jadH3mI-AyFqho0U2Q-IXXUbGSMq6h6M` as a `prev_event` which is missing so we try to get it
            - `_get_state_ids_after_missing_prev_event`
               - `outgoing-federation-request` `/state_ids`
               -  `get_pdu` for `$luA4l7QHhf_jadH3mI-AyFqho0U2Q-IXXUbGSMq6h6M` which fails the signature check again
               -  `get_pdu` for `$zuOn2Rd2vsC7SUia3Hp3r6JSkSFKcc5j3QTTqW_0jDw` which fails the signature check
2022-10-15 00:36:49 -05:00
..
.gitignore
13394.feature Stabilize the threads API. (#14175) 2022-10-14 07:16:50 -04:00
13776.feature Use stable identifiers for MSC3771 & MSC3773. (#14050) 2022-10-07 09:26:40 -04:00
13813.bugfix Fix a bug where redactions were not being sent over federation if we did not have the original event. (#13813) 2022-10-11 11:18:45 -07:00
13816.feature Stop getting missing prev_events after we already know their signature is invalid (#13816) 2022-10-15 00:36:49 -05:00
13824.feature Use stable identifiers for MSC3771 & MSC3773. (#14050) 2022-10-07 09:26:40 -04:00
13877.feature Use stable identifiers for MSC3771 & MSC3773. (#14050) 2022-10-07 09:26:40 -04:00
13878.feature Use stable identifiers for MSC3771 & MSC3773. (#14050) 2022-10-07 09:26:40 -04:00
13955.docker Update frozendict 2.3.3 -> 2.3.4 (#13955) 2022-10-07 12:13:37 +01:00
13983.misc Bump actions/setup-python from 2 to 4 (#13983) 2022-10-04 12:24:36 +01:00
13984.misc Bump types-pyopenssl from 22.0.0 to 22.0.10 (#13984) 2022-10-04 12:27:41 +01:00
13985.misc Bump jsonschema from 4.4.0 to 4.16.0 (#13985) 2022-10-04 12:34:08 +01:00
13986.misc Bump types-setuptools from 57.4.9 to 65.4.0.0 (#13986) 2022-10-04 12:21:20 +01:00
13987.misc Bump types-requests from 2.27.11 to 2.28.11 (#13987) 2022-10-04 12:24:18 +01:00
13988.misc Bump isort from 5.7.0 to 5.10.1 (#13988) 2022-10-04 13:19:40 +01:00
13991.misc Remove get rooms for user with stream ordering (#13991) 2022-10-04 16:42:59 +01:00
13996.feature Send the appservice access token as a header. (#13996) 2022-10-04 07:06:41 -04:00
13997.feature Disable pushing for server ACL events (MSC3786). (#13997) 2022-10-04 07:08:27 -04:00
14006.misc update authlib from 0.15.5 to 1.1.0 (#14006) 2022-10-04 14:49:07 +00:00
14007.misc Making parse_server_name more consistent (#14007) 2022-10-11 12:42:11 +00:00
14028.feature Mark /relations endpoint as usable on workers. (#14028) 2022-10-12 06:46:13 -04:00
14032.feature Advertise support for Matrix 1.4. (#14184) 2022-10-14 13:21:55 +00:00
14033.misc Batch up notifications after event persistence (#14033) 2022-10-05 10:12:48 -07:00
14034.bugfix Apply & bundle edits for non-message events. (#14034) 2022-10-07 15:27:50 +00:00
14040.misc Bump msgpack from 1.0.3 to 1.0.4 (#14040) 2022-10-07 15:08:06 +01:00
14041.misc Bump types-pyyaml from 6.0.4 to 6.0.12 (#14041) 2022-10-04 15:53:47 +00:00
14043.misc Bump phonenumbers from 8.12.44 to 8.12.56 (#14043) 2022-10-07 15:17:00 +01:00
14044.misc Bump pydantic from 1.9.1 to 1.10.2 (#14044) 2022-10-07 15:08:24 +01:00
14046.misc Fix building wheels on OSX (#14046) 2022-10-04 14:59:30 +01:00
14050.feature Use stable identifiers for MSC3771 & MSC3773. (#14050) 2022-10-07 09:26:40 -04:00
14053.bugfix Fix handling of public rooms filter with a network tuple. (#14053) 2022-10-05 12:49:52 +00:00
14054.feature Use Pydantic to validate /devices endpoints (#14054) 2022-10-07 13:54:07 +01:00
14063.misc Complement test image: capture logs from nginx (#14063) 2022-10-05 17:37:34 +01:00
14065.misc Always close _all_ ijson coroutines, even if doing so raises Exceptions (#14065) 2022-10-06 18:17:50 +00:00
14072.misc Catch BrokenPipeError from metrics server, and log as a warning (#14072) 2022-10-07 13:35:44 +01:00
14077.doc Add sample worker files for pusher and federation_sender (#14077) 2022-10-07 14:25:28 +01:00
14078.doc Improve the listener example on the metrics documentation (#14078) 2022-10-07 14:54:01 +01:00
14081.doc Document Google OpenID Connect email attribute (#14081) 2022-10-07 14:22:25 +00:00
14083.bugfix Don't require optional invite_room_state field on fed v2 invite (#14083) 2022-10-14 13:48:33 +01:00
14087.doc The changelog entry ending in a . or ! is not optional (#14087) 2022-10-06 17:11:32 +00:00
14089.bugfix Be more lenient in the oEmbed response parsing. (#14089) 2022-10-07 09:29:43 -04:00
14092.misc Parse SYNAPSE_ASYNC_IO_REACTOR env variable & log the reactor on startup (#14092) 2022-10-07 15:19:59 +01:00
14093.doc Fix broken links to README (#14093) 2022-10-06 22:49:51 +00:00
14094.removal Remove the experimental implementation of MSC3772. (#14094) 2022-10-12 06:26:39 -04:00
14097.misc Indicate what endpoint came back with a JSON response we were unable to parse (#14097) 2022-10-07 11:39:45 -05:00
14102.bugfix Correct field name for stripped state events when knocking. knock_state_events -> knock_room_state (#14102) 2022-10-12 14:37:20 +01:00
14106.removal Remove support for the unstable dir flag on relations. (#14106) 2022-10-07 12:38:46 -04:00
14109.misc Batch up calls to get_rooms_for_users (#14109) 2022-10-12 11:36:22 +01:00
14113.misc Bump types-pillow from 9.0.15 to 9.2.2 (#14113) 2022-10-10 13:36:26 +01:00
14114.misc Bump types-psycopg2 from 2.9.9 to 2.9.21.1 (#14114) 2022-10-10 13:41:21 +01:00
14115.misc Bump idna from 3.3 to 3.4 (#14115) 2022-10-12 14:34:50 +01:00
14116.misc Bump bleach from 4.1.0 to 5.0.1 (#14116) 2022-10-12 14:37:04 +01:00
14124.doc Fix name of "alias_creation_rules" option in config manual (#14124) 2022-10-10 20:01:05 +00:00
14125.bugfix Fix a bug where the joined hosts for a given event were not being properly cached (#14125) 2022-10-12 11:01:00 -07:00
14132.misc Enable dependabot for Rust dependencies (#14132) 2022-10-11 12:26:40 +01:00
14134.misc Bump typing-extensions from 4.1.1 to 4.4.0 (#14134) 2022-10-12 14:37:36 +01:00
14140.feature Return the main timeline for events which are not part of a thread. (#14140) 2022-10-12 12:15:52 -04:00
14141.docker Use minimal Rust installation in docker images and CI (#14141) 2022-10-12 10:47:02 +01:00
14141.misc Use minimal Rust installation in docker images and CI (#14141) 2022-10-12 10:47:02 +01:00
14142.misc Remove the groups config code. (#14142) 2022-10-11 13:14:57 -04:00
14144.misc Handle gottestfmt repository move (#14144) 2022-10-11 17:54:06 +00:00
14146.removal Do not allow a None-limit on PaginationConfig. (#14146) 2022-10-14 12:30:05 +00:00
14159.feature Return the thread ID properly down sync. (#14159) 2022-10-12 12:18:34 -04:00
14163.feature Properly invalidate get_thread_id cache. (#14163) 2022-10-14 07:10:44 -04:00
14165.docker Strip whitespace from worker types in Dockerfile-workers (#14165) 2022-10-14 19:38:04 +00:00
14171.feature Fix changelog for #14171 to match #13394/#14175. 2022-10-14 08:56:37 -04:00
14174.feature Accept threaded receipts for events related to the root event. (#14174) 2022-10-14 18:05:25 +00:00
14175.feature Stabilize the threads API. (#14175) 2022-10-14 07:16:50 -04:00
14182.docker Set LD_PRELOAD to load jemalloc in Dockerfile-workers. (#14182) 2022-10-14 13:29:49 +01:00
14184.feature Advertise support for Matrix 1.4. (#14184) 2022-10-14 13:21:55 +00:00
14187.misc Bump types-pillow from 9.2.2 to 9.2.2.1 (#14187) 2022-10-15 00:16:25 +01:00
14188.misc Bump types-bleach from 4.1.4 to 5.0.3 (#14188) 2022-10-14 23:57:55 +00:00