From 6b7de31a3cee7457b8f2bdfa197b438c248d8d09 Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Mon, 2 Dec 2013 13:36:47 +0100 Subject: [PATCH] Upgrade to LevelDB 1.14.0 to fix LevelDB bugs. This tentatively fixes https://github.com/prometheus/prometheus/issues/368 due to an upstream bugfix in snapshotted LevelDB iterator handling, which got fixed in LevelDB 1.14.0: https://code.google.com/p/leveldb/issues/detail?id=200 Change-Id: Ib0cc67b7d3dc33913a1c16736eff32ef702c63bf --- Makefile.INCLUDE | 2 +- storage/metric/compaction_regression_test.go | 47 ++++++++++++++------ 2 files changed, 35 insertions(+), 14 deletions(-) diff --git a/Makefile.INCLUDE b/Makefile.INCLUDE index 9847fe1f98..dc3c0fa009 100644 --- a/Makefile.INCLUDE +++ b/Makefile.INCLUDE @@ -43,7 +43,7 @@ GOENV = TMPDIR=$(TMPDIR) GOROOT=$(GOROOT) GOPATH=$(GOPATH) GO = $(GOENV) $(GOCC) GOFMT = $(GOROOT)/bin/gofmt -LEVELDB_VERSION := 1.12.0 +LEVELDB_VERSION := 1.14.0 PROTOCOL_BUFFERS_VERSION := 2.5.0 SNAPPY_VERSION := 1.1.0 diff --git a/storage/metric/compaction_regression_test.go b/storage/metric/compaction_regression_test.go index c6d008b2f6..ed232c2654 100644 --- a/storage/metric/compaction_regression_test.go +++ b/storage/metric/compaction_regression_test.go @@ -219,22 +219,43 @@ func TestCompaction(t *testing.T) { uncompactedChunks: 9, compactedChunks: 3, }, - // BUG: This case crashes! See: - // https://github.com/prometheus/prometheus/issues/368 - // Fix this! + // BEFORE COMPACTION: // - //{ - // leveldbChunkSize: 5, - // numTimeseries: 3, - // samplesPerTs: 20, + // Chunk size | Fingerprint | Samples + // 5 | A | 1 .. 5 + // 5 | A | 6 .. 10 + // 5 | A | 11 .. 15 + // 5 | A | 16 .. 20 + // 5 | B | 1 .. 5 + // 5 | B | 6 .. 10 + // 5 | B | 11 .. 15 + // 5 | B | 16 .. 20 + // 5 | C | 1 .. 5 + // 5 | C | 6 .. 10 + // 5 | C | 11 .. 15 + // 5 | C | 16 .. 20 + // + // AFTER COMPACTION: + // + // Chunk size | Fingerprint | Samples + // 10 | A | 1 .. 15 + // 10 | A | 16 .. 20 + // 10 | B | 1 .. 15 + // 10 | B | 16 .. 20 + // 10 | C | 1 .. 15 + // 10 | C | 16 .. 20 + { + leveldbChunkSize: 5, + numTimeseries: 3, + samplesPerTs: 20, - // ignoreYoungerThan: time.Minute, - // maximumMutationPoolBatch: 30, - // minimumGroupSize: 10, + ignoreYoungerThan: time.Minute, + maximumMutationPoolBatch: 30, + minimumGroupSize: 10, - // uncompactedChunks: 12, - // compactedChunks: 9, - //}, + uncompactedChunks: 12, + compactedChunks: 6, + }, } for _, s := range scenarios {