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

engine: always select proper shard for a tree #1996

Merged
merged 1 commit into from
Nov 3, 2022

Conversation

fyrchik
Copy link
Contributor

@fyrchik fyrchik commented Oct 28, 2022

Currently there is a possibility for modifying operations to fail because of I/O errors and a new tree to be created on another shard. This commit adds existence check for modifying operations. Read operations remain as they are, not to slow things. TreeDrop is an exception, because this is a tree removal and trying multiple shards is not an unwanted behaviour.

Signed-off-by: Evgenii Stratonikov evgeniy@morphbits.ru

@codecov
Copy link

codecov bot commented Oct 28, 2022

Codecov Report

Merging #1996 (7953e51) into master (777fd32) will increase coverage by 0.01%.
The diff coverage is 21.05%.

@@            Coverage Diff             @@
##           master    #1996      +/-   ##
==========================================
+ Coverage   30.50%   30.51%   +0.01%     
==========================================
  Files         380      380              
  Lines       27808    27833      +25     
==========================================
+ Hits         8482     8494      +12     
- Misses      18625    18638      +13     
  Partials      701      701              
Impacted Files Coverage Δ
pkg/local_object_storage/engine/tree.go 0.00% <0.00%> (ø)
pkg/local_object_storage/pilorama/interface.go 100.00% <ø> (ø)
pkg/local_object_storage/shard/tree.go 0.00% <0.00%> (ø)
pkg/local_object_storage/pilorama/boltdb.go 84.38% <100.00%> (+0.28%) ⬆️
pkg/local_object_storage/pilorama/forest.go 98.37% <100.00%> (+0.05%) ⬆️

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

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 conficts


// TreeExists implements the pilorama.Forest interface.
func (f *memoryForest) TreeExists(cid cidSDK.ID, treeID string) (bool, error) {
fullID := cid.String() + "/" + treeID
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
fullID := cid.String() + "/" + treeID
fullID := cid.EncodeToString() + "/" + treeID

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Currently there is a possibility for modifying operations to fail
because of I/O errors and a new tree to be created on another shard.
This commit adds existence check for modifying operations.
Read operations remain as they are, not to slow things.
`TreeDrop` is an exception, because this is a tree removal and trying
multiple shards is not an unwanted behaviour.

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
@fyrchik fyrchik merged commit d8d3588 into nspcc-dev:master Nov 3, 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
Development

Successfully merging this pull request may close these issues.

2 participants