This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Avoid /backfill
when we already have enough messages to return for a /messages
response
#15696
Labels
A-Federation
A-Messages-Endpoint
/messages client API endpoint (`RoomMessageListRestServlet`) (which also triggers /backfill)
A-Performance
Performance, both client-facing and admin-facing
O-Occasional
Affects or can be seen by some users regularly or most users rarely
S-Minor
Blocks non-critical functionality, workarounds exist.
T-Enhancement
New features, changes in functionality, improvements in performance, or user-facing enhancements.
Milestone
Avoid
/backfill
when we already have enough messages to return for a/messages
responseAs you can see from the trace, if we were somehow smart enough to know not to
/backfill
, we would save ourselves 14s from that 16.42s request. In this example, there is only a single new event out of the 100 returned in the/backfill
response that is "new" to us and it's one that already has failed pull attempts so we end up skipping it anyway because of expontential backoff. This is definitely a candidate where we didn't need to/backfill
!Full Jaeger trace JSON
Questions
What kind of heuristic can we use to know that we have enough messages to respond to
/messages
request? In other words, it's fine to have small holes (especially with cases where we've attempted to fill the hole before) but if we're missing a big chunk of history, then we probably should try/backfill
.Perhaps we can look at the depth of the continuous set of messages and if there isn't too big of a gap between them, we can consider it good enough. Maybe potentially still trigger a
/backfill
in the background so things can become eventually consistent.The text was updated successfully, but these errors were encountered: