-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inject state blocks from incremental polls into the room timeline #71
Merged
Merged
Changes from 11 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
38c1bda
Integration test
1d59167
E2E test case draft
46059df
WIP: update test cases
419e1ab
Update test case again
4b90454
Don't reselect NIDs after initialising a room
a2cba6e
We don't need `eventIDs` either
c19b561
Merge branch 'dmr/dont-select-after-insert-returning' into dmr/gappy-…
666823d
Introduce return struct for Initialise
4ba80d2
Initialise: handle state blocks from a gappy sync
9fdb001
TODO comment
33b174d
Fixup test code
ac9651c
Propagate err message
5d8560c
Fix db query
b7a8e7d
Improve logging
e3008e6
Fix the logging
2406da5
TODO note
f28f7d0
Return set of unknown events from the db
9d53a87
Simply Initialise to bail out early
2bae784
Propagate prepend events to poller, and inject
5621423
Fix tests
9af0471
Always look for unknown state events
b5893b1
Better error checking in test
aa07188
Fixup test
7f03a3d
Use test helper instead
e6aac43
SelectUnknownEventIDs expects a txn
b54ba7c
Poller test description
5dd4315
Test new events table query
76066f9
Tidy up accumulator event ID handling
5a9fae1
Fix capitalisation
b32e5da
Fix test function args too
00dd396
Fix MatchRoomTimelineMostRecent
bea931d
Fix running unit test alongside other tests
1680952
Tidyup unit test
6e7d0cb
Test memberships are updated after gappy sync
aa09d12
Check the new query reports multiple unknown IDs
8324f6e
SelectByIDs has an ordering guarantee
6c9aa09
Pass room ID to new query
2755384
Revert "Pass room ID to new query"
82d1d58
Update integration test
3274cf2
typo
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be improved if we made use of the room ID as it can cut lookup times down a lot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I'd just assumed this was indexed on event id---maybe we should add that index?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Err, the event_id column is UNIQUE, so it will be index will exist. Not sure why the room ID would help here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The room ID can help as it cuts down the dataset immediately, rather than relying on a the mahoosive event ID index of all events ever. In the past it has been beneficial to include this information when running
EXPLAIN
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remain sceptical.
Query without room ID:
Query also checking room ID (note it is not just a case of appending
WHERE room_id = ...
):AFAICS the only difference is an additional
at the bottom of the second query plan, which removes no rows anyway. The time diff (~+40 microseconds) is positive. (Though this isn't a statistical analysis; that diff may be just noise.)