fix: overhead gc when DiskGCThreshold not set (#2750)

Signed-off-by: Jim Ma <majinjing3@gmail.com>
This commit is contained in:
Jim Ma 2023-09-21 21:04:17 +08:00 committed by GitHub
parent 47e7880fc4
commit 9eb15b218d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -813,7 +813,8 @@ func (s *storageManager) TryGC() (bool, error) {
if quotaExceed || usageExceed { if quotaExceed || usageExceed {
var bytesExceed int64 var bytesExceed int64
if quotaBytesExceed > usageBytesExceed { // only use quotaBytesExceed when s.storeOption.DiskGCThreshold > 0
if s.storeOption.DiskGCThreshold > 0 && quotaBytesExceed > usageBytesExceed {
bytesExceed = quotaBytesExceed bytesExceed = quotaBytesExceed
} else { } else {
bytesExceed = usageBytesExceed bytesExceed = usageBytesExceed