Trace ILM errors (#20576)

Some paths would attempt transitions but in case of failures 
no traces would be emitted.

Add traces (with errors) when transition operations fail.
This commit is contained in:
Klaus Post
2024-10-22 14:10:34 -07:00
committed by GitHub
parent 51410c9023
commit ed5ed7e490
3 changed files with 18 additions and 8 deletions
+2
View File
@@ -2365,6 +2365,7 @@ func (er erasureObjects) TransitionObject(ctx context.Context, bucket, object st
destObj, err := genTransitionObjName(bucket)
if err != nil {
traceFn(ILMTransition, nil, err)
return err
}
@@ -2378,6 +2379,7 @@ func (er erasureObjects) TransitionObject(ctx context.Context, bucket, object st
rv, err = tgtClient.Put(ctx, destObj, pr, fi.Size)
pr.CloseWithError(err)
if err != nil {
traceFn(ILMTransition, nil, err)
return err
}
fi.TransitionStatus = lifecycle.TransitionComplete