mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-05 14:02:00 +02: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:
1 parent
c820280996
commit
2f84fdfc8d
1 file changed
+3
@@ -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