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

mimirtool: validate that overwriting objects is supported #2491

Merged
merged 2 commits into from
Jul 20, 2022

Conversation

56quarters
Copy link
Contributor

@56quarters 56quarters commented Jul 20, 2022

Signed-off-by: Nick Pillitteri nick.pillitteri@grafana.com

What this PR does

Validate that the object storage backend supports Uploads to existing
objects and will overwrite their contents.

Which issue(s) this PR fixes or relates to

Fixes #2490

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Validate that the object storage backend supports `Upload`s to existing
objects and will overwrite their contents.

Fixes #2490

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
@56quarters 56quarters force-pushed the 56quarters/overwrite-validation branch from 199abf9 to 72e6f2b Compare July 20, 2022 18:05
@56quarters 56quarters marked this pull request as ready for review July 20, 2022 18:12
@@ -254,6 +262,8 @@ func (b *BucketValidationCommand) validateTestObjects(ctx context.Context) error
if err != nil {
return errors.Wrapf(err, "failed to read object (%s)", objectPath)
}

_ = reader.Close()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch, thx

Copy link
Contributor

@replay replay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

A side-thought: would it be worth it to check whether the overwritten objects actually have the new content when getting them?
I think that would be easy to test, we'd just have to update b.objectContent between the two uploads.

@56quarters
Copy link
Contributor Author

A side-thought: would it be worth it to check whether the overwritten objects actually have the new content when getting them? I think that would be easy to test, we'd just have to update b.objectContent between the two uploads.

That's a good call, to make sure the update didn't just silently get eaten.

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
@56quarters 56quarters requested a review from replay July 20, 2022 18:51
@56quarters 56quarters merged commit bdc9460 into main Jul 20, 2022
@56quarters 56quarters deleted the 56quarters/overwrite-validation branch July 20, 2022 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mimirtool bucket-validation should validate that object storage supports overwrites
2 participants