mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
refactor(util): support delete audit log in log module. #22858505
Signed-off-by: Victor1319 <zengxuewei@oppo.com>
This commit is contained in:
parent
ba48924d95
commit
89efec9e52
@ -2992,7 +2992,6 @@ func (c *Cluster) updateDataNodeSize(addr string, dp *DataPartition) error {
|
||||
}
|
||||
|
||||
func (c *Cluster) returnDataSize(addr string, dp *DataPartition) {
|
||||
// TODO:chihe debug
|
||||
if len(dp.Replicas) == 0 {
|
||||
log.LogErrorf("returnDataSize dp(%v) has no replicas", dp.PartitionID)
|
||||
return
|
||||
|
||||
@ -35,6 +35,8 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
syslog "log"
|
||||
|
||||
blog "github.com/cubefs/cubefs/blobstore/util/log"
|
||||
)
|
||||
|
||||
@ -840,7 +842,7 @@ func (l *Log) checkLogRotation(logDir, module string) {
|
||||
|
||||
func DeleteFileFilter(info os.FileInfo, diskSpaceLeft int64, module string) bool {
|
||||
if diskSpaceLeft <= 0 {
|
||||
return info.Mode().IsRegular() && strings.HasSuffix(info.Name(), RotatedExtension) && strings.HasPrefix(info.Name(), module)
|
||||
return info.Mode().IsRegular() && strings.HasSuffix(info.Name(), RotatedExtension) && (strings.HasPrefix(info.Name(), module) || strings.HasPrefix(info.Name(), "audit"))
|
||||
}
|
||||
return time.Since(info.ModTime()) > MaxReservedDays && strings.HasSuffix(info.Name(), RotatedExtension) && strings.HasPrefix(info.Name(), module)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user