From bc9bb80dbf8a080749d3352f826b7db72c9901ca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Jul 2025 13:59:33 +0000 Subject: [PATCH] Bump github.com/thanos-io/thanos Bumps [github.com/thanos-io/thanos](https://github.com/thanos-io/thanos) from 0.39.1-0.20250626092019-3727363b495d to 0.39.1. - [Release notes](https://github.com/thanos-io/thanos/releases) - [Changelog](https://github.com/thanos-io/thanos/blob/v0.39.1/CHANGELOG.md) - [Commits](https://github.com/thanos-io/thanos/commits/v0.39.1) --- updated-dependencies: - dependency-name: github.com/thanos-io/thanos dependency-version: 0.39.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- .../pkg/block/indexheader/reader_pool.go | 22 +++++++++---------- vendor/modules.txt | 2 +- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index 4676189520..c7c75cd5b9 100644 --- a/go.mod +++ b/go.mod @@ -52,7 +52,7 @@ require ( github.com/stretchr/testify v1.10.0 github.com/thanos-io/objstore v0.0.0-20250317105316-a0136a6f898d github.com/thanos-io/promql-engine v0.0.0-20250611170940-015ebeb7b5ff - github.com/thanos-io/thanos v0.39.1-0.20250626092019-3727363b495d + github.com/thanos-io/thanos v0.39.1 github.com/uber/jaeger-client-go v2.30.0+incompatible github.com/weaveworks/common v0.0.0-20230728070032-dd9e68f319d5 go.etcd.io/etcd/api/v3 v3.5.17 diff --git a/go.sum b/go.sum index 257aa56de3..c17b3cf593 100644 --- a/go.sum +++ b/go.sum @@ -932,8 +932,8 @@ github.com/thanos-io/objstore v0.0.0-20241111205755-d1dd89d41f97 h1:VjG0mwhN1Dkn github.com/thanos-io/objstore v0.0.0-20241111205755-d1dd89d41f97/go.mod h1:vyzFrBXgP+fGNG2FopEGWOO/zrIuoy7zt3LpLeezRsw= github.com/thanos-io/promql-engine v0.0.0-20250611170940-015ebeb7b5ff h1:obQDLbgnae6rLPngWwQ6q/ifQZeDEmVvxHIJ6arJCDs= github.com/thanos-io/promql-engine v0.0.0-20250611170940-015ebeb7b5ff/go.mod h1:IQjuIvDzOOVE2MGDs88Q65GYmmKrpmIsDkMVOqs5reo= -github.com/thanos-io/thanos v0.39.1-0.20250626092019-3727363b495d h1:bGvlnUxEAFlV7i4ztOVfb+AKFf+eDVZ7Y+G/EcFGlGo= -github.com/thanos-io/thanos v0.39.1-0.20250626092019-3727363b495d/go.mod h1:bvUPJNIx2LBXme6yBinRiGqQinxlGikLlK7PGeFQPkQ= +github.com/thanos-io/thanos v0.39.1 h1:JXFKPgvmf7XohV8ylasxERkRLgxqwbhuu6JkrWIgrio= +github.com/thanos-io/thanos v0.39.1/go.mod h1:bvUPJNIx2LBXme6yBinRiGqQinxlGikLlK7PGeFQPkQ= github.com/thanos-io/thanos-prometheus v0.0.0-20250610133519-082594458a88 h1:5uf08MPb6xrVo4rxmBDh9/1SLthbZGY9zLeF3oMixh8= github.com/thanos-io/thanos-prometheus v0.0.0-20250610133519-082594458a88/go.mod h1:WEq2ogBPZoLjj9x5K67VEk7ECR0nRD9XCjaOt1lsYck= github.com/tjhop/slog-gokit v0.1.4 h1:uj/vbDt3HaF0Py8bHPV4ti/s0utnO0miRbO277FLBKM= diff --git a/vendor/github.com/thanos-io/thanos/pkg/block/indexheader/reader_pool.go b/vendor/github.com/thanos-io/thanos/pkg/block/indexheader/reader_pool.go index 3206362b96..9af172c14d 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/block/indexheader/reader_pool.go +++ b/vendor/github.com/thanos-io/thanos/pkg/block/indexheader/reader_pool.go @@ -7,14 +7,11 @@ import ( "context" "sync" "time" - "unsafe" "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/oklog/ulid/v2" - xsync "golang.org/x/sync/singleflight" - "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" "github.com/thanos-io/objstore" @@ -52,7 +49,6 @@ type ReaderPool struct { // Keep track of all readers managed by the pool. lazyReadersMx sync.Mutex lazyReaders map[*LazyBinaryReader]struct{} - lazyReadersSF xsync.Group lazyDownloadFunc LazyDownloadIndexHeaderFunc } @@ -127,16 +123,18 @@ func NewReaderPool(logger log.Logger, lazyReaderEnabled bool, lazyReaderIdleTime // with lazy reader enabled, this function will return a lazy reader. The returned lazy reader // is tracked by the pool and automatically closed once the idle timeout expires. func (p *ReaderPool) NewBinaryReader(ctx context.Context, logger log.Logger, bkt objstore.BucketReader, dir string, id ulid.ULID, postingOffsetsInMemSampling int, meta *metadata.Meta) (Reader, error) { - if !p.lazyReaderEnabled { - return NewBinaryReader(ctx, logger, bkt, dir, id, postingOffsetsInMemSampling, p.metrics.binaryReader) - } + var reader Reader + var err error - idBytes := id.Bytes() - lazyReader, err, _ := p.lazyReadersSF.Do(*(*string)(unsafe.Pointer(&idBytes)), func() (interface{}, error) { - return NewLazyBinaryReader(ctx, logger, bkt, dir, id, postingOffsetsInMemSampling, p.metrics.lazyReader, p.metrics.binaryReader, p.onLazyReaderClosed, p.lazyDownloadFunc(meta)) - }) + if p.lazyReaderEnabled { + reader, err = NewLazyBinaryReader(ctx, logger, bkt, dir, id, postingOffsetsInMemSampling, p.metrics.lazyReader, p.metrics.binaryReader, p.onLazyReaderClosed, p.lazyDownloadFunc(meta)) + } else { + reader, err = NewBinaryReader(ctx, logger, bkt, dir, id, postingOffsetsInMemSampling, p.metrics.binaryReader) + } - reader := lazyReader.(Reader) + if err != nil { + return nil, err + } // Keep track of lazy readers only if required. if p.lazyReaderEnabled && p.lazyReaderIdleTimeout > 0 { diff --git a/vendor/modules.txt b/vendor/modules.txt index e61fa11ff0..0048c3b4fb 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1218,7 +1218,7 @@ github.com/thanos-io/promql-engine/query github.com/thanos-io/promql-engine/ringbuffer github.com/thanos-io/promql-engine/storage github.com/thanos-io/promql-engine/storage/prometheus -# github.com/thanos-io/thanos v0.39.1-0.20250626092019-3727363b495d +# github.com/thanos-io/thanos v0.39.1 ## explicit; go 1.24.0 github.com/thanos-io/thanos/pkg/api/query/querypb github.com/thanos-io/thanos/pkg/block