-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add support to reindex the database and remove events. #49
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
549ec33
database: Allow marking the database for a reindex.
poljar 0ae4f35
dirty: Reindex support.
poljar ba56da5
index: Index the server timestamp and sender.
poljar 378238f
seshat: Format the repo.
poljar 9cbb560
database: Move the readonly database into a separate module.
poljar 0fc2a66
database: Rename the ReadonlyDatabase to RecoveryDatabase.
poljar 71c0847
database: More work on the recovery db.
poljar de85c23
events: Fix the event sources.
poljar af106dd
database: Improve the recovery test.
poljar 46ef3b2
database: Add propper error handling to the recovery database.
poljar d3f2996
data: Add a v2 database that needs to be reindexed.
poljar c6f4df4
database: Add a method to delete events.
poljar 7f7d7fe
database: Improve the database recovery test.
poljar f28220e
data: Add a v1 database with valid json in the event source field.
poljar af41adc
database: Test the new v1 database upgrade.
poljar e87fb54
database: Add missing docs to the recovery database.
poljar ace778c
seshat: Fix some clippy issues.
poljar ad3ebfc
seshat-node: Add a class to reindex Seshat.
poljar 491be9a
seshat-node: Throw a different error if the database needs to be rein…
poljar 3a3453e
seshat-node: Convert the RangeError into a custom error on the js side.
poljar bbbe4c7
seshat: Make the event deserialization return a Result.
poljar 18e747d
seshat-node: Improve the reindex test.
poljar 832455f
database: Fix the reindex tests.
poljar 1ccd8d1
seshat-node: Fix the reindexing.
poljar fe0ff88
travis: Reset the test data before running Javascript tests.
poljar 0029495
database: Remove some unused imports from the tests.
poljar 786fecb
travis: First delete the database folder, then switch folders.
poljar 947654b
seshat-node: Add docs and fix lint issues for the new recovery database.
poljar 6aa353f
seshat-node: Explain our re-index error throwing shenanigans.
poljar a3dc17e
seshat-node: Fix some more lint errors.
poljar 743d448
Update src/error.rs
poljar 3b2b9b8
Update src/error.rs
poljar 48b5d7d
database: Rename undeleted_events to pending_deletion_events.
poljar 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
["5249de4da76b404098f026f248155bf1.store","88b4ad3f5a1e430f9ea03e2ef43c39f7.fast","88b4ad3f5a1e430f9ea03e2ef43c39f7.fieldnorm","88b4ad3f5a1e430f9ea03e2ef43c39f7.pos","c7f9f53e463f4d9297d257449d63b8d0.posidx","9883d1a65e92474983c3022fb99ea0da.posidx","bf6498b5a1e948d090131605048ecbcd.fieldnorm","3b59e3c0f08646efb6b56192a98ab85f.idx","bf6498b5a1e948d090131605048ecbcd.posidx","5249de4da76b404098f026f248155bf1.term","c7f9f53e463f4d9297d257449d63b8d0.fast","9883d1a65e92474983c3022fb99ea0da.pos","d013a4c1859e403093ef8e37d7e88f32.pos","c7f9f53e463f4d9297d257449d63b8d0.term","5249de4da76b404098f026f248155bf1.posidx","18dcd68b373940f6844631d851e6139c.posidx","0112d870f836494da5f4c16699878d93.store","5249de4da76b404098f026f248155bf1.pos","3b59e3c0f08646efb6b56192a98ab85f.pos","bf6498b5a1e948d090131605048ecbcd.idx","d013a4c1859e403093ef8e37d7e88f32.posidx","c7f9f53e463f4d9297d257449d63b8d0.pos","5249de4da76b404098f026f248155bf1.idx","bf6498b5a1e948d090131605048ecbcd.store","9883d1a65e92474983c3022fb99ea0da.fast","c7f9f53e463f4d9297d257449d63b8d0.fieldnorm","88b4ad3f5a1e430f9ea03e2ef43c39f7.posidx","0112d870f836494da5f4c16699878d93.fast","c7f9f53e463f4d9297d257449d63b8d0.store","9883d1a65e92474983c3022fb99ea0da.term","3b59e3c0f08646efb6b56192a98ab85f.fieldnorm","d013a4c1859e403093ef8e37d7e88f32.fieldnorm","d013a4c1859e403093ef8e37d7e88f32.term","88b4ad3f5a1e430f9ea03e2ef43c39f7.idx","bf6498b5a1e948d090131605048ecbcd.pos","5249de4da76b404098f026f248155bf1.fast","5249de4da76b404098f026f248155bf1.fieldnorm","18dcd68b373940f6844631d851e6139c.fieldnorm","c7f9f53e463f4d9297d257449d63b8d0.idx","meta.json","18dcd68b373940f6844631d851e6139c.term","88b4ad3f5a1e430f9ea03e2ef43c39f7.term","3b59e3c0f08646efb6b56192a98ab85f.term","bf6498b5a1e948d090131605048ecbcd.term","bf6498b5a1e948d090131605048ecbcd.fast","9883d1a65e92474983c3022fb99ea0da.fieldnorm","3b59e3c0f08646efb6b56192a98ab85f.fast","18dcd68b373940f6844631d851e6139c.fast","88b4ad3f5a1e430f9ea03e2ef43c39f7.store","9883d1a65e92474983c3022fb99ea0da.idx","d013a4c1859e403093ef8e37d7e88f32.fast","18dcd68b373940f6844631d851e6139c.idx","9883d1a65e92474983c3022fb99ea0da.store","18dcd68b373940f6844631d851e6139c.store","18dcd68b373940f6844631d851e6139c.pos","3b59e3c0f08646efb6b56192a98ab85f.store","d013a4c1859e403093ef8e37d7e88f32.store","d013a4c1859e403093ef8e37d7e88f32.idx","3b59e3c0f08646efb6b56192a98ab85f.posidx"] |
Empty file.
Empty file.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
{ | ||
"segments": [ | ||
{ | ||
"segment_id": "bf6498b5-a1e9-48d0-9013-1605048ecbcd", | ||
"max_doc": 356, | ||
"deletes": null | ||
}, | ||
{ | ||
"segment_id": "5249de4d-a76b-4040-98f0-26f248155bf1", | ||
"max_doc": 288, | ||
"deletes": null | ||
}, | ||
{ | ||
"segment_id": "18dcd68b-3739-40f6-8446-31d851e6139c", | ||
"max_doc": 284, | ||
"deletes": null | ||
}, | ||
{ | ||
"segment_id": "9883d1a6-5e92-4749-83c3-022fb99ea0da", | ||
"max_doc": 67, | ||
"deletes": null | ||
}, | ||
{ | ||
"segment_id": "3b59e3c0-f086-46ef-b6b5-6192a98ab85f", | ||
"max_doc": 1, | ||
"deletes": null | ||
}, | ||
{ | ||
"segment_id": "88b4ad3f-5a1e-430f-9ea0-3e2ef43c39f7", | ||
"max_doc": 1, | ||
"deletes": null | ||
}, | ||
{ | ||
"segment_id": "c7f9f53e-463f-4d92-97d2-57449d63b8d0", | ||
"max_doc": 1, | ||
"deletes": null | ||
}, | ||
{ | ||
"segment_id": "d013a4c1-859e-4030-93ef-8e37d7e88f32", | ||
"max_doc": 1, | ||
"deletes": null | ||
} | ||
], | ||
"schema": [ | ||
{ | ||
"name": "body", | ||
"type": "text", | ||
"options": { | ||
"indexing": { | ||
"record": "position", | ||
"tokenizer": "default" | ||
}, | ||
"stored": false | ||
} | ||
}, | ||
{ | ||
"name": "topic", | ||
"type": "text", | ||
"options": { | ||
"indexing": { | ||
"record": "position", | ||
"tokenizer": "default" | ||
}, | ||
"stored": false | ||
} | ||
}, | ||
{ | ||
"name": "name", | ||
"type": "text", | ||
"options": { | ||
"indexing": { | ||
"record": "position", | ||
"tokenizer": "default" | ||
}, | ||
"stored": false | ||
} | ||
}, | ||
{ | ||
"name": "room_id", | ||
"type": "text", | ||
"options": { | ||
"indexing": { | ||
"record": "basic", | ||
"tokenizer": "raw" | ||
}, | ||
"stored": false | ||
} | ||
}, | ||
{ | ||
"name": "event_id", | ||
"type": "text", | ||
"options": { | ||
"indexing": null, | ||
"stored": true | ||
} | ||
} | ||
], | ||
"opstamp": 1007 | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
["b653775a48c44546afa249d5f9dc4848.fast","b653775a48c44546afa249d5f9dc4848.pos","meta.json","b653775a48c44546afa249d5f9dc4848.idx","b653775a48c44546afa249d5f9dc4848.posidx","b653775a48c44546afa249d5f9dc4848.store","b653775a48c44546afa249d5f9dc4848.fieldnorm","b653775a48c44546afa249d5f9dc4848.term"] |
Empty file.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
"segments": [ | ||
{ | ||
"segment_id": "b653775a-48c4-4546-afa2-49d5f9dc4848", | ||
"max_doc": 999, | ||
"deletes": null | ||
} | ||
], | ||
"schema": [ | ||
{ | ||
"name": "body", | ||
"type": "text", | ||
"options": { | ||
"indexing": { | ||
"record": "position", | ||
"tokenizer": "default" | ||
}, | ||
"stored": false | ||
} | ||
}, | ||
{ | ||
"name": "topic", | ||
"type": "text", | ||
"options": { | ||
"indexing": { | ||
"record": "position", | ||
"tokenizer": "default" | ||
}, | ||
"stored": false | ||
} | ||
}, | ||
{ | ||
"name": "name", | ||
"type": "text", | ||
"options": { | ||
"indexing": { | ||
"record": "position", | ||
"tokenizer": "default" | ||
}, | ||
"stored": false | ||
} | ||
}, | ||
{ | ||
"name": "room_id", | ||
"type": "text", | ||
"options": { | ||
"indexing": { | ||
"record": "basic", | ||
"tokenizer": "raw" | ||
}, | ||
"stored": false | ||
} | ||
}, | ||
{ | ||
"name": "event_id", | ||
"type": "text", | ||
"options": { | ||
"indexing": null, | ||
"stored": true | ||
} | ||
} | ||
], | ||
"opstamp": 1000 | ||
} |
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
Oops, something went wrong.
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.
I might have feedback after seeing how you plan to handle the recovery path in Riot, but at an abstract level it seems okay.
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 commit implements support for it in Riot: element-hq/element-web@921d734.
I didn't notice any delays at startup, the thing seems to be reasonably quick but do note that this was using a 3k events large database.