element-hq / element-hq/synapse

event_forward_extremities are not correctly cleared by persistence of successor events

Open
#8,913 0 comments 0 reactions 0 assignees View on GitHub
A-DAG A-Federation A-Performance O-Uncommon S-Tolerable T-Defect
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#8913](https://github.com/matrix-org/synapse/issues/8913).

---

Suppose:
* we have a linear event DAG, `A <- B <- ... <- C`, where C is a regular event, which references B in its state.
* our homeserver has persisted up to event A, hence has a single `event_forward_extremity` of A.
* our homeserver goes offline for a bit, so misses out on B and immediate successors
* our homeserver receives C over federation, hence pulls in B to complete the state at C

Empirically:
* we have all the state we need for B: it is *not* marked as an outlier
* we end up with `event_forward_extremities` of A and C

We have all the successors for A we should ever expect to receive, so I assert that it should no longer be considered an extremity. In particular, there is no way it will ever cease to be a forward extremity, so it contributes to the accumulation of forward extremities (cf #1760).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.