mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-05-18 15:51:29 +00:00
s3lifecycle: guard ShouldExpireNoncurrentVersion against zero SuccessorModTime
Add early return when obj.IsLatest or obj.SuccessorModTime.IsZero() to prevent premature expiration of versions with uninitialized successor timestamps (zero value would compute to epoch, always expired).
This commit is contained in:
@@ -73,6 +73,9 @@ func ShouldExpireNoncurrentVersion(rule Rule, obj ObjectInfo, noncurrentIndex in
|
||||
if rule.NoncurrentVersionExpirationDays <= 0 {
|
||||
return false
|
||||
}
|
||||
if obj.IsLatest || obj.SuccessorModTime.IsZero() {
|
||||
return false
|
||||
}
|
||||
if !matchesFilter(rule, obj) {
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user