Invalidate cached query results if query timed out#22807
Merged
s1monw merged 1 commit intoelastic:masterfrom Jan 26, 2017
Merged
Invalidate cached query results if query timed out#22807s1monw merged 1 commit intoelastic:masterfrom
s1monw merged 1 commit intoelastic:masterfrom
Conversation
Today we cache query results even if the query timed out. This is obviously problematic since results are not complete. Yet, the decision if a query timed out or not happens too late to simply not cache the result since if we'd just throw an exception all currently waiting requests with the same request / cache key would fail with the same exception without the option to access the result or to reexecute. Instead, this change will allow the request to enter the cache but invalidates it immediately. Concurrent request might not get executed and return the timed out result which is not absolutely correct but very likely since idendical requests will likey timeout as well. As a side-effect we won't hammer the node with concurrent slow searches but rather only execute one of them and return shortly cached result. Closes elastic#22789
Contributor
Author
|
@elasticmachine test this please |
s1monw
added a commit
that referenced
this pull request
Jan 26, 2017
Today we cache query results even if the query timed out. This is obviously problematic since results are not complete. Yet, the decision if a query timed out or not happens too late to simply not cache the result since if we'd just throw an exception all currently waiting requests with the same request / cache key would fail with the same exception without the option to access the result or to re-execute. Instead, this change will allow the request to enter the cache but invalidates it immediately. Concurrent request might not get executed and return the timed out result which is not absolutely correct but very likely since identical requests will likely timeout as well. As a side-effect we won't hammer the node with concurrent slow searches but rather only execute one of them and return shortly cached result. Closes #22789
s1monw
added a commit
that referenced
this pull request
Jan 26, 2017
Today we cache query results even if the query timed out. This is obviously problematic since results are not complete. Yet, the decision if a query timed out or not happens too late to simply not cache the result since if we'd just throw an exception all currently waiting requests with the same request / cache key would fail with the same exception without the option to access the result or to re-execute. Instead, this change will allow the request to enter the cache but invalidates it immediately. Concurrent request might not get executed and return the timed out result which is not absolutely correct but very likely since identical requests will likely timeout as well. As a side-effect we won't hammer the node with concurrent slow searches but rather only execute one of them and return shortly cached result. Closes #22789
s1monw
added a commit
that referenced
this pull request
Jan 26, 2017
Today we cache query results even if the query timed out. This is obviously problematic since results are not complete. Yet, the decision if a query timed out or not happens too late to simply not cache the result since if we'd just throw an exception all currently waiting requests with the same request / cache key would fail with the same exception without the option to access the result or to re-execute. Instead, this change will allow the request to enter the cache but invalidates it immediately. Concurrent request might not get executed and return the timed out result which is not absolutely correct but very likely since identical requests will likely timeout as well. As a side-effect we won't hammer the node with concurrent slow searches but rather only execute one of them and return shortly cached result. Closes #22789
jasontedor
added a commit
to jasontedor/elasticsearch
that referenced
this pull request
Jan 26, 2017
* master: (47 commits) Remove non needed import use expectThrows instead of manually testing exception Fix checkstyle and a test Update after review Read ec2 discovery address from aws instance tags Invalidate cached query results if query timed out (elastic#22807) Add remaining generated painless API Generate reference links for painless API (elastic#22775) [TEST] Fix ElasticsearchExceptionTests Add parsing method for ElasticsearchException.generateThrowableXContent() (elastic#22783) Improve connection closing in `RemoteClusterConnection` (elastic#22804) Docs: Cluster allocation explain should be on one page Remove DFS_QUERY_AND_FETCH as a search type (elastic#22787) Add repository-url module and move URLRepository (elastic#22752) fix date-processor to a new default year for every new pipeline execution. (elastic#22601) Add tests for top_hits aggregation (elastic#22754) [TEST] Added this for 93a28b0 submitted via elastic#22772 Fix typo in comment in OsProbe.java Add new ruby search library to community clients doc (elastic#22765) RangeQuery WITHIN case now normalises query (elastic#22431) ...
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Today we cache query results even if the query timed out. This is obviously
problematic since results are not complete. Yet, the decision if a query timed
out or not happens too late to simply not cache the result since if we'd just throw
an exception all currently waiting requests with the same request / cache key would
fail with the same exception without the option to access the result or to re-execute.
Instead, this change will allow the request to enter the cache but invalidates it immediately.
Concurrent request might not get executed and return the timed out result which is not absolutely
correct but very likely since identical requests will likely timeout as well. As a side-effect
we won't hammer the node with concurrent slow searches but rather only execute one of them
and return shortly cached result.
Closes #22789