Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update github.com/thanos-io/objstore digest to b598dce (main) #9804

Merged
merged 2 commits into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ require (
github.com/okzk/sdnotify v0.0.0-20240725214427-1c1fdd37c5ac
github.com/prometheus/procfs v0.15.1
github.com/shirou/gopsutil/v4 v4.24.10
github.com/thanos-io/objstore v0.0.0-20241028150459-cfdd0e50390d
github.com/thanos-io/objstore v0.0.0-20241105144332-b598dceacb13
github.com/twmb/franz-go v1.17.1
github.com/twmb/franz-go/pkg/kadm v1.13.0
github.com/twmb/franz-go/pkg/kfake v0.0.0-20241015013301-cea7aa5d8037
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1699,8 +1699,8 @@ github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8
github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
github.com/tencentyun/cos-go-sdk-v5 v0.7.40 h1:W6vDGKCHe4wBACI1d2UgE6+50sJFhRWU4O8IB2ozzxM=
github.com/tencentyun/cos-go-sdk-v5 v0.7.40/go.mod h1:4dCEtLHGh8QPxHEkgq+nFaky7yZxQuYwgSJM87icDaw=
github.com/thanos-io/objstore v0.0.0-20241028150459-cfdd0e50390d h1:k+SLTP1mjNqXxsCiq4UYeKCe07le0ieffyuHm/YfmH8=
github.com/thanos-io/objstore v0.0.0-20241028150459-cfdd0e50390d/go.mod h1:/ZMUxFcp/nT6oYV5WslH9k07NU/+86+aibgZRmMMr/4=
github.com/thanos-io/objstore v0.0.0-20241105144332-b598dceacb13 h1:PQd6xZs18KGoCZJgL9eyYsrRGzzRwYCr4iXuehZm++w=
github.com/thanos-io/objstore v0.0.0-20241105144332-b598dceacb13/go.mod h1:/ZMUxFcp/nT6oYV5WslH9k07NU/+86+aibgZRmMMr/4=
github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU=
github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI=
github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk=
Expand Down
2 changes: 1 addition & 1 deletion pkg/compactor/blocks_cleaner.go
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ func stalePartialBlockLastModifiedTime(ctx context.Context, blockID ulid.ULID, u
lastModified = attrib.LastModified
}
return nil
}, objstore.WithRecursiveIter)
}, objstore.WithRecursiveIter())

if errors.Is(err, errStopIter) {
return time.Time{}, nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/ruler/rulestore/bucketclient/bucket_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func (b *BucketRuleStore) ListRuleGroupsForUserAndNamespace(ctx context.Context,
Name: group,
})
return nil
}, objstore.WithRecursiveIter)
}, objstore.WithRecursiveIter())
if err != nil {
return nil, err
}
Expand Down
11 changes: 11 additions & 0 deletions pkg/storage/bucket/client_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ func (m *ClientMock) Iter(ctx context.Context, dir string, f func(string) error,
return args.Error(0)
}

// IterWithAttributes mocks objstore.Bucket.IterWithAttributes().
func (m *ClientMock) IterWithAttributes(ctx context.Context, dir string, f func(attrs objstore.IterObjectAttributes) error, options ...objstore.IterOption) error {
return m.Called(ctx, dir, f, options).Error(0)
}

// SupportedIterOptions mocks objstore.Bucket.SupportedIterOptions().
func (m *ClientMock) SupportedIterOptions() []objstore.IterOptionType {
m.Called()
return nil
}

// MockIter is a convenient method to mock Iter()
func (m *ClientMock) MockIter(prefix string, objects []string, err error) {
m.MockIterWithCallback(prefix, objects, err, nil)
Expand Down
14 changes: 14 additions & 0 deletions pkg/storage/bucket/delayed_bucket_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,20 @@ func (m *DelayedBucketClient) Iter(ctx context.Context, dir string, f func(strin
return m.wrapped.Iter(ctx, dir, f, options...)
}

func (m *DelayedBucketClient) IterWithAttributes(ctx context.Context, dir string, f func(attrs objstore.IterObjectAttributes) error, options ...objstore.IterOption) error {
m.delay()
defer m.delay()

return m.wrapped.IterWithAttributes(ctx, dir, f, options...)
}

func (m *DelayedBucketClient) SupportedIterOptions() []objstore.IterOptionType {
m.delay()
defer m.delay()

return m.wrapped.SupportedIterOptions()
}

func (m *DelayedBucketClient) Get(ctx context.Context, name string) (io.ReadCloser, error) {
m.delay()
defer m.delay()
Expand Down
17 changes: 17 additions & 0 deletions pkg/storage/bucket/prefixed_bucket_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,23 @@ func (b *PrefixedBucketClient) Iter(ctx context.Context, dir string, f func(stri
}, options...)
}

// IterWithAttributes calls f for each entry in the given directory similar to Iter.
// In addition to Name, it also includes requested object attributes in the argument to f.
//
// Attributes can be requested using IterOption.
// Not all IterOptions are supported by all providers, requesting for an unsupported option will fail with ErrOptionNotSupported.
func (b *PrefixedBucketClient) IterWithAttributes(ctx context.Context, dir string, f func(objstore.IterObjectAttributes) error, options ...objstore.IterOption) error {
return b.bucket.IterWithAttributes(ctx, b.fullName(dir), func(attrs objstore.IterObjectAttributes) error {
attrs.Name = strings.TrimPrefix(attrs.Name, b.prefix+objstore.DirDelim)
return f(attrs)
}, options...)
}

// SupportedIterOptions returns a list of supported IterOptions by the underlying provider.
func (b *PrefixedBucketClient) SupportedIterOptions() []objstore.IterOptionType {
return b.bucket.SupportedIterOptions()
}

// Get returns a reader for the given object name.
func (b *PrefixedBucketClient) Get(ctx context.Context, name string) (io.ReadCloser, error) {
return b.bucket.Get(ctx, b.fullName(name))
Expand Down
10 changes: 10 additions & 0 deletions pkg/storage/bucket/sse_bucket_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@ func (b *SSEBucketClient) Iter(ctx context.Context, dir string, f func(string) e
return b.bucket.Iter(ctx, dir, f, options...)
}

// IterWithAttributes implements objstore.Bucket.
func (b *SSEBucketClient) IterWithAttributes(ctx context.Context, dir string, f func(attrs objstore.IterObjectAttributes) error, options ...objstore.IterOption) error {
return b.bucket.IterWithAttributes(ctx, dir, f, options...)
}

// SupportedIterOptions implements objstore.Bucket.
func (b *SSEBucketClient) SupportedIterOptions() []objstore.IterOptionType {
return b.bucket.SupportedIterOptions()
}

// Get implements objstore.Bucket.
func (b *SSEBucketClient) Get(ctx context.Context, name string) (io.ReadCloser, error) {
return b.bucket.Get(ctx, name)
Expand Down
10 changes: 10 additions & 0 deletions pkg/storage/tsdb/block/global_markers_bucket_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,16 @@ func (b *globalMarkersBucket) Iter(ctx context.Context, dir string, f func(strin
return b.parent.Iter(ctx, dir, f, options...)
}

// IterWithAttributes implements objstore.Bucket.
func (b *globalMarkersBucket) IterWithAttributes(ctx context.Context, dir string, f func(objstore.IterObjectAttributes) error, options ...objstore.IterOption) error {
return b.parent.IterWithAttributes(ctx, dir, f, options...)
}

// SupportedIterOptions implements objstore.Bucket.
func (b *globalMarkersBucket) SupportedIterOptions() []objstore.IterOptionType {
return b.parent.SupportedIterOptions()
}

// Get implements objstore.Bucket.
func (b *globalMarkersBucket) Get(ctx context.Context, name string) (io.ReadCloser, error) {
return b.parent.Get(ctx, name)
Expand Down
8 changes: 4 additions & 4 deletions pkg/storage/tsdb/bucketcache/caching_bucket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -846,9 +846,9 @@ func TestCachingKeyObjectSubrange(t *testing.T) {

func TestCachingKeyIter(t *testing.T) {
assert.Equal(t, "iter:/object", cachingKeyIter("", "/object"))
assert.Equal(t, "iter:/object:recursive", cachingKeyIter("", "/object", objstore.WithRecursiveIter))
assert.Equal(t, "iter:/object:recursive", cachingKeyIter("", "/object", objstore.WithRecursiveIter()))
assert.Equal(t, "test:iter:/object", cachingKeyIter("test", "/object"))
assert.Equal(t, "test:iter:/object:recursive", cachingKeyIter("test", "/object", objstore.WithRecursiveIter))
assert.Equal(t, "test:iter:/object:recursive", cachingKeyIter("test", "/object", objstore.WithRecursiveIter()))
}

func TestCachingKeyExists(t *testing.T) {
Expand Down Expand Up @@ -886,7 +886,7 @@ func TestCachingKey_ShouldKeepAllocationsToMinimum(t *testing.T) {
},
"cachingKeyIter() recursive": {
run: func(bucketID string) {
cachingKeyIter(bucketID, "/dir", objstore.WithRecursiveIter)
cachingKeyIter(bucketID, "/dir", objstore.WithRecursiveIter())
},
expectedAllocs: 2.0,
},
Expand Down Expand Up @@ -1023,7 +1023,7 @@ func BenchmarkCachingKey(b *testing.B) {
},
"cachingKeyIter() recursive": {
run: func(bucketID string) {
cachingKeyIter(bucketID, "/dir", objstore.WithRecursiveIter)
cachingKeyIter(bucketID, "/dir", objstore.WithRecursiveIter())
},
},
"cachingKeyExists()": {
Expand Down
1 change: 1 addition & 0 deletions vendor/github.com/thanos-io/objstore/CHANGELOG.md

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

23 changes: 19 additions & 4 deletions vendor/github.com/thanos-io/objstore/README.md

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

14 changes: 14 additions & 0 deletions vendor/github.com/thanos-io/objstore/inmem.go

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

Loading
Loading