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

Make metabase.ContainerSize actually read-only #1975

Merged
merged 3 commits into from
Oct 26, 2022

Conversation

fyrchik
Copy link
Contributor

@fyrchik fyrchik commented Oct 26, 2022

Close #1944.
Close #1974.

From the `Bucket.ForEach` doc:
```
The provided function must not modify the bucket; this will result in undefined behavior.
```

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
@codecov
Copy link

codecov bot commented Oct 26, 2022

Codecov Report

Merging #1975 (72c66f2) into master (3c6daa2) will decrease coverage by 0.00%.
The diff coverage is 23.80%.

@@            Coverage Diff             @@
##           master    #1975      +/-   ##
==========================================
- Coverage   30.50%   30.50%   -0.01%     
==========================================
  Files         379      379              
  Lines       27705    27714       +9     
==========================================
+ Hits         8452     8453       +1     
- Misses      18557    18569      +12     
+ Partials      696      692       -4     
Impacted Files Coverage Δ
pkg/local_object_storage/engine/container.go 0.00% <0.00%> (ø)
pkg/local_object_storage/engine/select.go 40.78% <0.00%> (-0.55%) ⬇️
pkg/local_object_storage/metabase/graveyard.go 78.48% <ø> (+1.93%) ⬆️
pkg/local_object_storage/metabase/inhume.go 83.72% <0.00%> (-2.00%) ⬇️
pkg/local_object_storage/metabase/iterators.go 67.50% <ø> (+1.64%) ⬆️
pkg/local_object_storage/metabase/util.go 88.40% <ø> (+0.56%) ⬆️
pkg/local_object_storage/shard/container.go 0.00% <0.00%> (ø)
pkg/local_object_storage/shard/gc.go 23.28% <0.00%> (-1.24%) ⬇️
pkg/local_object_storage/shard/list.go 21.15% <0.00%> (-1.77%) ⬇️
pkg/local_object_storage/metabase/control.go 65.95% <50.00%> (+1.12%) ⬆️
... and 5 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

if err != nil {
return fmt.Errorf("create global bucket for locked objects: %w", err)
}
bucketLocked := tx.Bucket(bucketNameLocked)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe throw clear panic in this case instead of NPE?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is like this in many places and is not expected to happen.

Copy link
Member

@carpawell carpawell left a comment

Choose a reason for hiding this comment

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

Changelog?

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
@fyrchik fyrchik merged commit 1e6588e into nspcc-dev:master Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants