fix(ilm): do not announce batch expiries the recheck rejected

The expiry worker now asks DeleteObjects to recheck ILM against all
pools. A rejected entry keeps its version and returns
errLifecycleNotApplicable, but the worker still wrote an ILMExpiry
audit record, an ILM trace and an s3:ObjectRemoved:Delete event for it.
Event delivery drops the error element, so consumers saw an ordinary
removal, repeated on every scan while the versions stay split across
pools.

Skip rejected entries; eligible entries of the same batch are still
reported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Feng Ruohang <rh@vonng.com>
This commit is contained in:
Feng Ruohang
2026-11-04 16:37:42 +08:00
parent 82dd12faf8
commit f321f7f1c7
2 changed files with 62 additions and 0 deletions
+6
View File
@@ -19,6 +19,7 @@ package cmd
import (
"context"
"errors"
"fmt"
"net/http"
"regexp"
@@ -471,6 +472,11 @@ func deleteObjectVersions(ctx context.Context, o ObjectLayer, bucket string, toD
})
for i, dobj := range deletedObjs {
if errors.Is(errs[i], errLifecycleNotApplicable) {
// The recheck kept this version. Do not audit or announce a
// removal that did not happen; the next scan re-evaluates it.
continue
}
oi := ObjectInfo{
Bucket: bucket,
Name: dobj.ObjectName,