synapse-product/synapse
Richard van der Hoff 7078866969
Put a cache on /state_ids (#7931)
If we send out an event which refers to `prev_events` which other servers in
the federation are missing, then (after a round or two of backfill attempts),
they will end up asking us for `/state_ids` at a particular point in the DAG.

As per https://github.com/matrix-org/synapse/issues/7893, this is quite
expensive, and we tend to see lots of very similar requests around the same
time.

We can therefore handle this much more efficiently by using a cache, which (a)
ensures that if we see the same request from multiple servers (or even the same
server, multiple times), then they share the result, and (b) any other servers
that miss the initial excitement can also benefit from the work.

[It's interesting to note that `/state` has a cache for exactly this
reason. `/state` is now essentially unused and replaced with `/state_ids`, but
evidently when we replaced it we forgot to add a cache to the new endpoint.]
2020-07-23 18:38:19 +01:00
..
_scripts Replace all remaining six usage with native Python 3 equivalents (#7704) 2020-06-16 08:51:47 -04:00
api Ensure that calls to json.dumps are compatible with the standard library json. (#7836) 2020-07-15 13:40:54 -04:00
app Convert synapse.app to async/await. (#7868) 2020-07-17 07:08:56 -04:00
appservice Include room states on invite events sent to ASes (#6455) 2020-07-10 18:44:56 +01:00
config Fix a typo in the sample config. (#7890) 2020-07-20 13:42:52 -04:00
crypto Replace all remaining six usage with native Python 3 equivalents (#7704) 2020-06-16 08:51:47 -04:00
events Fix deprecation warning: import ABC from collections.abc (#7892) 2020-07-20 13:33:04 -04:00
federation Put a cache on /state_ids (#7931) 2020-07-23 18:38:19 +01:00
groups Add HomeServer.signing_key property (#7805) 2020-07-08 17:51:56 +01:00
handlers Follow-up to admin API to re-activate accounts (#7908) 2020-07-22 12:33:19 -04:00
http Convert the federation agent and related code to async/await. (#7874) 2020-07-23 07:05:57 -04:00
logging Clean up PreserveLoggingContext (#7877) 2020-07-22 00:40:27 +01:00
metrics Improve stacktraces from exceptions in background processes (#7808) 2020-07-09 13:01:33 +01:00
module_api Wrap register_device coroutine in an ensureDeferred (#7684) 2020-06-16 10:13:59 +01:00
push Add ability to run multiple pusher instances (#7855) 2020-07-16 14:06:28 +01:00
replication Remove an unused prometheus metric (#7878) 2020-07-22 00:40:55 +01:00
res/templates Element CSS and logo in email templates (#7919) 2020-07-21 11:58:01 +01:00
rest Skip serializing /sync response if client has disconnected (#7927) 2020-07-22 13:44:16 +01:00
server_notices Replace all remaining six usage with native Python 3 equivalents (#7704) 2020-06-16 08:51:47 -04:00
spam_checker_api Add type hints to the spam check module (#6915) 2020-02-14 12:49:40 -05:00
state Add another yield point to state res v2 (#7746) 2020-06-26 10:44:52 +01:00
static Clean-up the fallback login code. (#7657) 2020-06-10 09:50:39 -04:00
storage Follow-up to admin API to re-activate accounts (#7908) 2020-07-22 12:33:19 -04:00
streams Fix some spelling mistakes / typos. (#7811) 2020-07-09 09:52:58 -04:00
util Fix deprecation warning: import ABC from collections.abc (#7892) 2020-07-20 13:33:04 -04:00
__init__.py 1.17.0 2020-07-13 10:20:36 +01:00
event_auth.py Fix recursion error when fetching auth chain over federation (#7817) 2020-07-10 18:15:35 +01:00
notifier.py Fix some spelling mistakes / typos. (#7811) 2020-07-09 09:52:58 -04:00
python_dependencies.py Allow to use higher versions of prometheus_client (#7780) 2020-07-06 10:21:41 +01:00
secrets.py isort 5 compatibility (#7786) 2020-07-05 16:32:02 +01:00
server.py Allow moving typing off master (#7869) 2020-07-16 15:12:54 +01:00
server.pyi Allow moving typing off master (#7869) 2020-07-16 15:12:54 +01:00
types.py isort 5 compatibility (#7786) 2020-07-05 16:32:02 +01:00
visibility.py Fix some spelling mistakes / typos. (#7811) 2020-07-09 09:52:58 -04:00