-
Notifications
You must be signed in to change notification settings - Fork 180
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
[Storage Refactor] Refactor Approvals #6868
base: master
Are you sure you want to change the base?
Conversation
77fb95b
to
5b15c09
Compare
43bfcd3
to
cc06a44
Compare
90051e1
to
a4bfe1f
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6868 +/- ##
==========================================
+ Coverage 41.11% 41.20% +0.08%
==========================================
Files 2116 2117 +1
Lines 185749 185822 +73
==========================================
+ Hits 76378 76566 +188
+ Misses 102954 102841 -113
+ Partials 6417 6415 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
added a few comments about docs, but othewise looks good.
return fmt.Errorf("could not lookup result approval ID: %w", err) | ||
} | ||
|
||
// no approval found, index the approval |
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.
should this go after the error conditional completes on line 79?
|
||
type Cache[K comparable, V any] struct { | ||
metrics module.CacheMetrics | ||
// nolint:unused |
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.
is this needed? looks like limit
is used
"github.com/onflow/flow-go/storage" | ||
) | ||
|
||
// nolint:unused |
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.
do we need all of these nolint
directives? seems like they will become out of date quickly.
} | ||
|
||
// Get will try to retrieve the resource from cache first, and then from the | ||
// injected. During normal operations, the following error returns are expected: |
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.
what's the injected
referring to here?
} | ||
|
||
// Get will try to retrieve the resource from cache first, and then from the | ||
// injected. During normal operations, the following error returns are expected: |
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.
nit: it's easier to find the error part when it starts on a new line
// injected. During normal operations, the following error returns are expected: | |
// injected. | |
// During normal operations, the following error returns are expected: |
return resource, nil | ||
} | ||
|
||
func (c *Cache[K, V]) Remove(key K) { |
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.
can you add docs for this method too?
This PR refactors the approvals storage from badger transaction to badger batch updates.
It is to prepare for switching from badger to pebble.
Referrals:
#6381
#6466