Merge pull request #2906 from Gouthamve/error-ptr-match

Convert tsdb.ErrOutOfBounds to a storage error
This commit is contained in:
Fabian Reinartz 2017-07-06 17:26:26 +02:00 committed by GitHub
commit 9c8be7575c
2 changed files with 5 additions and 1 deletions

View file

@ -852,7 +852,7 @@ loop:
sl.l.With("numDropped", numDuplicates).Warn("Error on ingesting samples with different value but same timestamp")
}
if numOutOfBounds > 0 {
sl.l.With("numOutOfBounds", numOutOfBounds).Warn("Error on ingesting samples that are too old")
sl.l.With("numOutOfBounds", numOutOfBounds).Warn("Error on ingesting samples that are too old or are too far into the future")
}
if err == nil {
sl.cache.forEachStale(func(lset labels.Labels) bool {

View file

@ -125,6 +125,8 @@ func (a appender) Add(lset labels.Labels, t int64, v float64) (string, error) {
return "", storage.ErrOutOfOrderSample
case tsdb.ErrAmendSample:
return "", storage.ErrDuplicateSampleForTimestamp
case tsdb.ErrOutOfBounds:
return "", storage.ErrOutOfBounds
}
return ref, err
}
@ -139,6 +141,8 @@ func (a appender) AddFast(ref string, t int64, v float64) error {
return storage.ErrOutOfOrderSample
case tsdb.ErrAmendSample:
return storage.ErrDuplicateSampleForTimestamp
case tsdb.ErrOutOfBounds:
return storage.ErrOutOfBounds
}
return err
}