-
Notifications
You must be signed in to change notification settings - Fork 99
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
Include solr query string in cache key #396
Conversation
@@ -54,7 +54,7 @@ case class AssetFinder( | |||
updatedAfter.map(t => "updatedAfter" -> Formatter.dateFormat(t)) :: | |||
updatedBefore.map(t => "updatedBefore" -> Formatter.dateFormat(t)) :: | |||
state.map(s => "state" -> s.name) :: | |||
query.map { q => "query" -> "UHOH!!!!" } :: //FIXME: need toCQL traversal |
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 is magical.
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 might be my favorite bug
💅 game on fleek @defect! |
@@ -3,4 +3,5 @@ multicollins { | |||
instanceAssetType = DATA_CENTER | |||
locationAttribute = LOCATION | |||
thisInstance = NONE | |||
queryTimeout = 30 |
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.
Why is this value queryTimeout
but the config class is referencing queryCacheTimeout
?
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.
Because i'm sloppy :) Fix incoming.
10bfffd
to
6ff36d8
Compare
6ff36d8
to
74b2e80
Compare
LGTM - @defect please also be sure to make a PR to update the multicollins parameters docs. https://github.com/tumblr/collins/blob/gh-pages/_includes/configuration/multicollins.html#L23-51 |
@Primer42 #399 opened |
Do documentation changes go in a different PR? How about updated tests? |
Yes, documentation goes in a different PR (#399) since those are pulled in to another branch (gh-pages). I also added a test to make sure the cql query gets included. |
LGTM. What a find |
Include solr query string in cache key
👍 |
When doing queries across many collins instances (using multi-collins) we cache the response from the remote instances for 30 seconds. The problem is that we do not include the CQL query in the key which can result in two different queries returning the same thing.
This PR changes the behavior by adding the solr query string to the cache key, which should eliminate the problem. I'm "unprotecting"
traverseQueryString()
but I think that should be fine as the method doesn't modify or remove anything, it just traverses the solr expression and builds the query string.@tumblr/systems rfr