Refactor policy processing in Policer#3553
Merged
roman-khimov merged 11 commits intomasterfrom Sep 5, 2025
Merged
Conversation
ad79ff7 to
160d832
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3553 +/- ##
==========================================
+ Coverage 25.65% 25.66% +0.01%
==========================================
Files 661 659 -2
Lines 49451 49373 -78
==========================================
- Hits 12688 12673 -15
+ Misses 35755 35695 -60
+ Partials 1008 1005 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
90e2461 to
43bd34d
Compare
c1bea86 to
aa85686
Compare
Merged
aa85686 to
11029d0
Compare
End-rey
approved these changes
Sep 4, 2025
roman-khimov
reviewed
Sep 4, 2025
| // Returns other errors of h directly. | ||
| // | ||
| // Does not modify tss. | ||
| func (db *DB) IterateCoveredByTombstones(tss map[string]oid.Address, h func(oid.Address) error) error { |
Contributor
There was a problem hiding this comment.
As I understand it, we are mainly looking at the lifetime of an object, and therefore there is no point in iterating over tombstones.
In addition to simplifying the code, caching of results is added. Since cache is not protected from slice mutations, loop filling candidate slice is adapted. Also refactor local node identifier. Will be also useful to implement processing of objects from containers with EC (#3420). Refs #1988. Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
There is no actual need to calculate it for some container precisely. The container was mocked anyway. Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
It was used only in tests with a single local implementation. Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
11029d0 to
3b9000e
Compare
roman-khimov
approved these changes
Sep 4, 2025
Container ID, object ID and address are comparable, so there is no need to additionally encode them into strings. Dropping stringers slightly improves performance and simplifies code. Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
The only case it was passed was a function around local storage which is a Policer parameter itself. Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
This resulted in inheritance of `sync.RWMutex` interface that was not used and was not usable at all. Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
3b9000e to
9a91db4
Compare
This was referenced Sep 8, 2025
Merged
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.
will help adapt Policer to EC policies
Policer#3556