Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Put a cache on /state_ids #7931

Merged
merged 1 commit into from
Jul 23, 2020
Merged

Put a cache on /state_ids #7931

merged 1 commit into from
Jul 23, 2020

Commits on Jul 21, 2020

  1. Put a cache on /state_ids

    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 #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.]
    richvdh committed Jul 21, 2020
    Configuration menu
    Copy the full SHA
    8b9015a View commit details
    Browse the repository at this point in the history