Skip to content

Conversation

@Xuyuchao-juice
Copy link
Contributor

@Xuyuchao-juice Xuyuchao-juice commented Nov 10, 2025

How about this PR
New low-level doEmptyDir interface, to batch delete files, can optimize metadata operations.

Test Reslut:
Delete a directory with 10,000 empty files
image
d6e8d37c7c7ca11f811caec817c5bb68

Multilevel directory deletion test(About 11,000 directories and 110,000 files)
image
c0e3ea91060cd13fb2f82b933359f78c

@Xuyuchao-juice Xuyuchao-juice marked this pull request as draft November 10, 2025 01:51
@codecov
Copy link

codecov bot commented Nov 10, 2025

Codecov Report

❌ Patch coverage is 64.61538% with 115 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.55%. Comparing base (c4cfbee) to head (16d439a).
⚠️ Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
pkg/meta/sql.go 64.18% 75 Missing and 26 partials ⚠️
pkg/meta/base.go 57.57% 10 Missing and 4 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #6457       +/-   ##
===========================================
+ Coverage   22.29%   55.55%   +33.26%     
===========================================
  Files          30      167      +137     
  Lines       20446    51389    +30943     
===========================================
+ Hits         4558    28551    +23993     
- Misses      15377    19728     +4351     
- Partials      511     3110     +2599     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Xuyuchao-juice Xuyuchao-juice marked this pull request as ready for review November 11, 2025 01:27
pkg/meta/sql.go Outdated

info := entryInfo{e: e, trash: trash}
n := node{Inode: e.Inode}
ok, err := s.ForUpdate().Get(&n)
Copy link
Contributor

Choose a reason for hiding this comment

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

合并查询

Copy link
Contributor

Choose a reason for hiding this comment

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

可以合并的sql语句都处理下,有挺大提升空间

@Xuyuchao-juice Xuyuchao-juice changed the title meta: optimizate the rmr emptyDir meta: optimizate the rmr emptyDir(only for sql) Nov 14, 2025
@Xuyuchao-juice Xuyuchao-juice changed the title meta: optimizate the rmr emptyDir(only for sql) meta/sql: optimizate the rmr emptyDir Nov 14, 2025
Xuyuchao-juice and others added 2 commits November 17, 2025 12:00
q := s.Table(&edge{})
for i, e := range edges {
if i == 0 {
q = q.Where("(parent = ? AND name = ?)", e.Parent, e.Name)
Copy link
Contributor

Choose a reason for hiding this comment

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

语句不会超出?可以换成简单的pair对

}

seen := make(map[Ino]uint32)
for i := range entryInfos {
Copy link
Contributor

Choose a reason for hiding this comment

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

只有真正删除才需要更新nlink

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