diff --git a/CHANGELOG.md b/CHANGELOG.md index abb66416e..df1022d3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ Changelog for FrostFS Node - Fix `dirty` suffix in debian package version (#53) - Prevent node process from killing by systemd when shutting down (#1465) - Restore subscriptions correctly on morph client switch (#2212) +- Expired objects could be returned if not marked with GC yet (#2213) ### Removed ### Updated diff --git a/pkg/local_object_storage/engine/get.go b/pkg/local_object_storage/engine/get.go index bbe5688f8..3db3e7c63 100644 --- a/pkg/local_object_storage/engine/get.go +++ b/pkg/local_object_storage/engine/get.go @@ -74,6 +74,7 @@ func (e *StorageEngine) get(prm GetPrm) (GetRes, error) { shPrm.SetAddress(prm.addr) var hasDegraded bool + var objectExpired bool e.iterateOverSortedShards(prm.addr, func(_ int, sh hashedShard) (stop bool) { noMeta := sh.GetMode().NoMetabase() @@ -113,7 +114,7 @@ func (e *StorageEngine) get(prm GetPrm) (GetRes, error) { case shard.IsErrObjectExpired(err): // object is found but should not // be returned - outError = errNotFound + objectExpired = true return true default: e.reportShardError(sh, "could not get object from shard", err) @@ -130,6 +131,10 @@ func (e *StorageEngine) get(prm GetPrm) (GetRes, error) { return GetRes{}, logicerr.Wrap(objectSDK.NewSplitInfoError(outSI)) } + if objectExpired { + return GetRes{}, errNotFound + } + if obj == nil { if !hasDegraded && shardWithMeta.Shard == nil || !shard.IsErrNotFound(outError) { return GetRes{}, outError