From 59570ac075321d5a367cfde0884f2724172407f8 Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Tue, 7 Jun 2022 11:54:42 +0300 Subject: [PATCH] [#513] Don't remove delete mark object Signed-off-by: Denis Kirillov --- api/layer/layer.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/api/layer/layer.go b/api/layer/layer.go index 6d14ebdec..894ae3b2f 100644 --- a/api/layer/layer.go +++ b/api/layer/layer.go @@ -531,11 +531,10 @@ func (n *layer) removeVersionIfFound(ctx context.Context, bkt *data.BucketInfo, var deleteMarkVersion string if version.DeleteMarker != nil { deleteMarkVersion = obj.VersionID - } - - if err := n.objectDelete(ctx, bkt, version.OID); err != nil { + } else if err := n.objectDelete(ctx, bkt, version.OID); err != nil { return deleteMarkVersion, err } + return deleteMarkVersion, n.treeService.RemoveVersion(ctx, &bkt.CID, version.ID) }