-
Notifications
You must be signed in to change notification settings - Fork 69
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
Persist updates between server restarts #1903
Conversation
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.
Thanks for the quick draft.
I think I have found a bug:)
src/index/DeltaTriples.cpp
Outdated
ad_utility::serializeIds( | ||
tempPath, localVocab_, | ||
std::array{toRange(triplesDeleted_), toRange(triplesInserted_)}); | ||
std::filesystem::rename(tempPath, storagePath); |
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.
do something if the renaming fails.
AD_CONTRACT_CHECK(vocab.numSets() == 1); | ||
const auto& words = vocab.primaryWordSet(); |
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.
Can be (at least in a TODO) extended to more than one set.
@RobinTF Thanks a lot for this. I had a look at this together with @joka921 and it worked in principle, great! I wrote a description above, please check. Here are some issues that should be addressed before this can be merged:
|
Signed-off-by: Johannes Kalmbach <johannes.kalmbach@gmail.com>
Signed-off-by: Johannes Kalmbach <johannes.kalmbach@gmail.com>
Signed-off-by: Johannes Kalmbach <johannes.kalmbach@gmail.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1903 +/- ##
==========================================
- Coverage 90.56% 90.56% -0.01%
==========================================
Files 414 415 +1
Lines 40100 40284 +184
Branches 4536 4554 +18
==========================================
+ Hits 36318 36484 +166
- Misses 2427 2442 +15
- Partials 1355 1358 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This is the accompanying change for the `persists-updates` option introduced by ad-freiburg/qlever#1903
Signed-off-by: Johannes Kalmbach <johannes.kalmbach@gmail.com>
Signed-off-by: Johannes Kalmbach <johannes.kalmbach@gmail.com>
Signed-off-by: Johannes Kalmbach <johannes.kalmbach@gmail.com>
Conformance check passed ✅No test result changes. |
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 tested it, and it works fine now!
|
This is the accompanying change for the `persists-updates` option introduced by ad-freiburg/qlever#1903
So far, delta triples due to updates were lost when the server was restarted. This change introduces an option
--persist-updates
, which has the following effect:After each update, the complete set of delta triples (inserted and deleted) as well as the associated local vocabulary is written to disk, to a file
<name>.update-triples
, where<name>
is the basename of the index files.When restarting the server, that file is read and the update triples are processed in such a way that the server ends up in the same state it was in when that file was written.
When restarting the server without the option
--persist-updates
or if there is no file<name>.update-triples
, the server is in the same state it would be in if there are no update triples (or after the commandclear-delta-triples
).NOTE: This is a first implementation, which provides the basic functionality. After each update, the complete set of delta triples is written, even if that update inserted or removed only few triples relative to the previous updates. If an error occurs during an update operation, the server state is still undefined and one effectively loses all delta triples. This is work for future PRs.