example 1 for gedisa missing messages #51
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
One of two potential options. Unfinished:
get_missing_events
response to be smarterThis will send additional forward extremities that are in existence during a remote room join to the remote server requesting the join but not to other servers that may already be in the room.
The order of events:
A.
make_join
from remote serverB. a message sent from local server
C.
make_join
response from local server that does not include the message as aprev_event
send_join
from remote server, response from local serverA. partial state join begins
/send
endpoint, saves it in a queue until the partial state join begins syncing additional room stateA. remote server places a
backfill
request(which starts at theinvite
event, because of how backfill points are calculated)B. remote server places a
get_missing_events
request, trying to retrieve events between the join event and the message event(spoiler: there are none).latest_events
being the message event andearliest_events
being the join, because that is how the stream orderings look on the remote server. The SQL for answering aget_missing_events
request just does a walk throughevent_edges
based onprev_events
, and returns up to thelimit
requested. The added wrinkle that the spec says that/get_missing_events
is only supposed to returnprev_events
related to(in this case) the message event means that making/get_missing_events
smarter is rather difficult.The
backfill
and theget_missing_events
are technically a race, in that both are essentially retrieving the same data twice. The default limit placed for/get_missing_events
is 10. So it may be likely that this is not a large problem, although it is technically doubling the work. Since they are both making events de-outliered, neither can see that they are doing double duty. So:I applied a Linearizer to try and mitigate this, I don't recall if it worked or not.