From 64a5294b2747cd44ff0938197c498617b42111a1 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Tue, 17 Jan 2023 18:58:26 +0300 Subject: [PATCH] [#2200] shard: Do not fetch big objects from blobovniczas Signed-off-by: Pavel Karpy Signed-off-by: Evgenii Stratonikov --- CHANGELOG.md | 1 + pkg/local_object_storage/shard/get.go | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c4108975..b42eedc2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Changelog for FrostFS Node - Big object removal with non-local parts (#1978) - Disable pilorama when moving to degraded mode (#2197) - Fetching blobovnicza objects that not found in write-cache (#2206) +- Do not search for the small objects in FSTree (#2206) - Correct status error for expired session token (#2207) ### Removed diff --git a/pkg/local_object_storage/shard/get.go b/pkg/local_object_storage/shard/get.go index a5da288f9..4f00995c3 100644 --- a/pkg/local_object_storage/shard/get.go +++ b/pkg/local_object_storage/shard/get.go @@ -91,6 +91,10 @@ func (s *Shard) Get(prm GetPrm) (GetRes, error) { }, err } +// emptyStorageID is an empty storageID that indicates that +// an object is big (and is stored in an FSTree, not in a blobovnicza). +var emptyStorageID = make([]byte, 0) + // fetchObjectData looks through writeCache and blobStor to find object. func (s *Shard) fetchObjectData(addr oid.Address, skipMeta bool, cb storFetcher, wc func(w writecache.Cache) (*objectSDK.Object, error)) (*objectSDK.Object, bool, error) { var ( @@ -140,7 +144,15 @@ func (s *Shard) fetchObjectData(addr oid.Address, skipMeta bool, cb storFetcher, return nil, true, fmt.Errorf("can't fetch blobovnicza id from metabase: %w", err) } - res, err := cb(s.blobStor, mExRes.StorageID()) + storageID := mExRes.StorageID() + if storageID == nil { + // `nil` storageID returned without any error + // means that object is big, `cb` expects an + // empty (but non-nil) storageID in such cases + storageID = emptyStorageID + } + + res, err := cb(s.blobStor, storageID) return res, true, err }