Richard van der Hoff a139420a3c
Fix races in room stats (and other) updates. (#6187)
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.
2019-10-10 11:29:01 +01:00
..
2019-09-11 13:54:50 +01:00
2019-09-27 16:15:01 +01:00
2019-09-03 10:21:30 +01:00
2019-07-31 13:24:51 +01:00
2019-08-22 11:28:12 +01:00
2019-08-22 11:28:12 +01:00
2019-10-04 11:21:24 +01:00
2019-08-24 22:33:43 +01:00
2019-06-20 19:32:02 +10:00
2019-10-03 17:42:32 +01:00
2019-09-20 11:20:02 +01:00