Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Timestamp fixes etc #916

Closed
wants to merge 10 commits into from
Closed

Timestamp fixes etc #916

wants to merge 10 commits into from

Conversation

Dieterbe
Copy link
Contributor

I think something's up with circle.
this replaces #915

Dieterbe added 8 commits May 17, 2018 23:09

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
it happened to work because the only caller used an end that divides by
the step. But now it works in all cases
AggMetric, Store, and Cache all support retrieving a range of data.
ranges are defined as from to to; where from is inclusive and to is
exclusive. thus valid ranges must have from < to; with the special
case of from = to - 1, which selects exactly 1 1-second slot.

in particular:

* use uniform error messages across all 3
* AggMetric.Get(): when hitting unexpected nil chunk, return error.
  if we have corruption in our in-memory chunklist, i rather return
  an error to client rather than trying to query the store to prevent
  cascading trouble. Seems pretty rare considering chunkcache does
  most of the work, but the other reason is now that we return errors
  instead of panicing, this seems cleaner
* in cache.Search treat from > to as an error
if interval is, say 120s
then you can expect points with these timestamps:
120
240
360
...

previously, if you issued a render request such as to=300,until=330
on a raw archive (which still needs quantizing so we do some tricks)
those tricks would result in bad request errors.
Now we handle them as they should: return [].

fix #912
@Dieterbe Dieterbe force-pushed the timestamp-fixes-etc branch from 7212592 to c007678 Compare May 18, 2018 10:29
@Dieterbe Dieterbe requested a review from replay May 18, 2018 13:33
@@ -209,8 +212,8 @@ func (c *CCache) Search(ctx context.Context, metric schema.AMKey, from, until ui
Until: until,
}

if from == until {
return res
if from >= until {
Copy link
Contributor

Choose a reason for hiding this comment

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

actually this could happen before CCSearchResult is instantiated

errReadTooOld = errors.New("the read is too old")
errTableNotFound = errors.New("table for given TTL not found")
errCtxCanceled = errors.New("context canceled")
errChunkTooSmall = errors.New("unpossibly small chunk in cassandra")
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't that be impossibly? is unpossibly a word?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes. no.

Copy link
Contributor

@replay replay left a comment

Choose a reason for hiding this comment

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

Looks good to me. I only had some very minor comments

@Dieterbe Dieterbe closed this May 20, 2018
@Dieterbe Dieterbe deleted the timestamp-fixes-etc branch May 20, 2018 19:02
@Dieterbe Dieterbe mentioned this pull request May 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants