Filter Box Caching Incorrectly for Multi-Query Use Case
See original GitHub issueA filter box that generates multiple queries (multiple filter controls) does not generate the correct cache entries for each filter control. It appears that only 1 (the first) query gets cached correctly. A correct cache entry should have a single query and associated results. What I see for most filter box cache entries are multiple queries from the filter box. So when the filter box gets reloaded, it only finds one of the cached queries and has cache misses for the rest. In each successive reload, the cache misses decrease by one. I suspect only the first query is generating the correct cache entry.
I am thinking the issue might be related to ‘class FilterBoxViz’ and/or ‘run_extra_queries’
Expected results
If I have a filter box with 16 filter controls, then a reload of the page within the cache TTL should generate 16 cache hits.
Actual results
Only 1 cache hit and 15 cache misses. I see 15 more logs like 2019-06-06 14:09:09,893:INFO:root:Caching 1180 chars at key c4dceda1ab0aef7047ef06ebb6063d88
Screenshots
Here is my filter box (16 controls)
How to reproduce the bug
Set logging to INFO. I am using REDIS cache but probably any cache would do.
- Load a dashboard containing a filter box with more than 1 filter control. Note occurrences of Caching xxxx chars at key yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
- Reload the page and note occurrences of “Caching abcd chars at key …” and occurrences of “Serving from cache”
- Note that there is only 1 cache hit for the filter box and that superset generated different cache keys then it did in step 1
- Inspect the cache for the cache keys observed in step 1 and note that they contain multiple queries…they should contain a single query.
Environment
(please complete the following information):
- superset version: 0.26.3
- python version: 2.7
- node.js version: not installed
- npm version: `not installed
Checklist
Make sure these boxes are checked before submitting your issue - thank you!
- I have checked the superset logs for python stacktraces and included it here as text if there are any.
- [x ] I have reproduced the issue with at least the latest released version of superset.
- I have checked the issue tracker for the same issue and I haven’t found one similar.
Additional context
Add any other context about the problem here.
Issue Analytics
- State:
- Created 4 years ago
- Comments:19 (10 by maintainers)
Top GitHub Comments
I think I was able to replicate, will investigate.
I can take a look at this.