Skip to content
Snippets Groups Projects
  1. Jul 30, 2020
  2. Jul 29, 2020
  3. Jul 28, 2020
  4. Jul 27, 2020
  5. Jul 24, 2020
  6. Jul 23, 2020
    • Patrick Cloke's avatar
    • Patrick Cloke's avatar
      83434df3
    • Richard van der Hoff's avatar
      Put a cache on `/state_ids` (#7931) · 70788669
      Richard van der Hoff authored
      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.]
      70788669
Loading