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

Fix races in room stats (and other) updates. #6187

Merged
merged 5 commits into from
Oct 10, 2019
Merged

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Oct 9, 2019

Hopefully this will fix the occasional failures we were seeing in the room directory.

The problem was that events are not necessarily persisted (and current_state_delta_stream updated) in the same order as their stream_id. So for instance current_state_delta 9 might be persisted before current_state_delta 8. Then, when the room stats saw stream_id 9, it assumed it had done everything up to 9, and never came back to do stream_id 8.

We can solve this easily by only processing up to the stream_id where we know all events have been persisted.

Hopefully this will fix the occasional failures we were seeing in the room
directory.

The problem was that events are not necessarily persisted (and
current_state_delta_stream updated) in the same order as their stream_id. So
for instance current_state_delta 9 might be persisted *before*
current_state_delta 8. Then, when the room stats saw stream_id 9, it assumed it
had done everything up to 9, and never came back to do stream_id 8.

We can solve this easily by only processing up to the stream_id where we know
all events have been persisted.
@richvdh richvdh requested a review from a team October 9, 2019 11:59
@richvdh richvdh merged commit a139420 into develop Oct 10, 2019
@richvdh richvdh deleted the rav/fix_room_stats branch October 10, 2019 10:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants