Skip to content

Commit

Permalink
Merge branch 'release-1.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
beorn7 committed Oct 10, 2016
2 parents a728f19 + dc52a85 commit b66ce9c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions .promu.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
go: 1.7.1
repository:
path: github.com/prometheus/prometheus
build:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.2.1 / 2016-10-10

* [BUGFIX] Count chunk evictions properly so that the server doesn't
assume it runs out of memory and subsequencly throttles ingestion.
* [BUGFIX] Use Go1.7.1 for prebuilt binaries to fix issues on MacOS Sierra.

## 1.2.0 / 2016-10-07

* [FEATURE] Cleaner encoding of query parameters in `/graph` URLs.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.0
1.2.1
2 changes: 2 additions & 0 deletions storage/local/chunk/chunk.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ func (d *Desc) MaybeEvict() bool {
panic("ChunkLastTime not populated for evicted chunk")
}
d.C = nil
Ops.WithLabelValues(Evict).Inc()
atomic.AddInt64(&NumMemChunks, -1)
return true
}

Expand Down
8 changes: 8 additions & 0 deletions storage/local/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"math/rand"
"os"
"strconv"
"sync/atomic"
"testing"
"testing/quick"
"time"
Expand Down Expand Up @@ -1412,6 +1413,10 @@ func testEvictAndLoadChunkDescs(t *testing.T, encoding chunk.Encoding) {
Value: model.SampleValue(3.14),
}

// Sadly, chunk.NumMemChunks is a global variable. We have to reset it
// explicitly here.
atomic.StoreInt64(&chunk.NumMemChunks, 0)

s, closer := NewTestStorage(t, encoding)
defer closer.Close()

Expand Down Expand Up @@ -1441,6 +1446,9 @@ func testEvictAndLoadChunkDescs(t *testing.T, encoding chunk.Encoding) {
if oldLen <= len(series.chunkDescs) {
t.Errorf("Expected number of chunkDescs to decrease, old number %d, current number %d.", oldLen, len(series.chunkDescs))
}
if int64(len(series.chunkDescs)) < atomic.LoadInt64(&chunk.NumMemChunks) {
t.Errorf("NumMemChunks is larger than number of chunk descs, number of chunk descs: %d, NumMemChunks: %d.", len(series.chunkDescs), atomic.LoadInt64(&chunk.NumMemChunks))
}

// Load everything back.
it := s.preloadChunksForRange(makeFingerprintSeriesPair(s, fp), 0, 100000)
Expand Down

0 comments on commit b66ce9c

Please sign in to comment.