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 object prefix not being stripped for Dell ECS #561

Merged
merged 3 commits into from
Mar 1, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

* [ENHANCEMENT] Add a Shutdown handler to flush data to backend, at "/shutdown". [#526](https://github.com/grafana/tempo/pull/526)
* [BUGFIX] Fixes permissions errors on startup in GCS. [#554](https://github.com/grafana/tempo/pull/554)
* [BUGFIX] Fixes error were Dell ECS cannot list objects. [#561](https://github.com/grafana/tempo/pull/561)
kradalby marked this conversation as resolved.
Show resolved Hide resolved


## v0.6.0

Expand Down
5 changes: 3 additions & 2 deletions tempodb/backend/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,16 +271,17 @@ func (rw *readerWriter) Tenants(ctx context.Context) ([]string, error) {

// Blocks implements backend.Reader
func (rw *readerWriter) Blocks(ctx context.Context, tenantID string) ([]uuid.UUID, error) {
prefix := tenantID + "/"
// ListObjects(bucket, prefix, marker, delimiter string, maxKeys int)
res, err := rw.core.ListObjects(rw.cfg.Bucket, tenantID+"/", "", "/", 0)
res, err := rw.core.ListObjects(rw.cfg.Bucket, prefix, "", "/", 0)
if err != nil {
return nil, errors.Wrapf(err, "error listing blocks in s3 bucket, bucket: %s", rw.cfg.Bucket)
}

level.Debug(rw.logger).Log("msg", "listing blocks", "tenantID", tenantID, "found", len(res.CommonPrefixes))
var blockIDs []uuid.UUID
for _, cp := range res.CommonPrefixes {
blockID, err := uuid.Parse(strings.Split(strings.TrimPrefix(cp.Prefix, res.Prefix), "/")[0])
blockID, err := uuid.Parse(strings.Split(strings.TrimPrefix(cp.Prefix, prefix), "/")[0])
if err != nil {
return nil, errors.Wrapf(err, "error parsing uuid of obj, objectName: %s", cp.Prefix)
}
Expand Down