Skip to content

policer: drop duplicate shard copies after relocation#3908

Open
End-rey wants to merge 1 commit intomasterfrom
policer-drop-duplicates
Open

policer: drop duplicate shard copies after relocation#3908
End-rey wants to merge 1 commit intomasterfrom
policer-drop-duplicates

Conversation

@End-rey
Copy link
Copy Markdown
Contributor

@End-rey End-rey commented Mar 25, 2026

Closes #2087.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 25, 2026

Codecov Report

❌ Patch coverage is 25.53191% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.77%. Comparing base (60d685f) to head (a1b932d).

Files with missing lines Patch % Lines
pkg/local_object_storage/engine/delete.go 0.00% 30 Missing ⚠️
pkg/services/policer/check.go 66.66% 4 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@roman-khimov roman-khimov left a comment

Choose a reason for hiding this comment

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

Changelog.

default:
}

keeper, err := p.localStorage.SelectShardForObject(shardObj, obj.ShardIDs)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

@End-rey End-rey force-pushed the policer-drop-duplicates branch 2 times, most recently from 41a35da to a1b932d Compare March 27, 2026 15:38
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>
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.

After replication of object to another shard, the object remains on the returned disk forever

2 participants