Skip to content

meta/quota: fix quota list#6737

Merged
Xuyuchao-juice merged 5 commits intomainfrom
quota-fix
Mar 13, 2026
Merged

meta/quota: fix quota list#6737
Xuyuchao-juice merged 5 commits intomainfrom
quota-fix

Conversation

@Xuyuchao-juice
Copy link
Contributor

@Xuyuchao-juice Xuyuchao-juice commented Mar 12, 2026

  1. Skip quota entries that have no limits set (MaxSpace=-1 and MaxInodes=-1) when listing quotas.

rel: #6722

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR cleans up stale user/group quota entries (those with no limits and no usage) from Redis, and skips displaying quota entries with no limits set when listing quotas.

Changes:

  • Skip user/group quota entries with MaxSpace=-1 and MaxInodes=-1 when listing quotas in handleQuotaList
  • In Redis doLoadQuotas, delete stale quota entries that have no limits and zero usage
  • In Redis doFlushQuotas, use HSetNX to create a placeholder quota entry (-1, -1) when flushing usage increments, ensuring the quota key exists for scanning

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
pkg/meta/quota.go Filter out user/group quotas with no limits from listing results
pkg/meta/redis.go Delete stale no-limit/no-usage quota entries during load; create placeholder quota entries during flush with HSetNX

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Xuyuchao-juice Xuyuchao-juice marked this pull request as ready for review March 12, 2026 06:40
Signed-off-by: jiefenghuang <jiefeng@juicedata.io>
Signed-off-by: jiefenghuang <jiefeng@juicedata.io>
@Xuyuchao-juice
Copy link
Contributor Author

image

@codecov
Copy link

codecov bot commented Mar 13, 2026

Codecov Report

❌ Patch coverage is 36.66667% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 22.77%. Comparing base (86d7f0f) to head (4627729).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
pkg/meta/redis.go 0.00% 15 Missing ⚠️
pkg/meta/quota.go 73.33% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #6737       +/-   ##
===========================================
- Coverage   48.70%   22.77%   -25.93%     
===========================================
  Files         133       31      -102     
  Lines       44260    22493    -21767     
===========================================
- Hits        21555     5123    -16432     
+ Misses      20204    16798     -3406     
+ Partials     2501      572     -1929     

☔ 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 merged commit 2403352 into main Mar 13, 2026
36 checks passed
@Xuyuchao-juice Xuyuchao-juice deleted the quota-fix branch March 13, 2026 06:56
@jiefenghuang jiefenghuang changed the title meta/quota: clean up stale quota entries without limits meta/quota: fix quota list Mar 13, 2026
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