-
Notifications
You must be signed in to change notification settings - Fork 57
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
Use DeltaTriplesManager
to process update
request
#1608
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.
Some minor requests and thoughts.
We should now have almost everything in place to try out merging all this together for experimenting.
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.
Some small changes.
src/engine/Server.cpp
Outdated
auto [queryHub, messageSender] = | ||
createMessageSender(queryHub_, request, update); | ||
|
||
auto [cancellationHandle, cancelTimeoutOnDestruction] = | ||
setupCancellationHandle(messageSender.getQueryId(), timeLimit); | ||
|
||
auto [pinSubtrees, pinResult] = determineResultPinning(params); | ||
LOG(INFO) << "Processing the following SPARQL update:" | ||
<< (pinResult ? " [pin result]" : "") | ||
<< (pinSubtrees ? " [pin subresults]" : "") << "\n" | ||
<< update << std::endl; | ||
QueryExecutionContext qec(index_, &cache_, allocator_, | ||
sortPerformanceEstimator_, std::ref(messageSender), | ||
pinSubtrees, pinResult); | ||
auto plannedQuery = co_await setupPlannedQuery( | ||
params, update, qec, cancellationHandle, timeLimit, requestTimer); | ||
auto qet = plannedQuery.queryExecutionTree_; |
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 code is identically duplicated between the query and the update case (the only differense is "UPDATE" vs "QUERY" in the Log message.
Just make it a function that
returns unique_ptr<SomeStructThatcontainsStuffThatWeNeedToAccessAndKeepAlive>
and does all this common setup of message senders, cancellation handles, qets, and whatNotElse.
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 am struggling with the type of cancelTimeoutOnDestruction
lambda. Can you help with that @joka921? If skip the first two statements.
What I tried so far:
- std::function - lambda is not copy constructible, because it captures
- std::move_only_function - is c++23
- function pointer - lambda captures
- auto in the struct - lambda captures
- obtaining the type through template magic was also difficult because the function is a private member function in the same class
TODO: This does not yet work for concurrent update requests (which need to be serialized via a lock). But good enough for playing around already.
@Qup42 I am already playing around with this (in conjunction with #1597) and it works like a charm. I have one request: Currently, the API call simply returns a string "Update successful". It would be great if for
I am assuming that all this information is available relatively easily. If not, please let me know. Please also let me know if you think that this belongs in a separate PR. And somewhat related: In my original (by now, ancient) draft of this, there was a command to clear all delta triples. For example, it could be activated via |
DeltaTriplesManager
to process update
request
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1608 +/- ##
==========================================
- Coverage 89.21% 89.21% -0.01%
==========================================
Files 372 374 +2
Lines 34723 35387 +664
Branches 3915 3992 +77
==========================================
+ Hits 30979 31569 +590
- Misses 2471 2529 +58
- Partials 1273 1289 +16 ☔ View full report in Codecov by Sentry. |
@hannahbast adding some timing information and further metadata to the update response is already on my ToDo list. Points 1 ( My current plan was to do the additional info in a separate PR. The PR activating the updates in the server was supposed to be small, so that it can be merged quickly. Before adding this additional information I wanted to have a look at what other engines do here. To be able to run updates some changes are required in qlever-ui, so there was little use to every it earlier at that poing. Clearing the updates is just very little code, I'll add that to this PR. |
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 general setup is fine, but there's some things to consider concerning threadsafety and
deadlock prevention.
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.
Two very minor changes.
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Conformance check passed ✅No test result changes. |
Quality Gate passedIssues Measures |
Add the missing code in
Server.cpp
andServer.h
to process a parsed update request using theDeltaTriplesManager
from #1603 .As of this commit, QLever has an initial beta support for a subset of SPARQL UPDATE with the following limitations (all of which will be added in the future, and the list is far from being complete):