summary refs log tree commit diff
path: root/changelog.d/7931.feature
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2020-07-23 18:38:19 +0100
committerGitHub <noreply@github.com>2020-07-23 18:38:19 +0100
commit7078866969758e52eec33ebdb8288e203d8bd2b7 (patch)
tree814050c5ec16f094711b267129ea5d7332f9de1b /changelog.d/7931.feature
parentAbort federation requests if the client disconnects early (#7930) (diff)
downloadsynapse-7078866969758e52eec33ebdb8288e203d8bd2b7.tar.xz
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.]
Diffstat (limited to 'changelog.d/7931.feature')
-rw-r--r--changelog.d/7931.feature1
1 files changed, 1 insertions, 0 deletions
diff --git a/changelog.d/7931.feature b/changelog.d/7931.feature
new file mode 100644
index 0000000000..30eb33048b
--- /dev/null
+++ b/changelog.d/7931.feature
@@ -0,0 +1 @@
+Cache responses to `/_matrix/federation/v1/state_ids` to reduce duplicated work.