policer: drop duplicate shard copies after relocation#3908
Open
policer: drop duplicate shard copies after relocation#3908
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3908 +/- ##
==========================================
- Coverage 26.78% 26.77% -0.01%
==========================================
Files 677 677
Lines 44616 44662 +46
==========================================
+ Hits 11952 11960 +8
- Misses 31553 31589 +36
- Partials 1111 1113 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
pkg/services/policer/check.go
Outdated
| default: | ||
| } | ||
|
|
||
| keeper, err := p.localStorage.SelectShardForObject(shardObj, obj.ShardIDs) |
Member
There was a problem hiding this comment.
Instead of exposing more of engine internals to policer you can just add DeleteRedundantCopies(oid.ID, shardIDs) to engine. Then it'll sort shards by object internally and iterate over them in a usual way. keeper isn't even needed then, it's the first one with a copy. Less allocations as well.
41a35da to
a1b932d
Compare
Use shard IDs from local listing to keep only the HRW-preferred local copy and mark redundant copies on other shards as garbage. Closes #2087. Signed-off-by: Andrey Butusov <andrey@nspcc.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2087.