Skip to content

Commit

Permalink
Vendor latest mimir-prometheus/main (#2243)
Browse files Browse the repository at this point in the history
* Vendor latest mimir-prometheus/main

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>

* Update the bytes length of the meta files

With the new vendored version of mimir-prometheus the meta files now
have a new property called out_of_order to state if the block was an
out-of-order block or not.

This new property gets added to every meta file so we need to update the
expected lengths of this tests.

This is how the new property looks in the metas:
- "out_of_order": false,

Co-authored-by: Jesus Vazquez <jesus.vazquez@grafana.com>
  • Loading branch information
codesome and jesusvazquez committed Jun 28, 2022
1 parent 3eb0a83 commit da0f33d
Show file tree
Hide file tree
Showing 27 changed files with 2,349 additions and 572 deletions.
6 changes: 5 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,11 @@ replace git.apache.org/thrift.git => github.com/apache/thrift v0.0.0-20180902110
replace github.com/bradfitz/gomemcache => github.com/themihai/gomemcache v0.0.0-20180902122335-24332e2d58ab

// Using a fork of Prometheus while we work on querysharding to avoid a dependency on the upstream.
replace github.com/prometheus/prometheus => github.com/grafana/mimir-prometheus v0.0.0-20220614075514-f2aba4af80e4
replace github.com/prometheus/prometheus => github.com/grafana/mimir-prometheus v0.0.0-20220627145625-5e8406a1d4a5

// Out of order Support forces us to fork thanos because we've changed the ChunkReader interface.
// Once the out of order support is upstreamed and Thanos has vendored it, we can remove this override.
replace github.com/thanos-io/thanos => github.com/grafana/thanos v0.19.1-0.20220610094531-ab07eb568317

// Pin hashicorp depencencies since the Prometheus fork, go mod tries to update them.
replace github.com/hashicorp/go-immutable-radix => github.com/hashicorp/go-immutable-radix v1.2.0
Expand Down
365 changes: 4 additions & 361 deletions go.sum

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pkg/storage/tsdb/upload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func TestUploadBlock(t *testing.T) {
require.Equal(t, 3, len(bkt.Objects()))
require.Equal(t, 3751, len(bkt.Objects()[path.Join(b1.String(), block.ChunksDirname, "000001")]))
require.Equal(t, 401, len(bkt.Objects()[path.Join(b1.String(), block.IndexFilename)]))
require.Equal(t, 546, len(bkt.Objects()[path.Join(b1.String(), block.MetaFilename)]))
require.Equal(t, 570, len(bkt.Objects()[path.Join(b1.String(), block.MetaFilename)]))

origMeta, err := metadata.ReadFromDir(path.Join(tmpDir, "test", b1.String()))
require.NoError(t, err)
Expand All @@ -131,7 +131,7 @@ func TestUploadBlock(t *testing.T) {
require.Equal(t, 3, len(bkt.Objects()))
require.Equal(t, 3751, len(bkt.Objects()[path.Join(b1.String(), block.ChunksDirname, "000001")]))
require.Equal(t, 401, len(bkt.Objects()[path.Join(b1.String(), block.IndexFilename)]))
require.Equal(t, 546, len(bkt.Objects()[path.Join(b1.String(), block.MetaFilename)]))
require.Equal(t, 570, len(bkt.Objects()[path.Join(b1.String(), block.MetaFilename)]))
})

t.Run("upload with no external labels works just fine", func(t *testing.T) {
Expand All @@ -151,7 +151,7 @@ func TestUploadBlock(t *testing.T) {
require.Equal(t, 6, len(bkt.Objects())) // 3 from b1, 3 from b2
require.Equal(t, 3736, len(bkt.Objects()[path.Join(b2.String(), block.ChunksDirname, "000001")]))
require.Equal(t, 401, len(bkt.Objects()[path.Join(b2.String(), block.IndexFilename)]))
require.Equal(t, 525, len(bkt.Objects()[path.Join(b2.String(), block.MetaFilename)]))
require.Equal(t, 549, len(bkt.Objects()[path.Join(b2.String(), block.MetaFilename)]))

origMeta, err := metadata.ReadFromDir(path.Join(tmpDir, b2.String()))
require.NoError(t, err)
Expand Down
27 changes: 27 additions & 0 deletions vendor/github.com/prometheus/prometheus/config/config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions vendor/github.com/prometheus/prometheus/storage/interface.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion vendor/github.com/prometheus/prometheus/tsdb/block.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 18 additions & 3 deletions vendor/github.com/prometheus/prometheus/tsdb/chunkenc/chunk.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 80 additions & 0 deletions vendor/github.com/prometheus/prometheus/tsdb/chunkenc/ooo.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions vendor/github.com/prometheus/prometheus/tsdb/chunkenc/xor.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions vendor/github.com/prometheus/prometheus/tsdb/chunks/chunks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 16 additions & 7 deletions vendor/github.com/prometheus/prometheus/tsdb/chunks/head_chunks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit da0f33d

Please sign in to comment.