forked from TrueCloudLab/frostfs-node
[#2016] shard: Check meta first on Get
`meta` should prevent returning removed objects (`GCMark` and `TS` relations are `meta` abstractions). Signed-off-by: Pavel Karpy <p.karpy@yadro.com>
This commit is contained in:
parent
74ec71446f
commit
21717262ec
2 changed files with 14 additions and 13 deletions
|
@ -69,6 +69,7 @@ Changelog for NeoFS Node
|
|||
- Prevent leaking goroutines in the tree service (#2162)
|
||||
- Do not search for LOCK objects when delete container when session provided (#2152)
|
||||
- Race conditions on shard's mode switch (#1956)
|
||||
- Returning expired/removed objects from write-cache (#2016)
|
||||
|
||||
### Removed
|
||||
- `-g` option from `neofs-cli control ...` and `neofs-cli container create` commands (#2089)
|
||||
|
|
|
@ -98,19 +98,6 @@ func (s *Shard) fetchObjectData(addr oid.Address, skipMeta bool, cb storFetcher,
|
|||
res *objectSDK.Object
|
||||
)
|
||||
|
||||
if s.hasWriteCache() {
|
||||
res, err := wc(s.writeCache)
|
||||
if err == nil || IsErrOutOfRange(err) {
|
||||
return res, false, err
|
||||
}
|
||||
|
||||
if IsErrNotFound(err) {
|
||||
s.log.Debug("object is missing in write-cache")
|
||||
} else {
|
||||
s.log.Error("failed to fetch object from write-cache", zap.Error(err))
|
||||
}
|
||||
}
|
||||
|
||||
var exists bool
|
||||
if !skipMeta {
|
||||
var mPrm meta.ExistsPrm
|
||||
|
@ -123,6 +110,19 @@ func (s *Shard) fetchObjectData(addr oid.Address, skipMeta bool, cb storFetcher,
|
|||
exists = mRes.Exists()
|
||||
}
|
||||
|
||||
if s.hasWriteCache() {
|
||||
res, err = wc(s.writeCache)
|
||||
if err == nil || IsErrOutOfRange(err) {
|
||||
return res, false, err
|
||||
}
|
||||
|
||||
if IsErrNotFound(err) {
|
||||
s.log.Debug("object is missing in write-cache")
|
||||
} else {
|
||||
s.log.Error("failed to fetch object from write-cache", zap.Error(err))
|
||||
}
|
||||
}
|
||||
|
||||
if skipMeta || err != nil {
|
||||
res, err = cb(s.blobStor, nil)
|
||||
return res, false, err
|
||||
|
|
Loading…
Reference in a new issue