-
Notifications
You must be signed in to change notification settings - Fork 997
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
flush dir stat in less transactions #3277
Conversation
Signed-off-by: xixi <[email protected]>
Signed-off-by: xixi <[email protected]>
Signed-off-by: xixi <[email protected]>
Signed-off-by: xixi <[email protected]>
Signed-off-by: xixi <[email protected]>
Signed-off-by: xixi <[email protected]>
Signed-off-by: xixi <[email protected]>
Signed-off-by: xixi <[email protected]>
pkg/meta/base.go
Outdated
var eg errgroup.Group | ||
for i, s := range stats { | ||
ino, stat := i, s | ||
eg.Go(func() 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.
They are independent, so we should not cancel others if one of them fail
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.
Also, we cant to update the stats right after the calculation, don't wait for other large directories. So it's better to move the parallization out of calculation
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.
Done
pkg/meta/redis.go
Outdated
for _, ino := range group { | ||
field := strconv.FormatUint(uint64(ino), 10) | ||
if stat, ok := nonexist[ino]; ok { | ||
pipe.HSetNX(ctx, spaceKey, field, stat.space) |
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.
just ignore it
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.
Ignored
Signed-off-by: xixi <[email protected]>
Signed-off-by: xixi <[email protected]>
Signed-off-by: xixi <[email protected]>
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #3277 +/- ##
==========================================
+ Coverage 55.55% 55.62% +0.07%
==========================================
Files 142 142
Lines 33741 33822 +81
==========================================
+ Hits 18746 18815 +69
- Misses 13013 13015 +2
- Partials 1982 1992 +10
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Signed-off-by: xixi <[email protected]>
No description provided.