Skip to content
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

Fix for OOM issue with transitive paths #1621

Closed
wants to merge 4 commits into from

Conversation

hannahbast
Copy link
Member

Checking if this fixes #1606

Copy link

codecov bot commented Nov 17, 2024

Codecov Report

Attention: Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.

Project coverage is 89.33%. Comparing base (39ca684) to head (61d8901).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/engine/TransitivePathImpl.h 87.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1621      +/-   ##
==========================================
+ Coverage   89.30%   89.33%   +0.02%     
==========================================
  Files         373      374       +1     
  Lines       35377    35695     +318     
  Branches     3999     4051      +52     
==========================================
+ Hits        31594    31887     +293     
- Misses       2493     2519      +26     
+ Partials     1290     1289       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@hannahbast
Copy link
Member Author

This did not fix it

@hannahbast hannahbast closed this Nov 17, 2024
@hannahbast hannahbast reopened this Nov 17, 2024
@hannahbast hannahbast changed the title Add memory limit for stored vocabs Fix for OOM issue with transitive paths Nov 18, 2024
Copy link
Member

@joka921 joka921 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can add unit tests
(for the local vocab as well as for the transitive path case [if feasibley, but I think you can do it quickly]).

@@ -97,6 +97,9 @@ class LocalVocab {
void mergeWith(const R& vocabs) {
auto inserter = std::back_inserter(otherWordSets_);
for (const auto& vocab : vocabs) {
if (vocab.empty()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can usestd::views::filter(std::not_fn(&LocalVocab::empty())

@@ -97,6 +97,9 @@ class LocalVocab {
void mergeWith(const R& vocabs) {
auto inserter = std::back_inserter(otherWordSets_);
for (const auto& vocab : vocabs) {
if (vocab.empty()) {
continue;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And you should also refactor the
LocalVocab::clone() method to call this mergeWith method:

... clone() {
LocalVocab clone;
clone.mergeWith(std::span(this, 1));
return clone;
}

@@ -244,7 +246,7 @@ class TransitivePathImpl : public TransitivePathBase {
*/
NodeGenerator transitiveHull(const T& edges, LocalVocab edgesVocab,
std::ranges::range auto startNodes,
std::optional<Id> target) const {
std::optional<Id> target, bool yieldOnce) const {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add to the docstring, that the yieldOnce has to have the same value as in the using code, and that it is only used for optimizing the local vocabs.

@sparql-conformance
Copy link

Copy link

@RobinTF
Copy link
Collaborator

RobinTF commented Nov 18, 2024

Reopened as #1627

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

query causing QLever to crash
3 participants