From 34bbbcf1edf9761d6f7fbfc20ffd59ebc1b9d67c Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Fri, 26 May 2023 18:30:25 +0300 Subject: [PATCH] [#78] Do not show objects missing from object service Signed-off-by: Alex Vanin --- api/layer/object.go | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/api/layer/object.go b/api/layer/object.go index 7dda0847..4f4e77a4 100644 --- a/api/layer/object.go +++ b/api/layer/object.go @@ -587,8 +587,8 @@ func (n *layer) initWorkerPool(ctx context.Context, size int, p allObjectParams, if oi == nil { // try to get object again if oi = n.objectInfoFromObjectsCacheOrFrostFS(ctx, p.Bucket, node, p.Prefix, p.Delimiter); oi == nil { - // form object info with data that the tree node contains - oi = getPartialObjectInfo(p.Bucket, node) + // do not process object which are definitely missing in object service + return } } select { @@ -610,18 +610,6 @@ func (n *layer) initWorkerPool(ctx context.Context, size int, p allObjectParams, return objCh, nil } -// getPartialObjectInfo form data.ObjectInfo using data available in data.NodeVersion. -func getPartialObjectInfo(bktInfo *data.BucketInfo, node *data.NodeVersion) *data.ObjectInfo { - return &data.ObjectInfo{ - ID: node.OID, - CID: bktInfo.CID, - Bucket: bktInfo.Name, - Name: node.FilePath, - Size: node.Size, - HashSum: node.ETag, - } -} - func (n *layer) bucketNodeVersions(ctx context.Context, bkt *data.BucketInfo, prefix string) ([]*data.NodeVersion, error) { var err error