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

Caching bug for queries with an end time in the future #42

Closed
tsuna opened this issue Apr 21, 2011 · 2 comments
Closed

Caching bug for queries with an end time in the future #42

tsuna opened this issue Apr 21, 2011 · 2 comments
Assignees

Comments

@tsuna
Copy link
Member

tsuna commented Apr 21, 2011

Scenario we ran into today:

  • Yesterday, at 7pm, someone requested: /q?start=2011/04/19-00:00:00&end=2011/04/20-00:00:00&m=my.metric&ascii
  • TSD fetched the data up until 7pm and wrote it to its disk cache.
  • Because the end time (midnight) was 5h "in the future", the TSD marked the ASCII response as un-cacheable.
  • Today, someone made the same request again.
  • This time, the end time was "in the past", so the max_age was set to 86400 seconds (1 day).
  • GraphHandler.isDiskCacheHit found the cached .txt file and called staleCacheFile to verify whether it could use it.
  • GraphHandler.staleCacheFile saw that there was and end date specified and incorrectly returned false.

The problem here is that GraphHandler.staleCacheFile should do something like this:

  • If the end time of the query is in the past, ensure that the mtime of the cached file is greater than or equal to the end time of the query.
  • If the end time of the query is in the future, ensure that the current time minus the mtime of the file is less than max_age.

Thanks to Anoakie Turner for reporting the bug.

@ghost ghost assigned tsuna Apr 21, 2011
@ghost ghost assigned aravind Apr 28, 2011
aravind pushed a commit to aravind/opentsdb that referenced this issue May 9, 2011
@aravind
Copy link
Contributor

aravind commented May 9, 2011

aravind@5b89170 should fix this issue.

tsuna added a commit to tsuna/opentsdb that referenced this issue Jun 7, 2011
This closes issue OpenTSDB#42.  I believe it also closes issue OpenTSDB#10, since
relative end-dates are no longer handled specially.

Change-Id: I9ee259e7ae94a677bc6fc366024ac385a91a1cdb
@tsuna
Copy link
Member Author

tsuna commented Jun 24, 2011

Fixed by StumbleUponArchive/opentsdb@b3a26c3

@tsuna tsuna closed this as completed Jun 24, 2011
jzeeck pushed a commit to jzeeck/opentsdb that referenced this issue Nov 25, 2014
Finish migration of relevant things to QueryRunner so it compiles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants