prometheus/storage/local
beorn7 253be23c00 storage: Sanity-check number of loaded chunk descs
Two cases:

- An unarchived metric must have at least one chunk desc loaded upon
  unarchival. Otherwise, the file is gone or has size 0, which is an
  inconsistency (because the series is still indexed in the archive
  index). Hence, quarantining is triggered.

- If loading the chunk descs of a series with a known chunkDescsOffset
  (i.e. != -1), the number of chunks loaded must be equal to
  chunkDescsOffset. If not, there is a data corruption. An error is
  returned, which leads to qurantining.

In any case, there is a guard added to not access the 1st element of
an empty chunkDescs slice. (That's what triggered the crashes in issue
2249.)  A time series with unknown chunkDescsOffset and no chunks in
memory and no chunks on disk either could trigger that case. I would
assume such a "null series" doesn't exist, but it's not entirely
unthinkable and unreasonable to happen (perhaps in future uses of the
storage). (Create a series, and then something tries to preload chunks
before the first sample is added.)
2016-12-13 23:19:39 +01:00
..
chunk Add call to estimate number of samples in a chunk to the API 2016-11-17 19:09:59 +00:00
codable Replace metric.LabelPair with model.LabelPair 2015-08-22 13:32:13 +02:00
fixtures/b0 Add benchmark for loading chunks and chunk descs. 2015-03-19 19:28:21 +01:00
index Handle errors caused by data corruption more gracefully 2016-03-02 23:02:34 +01:00
storagetool Make version informations consistent between prometheus components 2016-05-05 22:33:18 +02:00
crashrecovery.go Fix possible memory leak by defer inside loop 2016-11-14 14:08:08 +09:00
heads.go Review fixups. 2016-09-28 23:42:44 +02:00
instrumentation.go storage: separate chunk package, publish more names 2016-09-26 13:25:11 +02:00
interface.go storage: enhance Querier interface usage 2016-10-16 10:39:29 +02:00
locker.go Avoid having contended mutexes on same cacheline 2016-09-18 23:32:55 +01:00
locker_test.go Add missing license headers 2016-04-13 16:08:22 +02:00
mapper.go Checkpoint fingerprint mappings only upon shutdown 2016-04-15 01:03:28 +02:00
mapper_test.go Checkpoint fingerprint mappings only upon shutdown 2016-04-15 01:03:28 +02:00
noop_storage.go storage: enhance Querier interface usage 2016-10-16 10:39:29 +02:00
persistence.go storage: fix error message (#2270) 2016-12-09 22:36:27 +00:00
persistence_test.go Check error before defer closing 2016-11-13 18:16:02 +01:00
series.go storage: Sanity-check number of loaded chunk descs 2016-12-13 23:19:39 +01:00
series_test.go Unpublish accidentally published series methods 2016-10-03 00:04:56 +02:00
storage.go storage: Sanity-check number of loaded chunk descs 2016-12-13 23:19:39 +01:00
storage_test.go Protect exported Querier interface method against negative time ranges 2016-11-01 15:05:01 +01:00
test_helpers.go Merge pull request #2005 from redbaron/microoptimise-matching 2016-10-05 17:26:56 +02:00