-
Notifications
You must be signed in to change notification settings - Fork 45
Refactor policy processing in Policer #3553
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
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
aa85686
to
11029d0
Compare
// 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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@End-rey, is it of any use for GC?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, let's deal with it in #3559.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
There is no actual need to calculate it for some container precisely. The container was mocked anyway. Signed-off-by: Leonard Lyubich <[email protected]>
It was used only in tests with a single local implementation. Signed-off-by: Leonard Lyubich <[email protected]>
Signed-off-by: Leonard Lyubich <[email protected]>
Signed-off-by: Leonard Lyubich <[email protected]>
Signed-off-by: Leonard Lyubich <[email protected]>
11029d0
to
3b9000e
Compare
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 <[email protected]>
Signed-off-by: Leonard Lyubich <[email protected]>
Signed-off-by: Leonard Lyubich <[email protected]>
The only case it was passed was a function around local storage which is a Policer parameter itself. Signed-off-by: Leonard Lyubich <[email protected]>
This resulted in inheritance of `sync.RWMutex` interface that was not used and was not usable at all. Signed-off-by: Leonard Lyubich <[email protected]>
3b9000e
to
9a91db4
Compare
will help adapt Policer to EC policies
Policer
#3556