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

Correctly handle the cache in the presence of SPARQL UPDATE #1646

Merged
merged 6 commits into from
Nov 29, 2024

Conversation

joka921
Copy link
Member

@joka921 joka921 commented Nov 27, 2024

An update can invalidate a cached query result in the sense that if one would run the query again after the update, the result may be different. This was ignored so far, and is now considered as follows: Each LocatedTriplesSnapshot gets its own "index" (starting from zero and then incremented for each new snaphot). That index becomes part of the cache key. That way, a query will make use of a cached result if and only if there was no update between the time of the query and the time when the cached result was computed.

Copy link

codecov bot commented Nov 27, 2024

Codecov Report

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

Project coverage is 89.39%. Comparing base (9c41750) to head (6a2c53f).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/engine/Server.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1646      +/-   ##
==========================================
- Coverage   89.40%   89.39%   -0.02%     
==========================================
  Files         375      375              
  Lines       36132    36141       +9     
  Branches     4076     4076              
==========================================
+ Hits        32305    32307       +2     
- Misses       2514     2516       +2     
- Partials     1313     1318       +5     

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

Copy link
Member

@hannahbast hannahbast left a comment

Choose a reason for hiding this comment

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

Great to have this!

As discussed: use a counter for the LocatedTripels hashes instead of the pointer.

@sparql-conformance
Copy link

Copy link

sonarcloud bot commented Nov 29, 2024

Copy link
Member

@hannahbast hannahbast left a comment

Choose a reason for hiding this comment

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

Looks perfect now, thanks a lot!

@hannahbast hannahbast merged commit f86080c into ad-freiburg:master Nov 29, 2024
21 of 22 checks passed
realHannes pushed a commit to realHannes/qlever that referenced this pull request Dec 2, 2024
…urg#1646)

An update can invalidate a cached query result in the sense that if one would run the query again after the update, the result may be different. This was ignored so far, and is now considered as follows: Each `LocatedTriplesSnapshot` gets its own "index" (starting from zero and then incremented for each new snaphot). That index becomes part of the cache key. That way, a query will make use of a cached result if and only if there was no update between the time of the query and the time when the cached result was computed.
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.

2 participants