From 069c4015cd8151ffc8439735c5ff36e77344dff8 Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Fri, 7 Jun 2024 08:43:17 -0700 Subject: [PATCH] Don't tier directory objects (#19891) Directory objects are used by applications that simulate the folder structure of an on-disk filesystem. These are zero-byte objects with names ending with '/'. They are only used to check whether a 'folder' exists in the namespace. --- cmd/bucket-lifecycle.go | 4 ++++ cmd/data-scanner.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/bucket-lifecycle.go b/cmd/bucket-lifecycle.go index 8e4a4a701..51d34bead 100644 --- a/cmd/bucket-lifecycle.go +++ b/cmd/bucket-lifecycle.go @@ -583,6 +583,10 @@ func enqueueTransitionImmediate(obj ObjectInfo, src lcEventSrc) { if lc, err := globalLifecycleSys.Get(obj.Bucket); err == nil { switch event := lc.Eval(obj.ToLifecycleOpts()); event.Action { case lifecycle.TransitionAction, lifecycle.TransitionVersionAction: + if obj.DeleteMarker || obj.IsDir { + // nothing to transition + return + } globalTransitionState.queueTransitionTask(obj, event, src) } } diff --git a/cmd/data-scanner.go b/cmd/data-scanner.go index 090578ab2..def5a2119 100644 --- a/cmd/data-scanner.go +++ b/cmd/data-scanner.go @@ -1233,7 +1233,7 @@ func evalActionFromLifecycle(ctx context.Context, lc lifecycle.Lifecycle, lr loc } func applyTransitionRule(event lifecycle.Event, src lcEventSrc, obj ObjectInfo) bool { - if obj.DeleteMarker { + if obj.DeleteMarker || obj.IsDir { return false } globalTransitionState.queueTransitionTask(obj, event, src)