Avoid ILM expiry on deleted versions that are yet to replicate (#18175)

Fixes #18167
This commit is contained in:
Poorna
2023-10-06 05:55:15 -07:00
committed by GitHub
parent 72871dbb9a
commit 9dc29d7687
7 changed files with 23 additions and 12 deletions

View File

@@ -1628,10 +1628,12 @@ func (er erasureObjects) DeleteObject(ctx context.Context, bucket, object string
var lc *lifecycle.Lifecycle
var rcfg lock.Retention
var replcfg *replication.Config
if opts.Expiration.Expire {
// Check if the current bucket has a configured lifecycle policy
lc, _ = globalLifecycleSys.Get(bucket)
rcfg, _ = globalBucketObjectLockSys.Get(bucket)
replcfg, _ = getReplicationConfig(ctx, bucket)
}
// expiration attempted on a bucket with no lifecycle
@@ -1684,7 +1686,7 @@ func (er erasureObjects) DeleteObject(ctx context.Context, bucket, object string
if opts.Expiration.Expire {
if gerr == nil {
evt := evalActionFromLifecycle(ctx, *lc, rcfg, goi)
evt := evalActionFromLifecycle(ctx, *lc, rcfg, replcfg, goi)
var isErr bool
switch evt.Action {
case lifecycle.NoneAction: