Skip to content
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

Merged
merged 12 commits into from
Mar 3, 2023
Merged

flush dir stat in less transactions #3277

merged 12 commits into from
Mar 3, 2023

Conversation

Hexilee
Copy link
Contributor

@Hexilee Hexilee commented Mar 1, 2023

No description provided.

@Hexilee Hexilee marked this pull request as ready for review March 2, 2023 07:54
@Hexilee Hexilee requested review from SandyXSD and davies and removed request for SandyXSD March 2, 2023 08:17
pkg/meta/base.go Outdated
var eg errgroup.Group
for i, s := range stats {
ino, stat := i, s
eg.Go(func() error {
Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

for _, ino := range group {
field := strconv.FormatUint(uint64(ino), 10)
if stat, ok := nonexist[ino]; ok {
pipe.HSetNX(ctx, spaceKey, field, stat.space)
Copy link
Contributor

Choose a reason for hiding this comment

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

just ignore it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ignored

pkg/meta/tkv.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Mar 3, 2023

Codecov Report

Patch coverage: 77.39% and project coverage change: +0.07 🎉

Comparison is base (7a9859d) 55.55% compared to head (945b497) 55.62%.

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     
Impacted Files Coverage Δ
pkg/meta/tkv.go 71.32% <57.14%> (-0.33%) ⬇️
pkg/meta/sql.go 59.66% <75.00%> (+0.60%) ⬆️
pkg/meta/redis.go 66.75% <83.72%> (-0.07%) ⬇️
pkg/meta/base.go 65.33% <94.11%> (+0.66%) ⬆️
pkg/meta/tkv_prefix.go 93.61% <100.00%> (+0.13%) ⬆️
pkg/vfs/handle.go 83.58% <0.00%> (-0.75%) ⬇️
pkg/chunk/disk_cache.go 72.81% <0.00%> (-0.30%) ⬇️
... and 1 more

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.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Hexilee Hexilee requested a review from davies March 3, 2023 07:38
@davies davies merged commit 7162385 into main Mar 3, 2023
@davies davies deleted the dir-stat-optimize branch March 3, 2023 08:57
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.

3 participants