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

Refactor forward extremities #1556

Merged
merged 8 commits into from
Oct 21, 2020
Merged

Conversation

neilalexander
Copy link
Contributor

This is another refactor of forward extremities so that we don't check for references from outliers etc, which we were seemingly getting wrong even before the deep-checking PR.

It also adds a resolve-state utility for probing the resolved state for one or more state snapshots from the database, which is a useful debugging tool when trying to figure out where state changed/disappeared.

Copy link
Member

@kegsay kegsay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please summarise in a PR comment for posterity how the previous algorithm was wrong and how this PR fixes it. I grok your actions but I don't know how this is more correct than before.

@neilalexander
Copy link
Contributor Author

There are two things that this PR fixes.

The first is that, beforehand, we were checking if any event known to the roomserver was referencing a forward extremity rather than just known extremities. This included outliers and other events that weren't woven into the room topology yet, so it could cause us to accidentally get rid of forward extremities when we didn't really mean to (and any state after them in the process).

The PR now ensures that we're only checking references between extremities, so we might accumulate more extremities as a result, but we won't get rid of any until they've actually been superseded on the graph.

The second is that, because of the fact that we could potentially invalidate all of our extremities by outliers, that meant that we could potentially fall back on just using the new event and all of it's associated state, and it would never be resolved against potentially other good extremities.

@neilalexander neilalexander merged commit 534f9a9 into master Oct 21, 2020
@neilalexander neilalexander deleted the neilalexander/extremities branch October 21, 2020 14:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants