Fix PutSingle
with OID that was already removed #1579
No reviewers
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#1579
Loading…
Reference in a new issue
No description provided.
Delete branch "aarifullin/frostfs-node:fix/put_single"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
PutSingle
check status within responseObjectAlreadyRemoved
errorsClose #1512
PutSingle
check status within response 7c8fa76636EC
-container@ -123,0 +128,4 @@
pObj.SetContainerID(cnr)
pObj.SetID(ech.Parent())
if _, _, err := db.exists(tx, objectCore.AddressOf(pObj), oid.Address{}, currEpoch); err != nil && clientSDK.IsErrObjectAlreadyRemoved(err) {
I would argue that this check should replace the check at line 138, because tombstones are created only for parent for EC objects.
And we always know object kind, because we do not create tombstone marks if we have no info in the metabase.
That's why the change has been introduced.
ecWriter
is chunking an EC-encoded object and sends these parts to Engine through Metabase. Meanwhile the only object that's marked as "removed" - the EC-parent.So,
db.exists(tx, objectCore.AddressOf(obj), oid.Address{}, currEpoch)
is not able to catch this because we're checking chunk - graveyard doesn't contain info about chunksDo you mean this check should be part of
exists
?I mean I you have checked
exists(parent)
, you do not need to checkexists(chunk)
-- because you already know that it is a chunk and, as you wrote,graveyard doesn't contain info about chunks
.The changes in metabase are no longer relevant because @dstepanov-yadro has already found the problem with EC-objects and fixed it within
exists
(whilst I tried to fix that out ofexists
). Nevertheless, I madewritePart
check forObjectAlreadyRemoved
error to stop writing process and return explicit error to client@ -123,0 +129,4 @@
pObj.SetID(ech.Parent())
if _, _, err := db.exists(tx, objectCore.AddressOf(pObj), oid.Address{}, currEpoch); err != nil && clientSDK.IsErrObjectAlreadyRemoved(err) {
return PutRes{}, err
And if
err != nil
, but is NOTErrObjectAlreadyRemoved
we continue?It looks really tricky, but any non-
ObjectAlreadyRemoved
-error is delegated to chunk processing further (as it is below) to not break thePut
logic.The alternative way - to introduce a separate bucket for
EC
-chunks in metabase. Literally, EC-"orphans" bucket and check a chunk indb.exists
It can be a storage error, we cannot just ignore it.
#1579 (comment)
@ -353,6 +354,9 @@ func (s *Service) redirectPutSingleRequest(ctx context.Context,
err = fmt.Errorf("response verification failed: %w", err)
}
st := apistatus.FromStatusV2(resp.GetMetaHeader().GetStatus())
Could you point me at an example of where we already use similar logic?
These lines seem out of place to me.
https://git.frostfs.info/TrueCloudLab/frostfs-sdk-go/src/branch/master/client/object_put_single.go#L162-L174
https://git.frostfs.info/TrueCloudLab/frostfs-sdk-go/src/branch/master/client/common.go#L100
Both links are from the SDK, I mean in the node.
This line is rather generic, I do not understand why
PutSingle
is special.headRequest -> verifyResponse
6347459a39
toefaa45216c
efaa45216c
tofe1d365e8f
@ -354,2 +355,4 @@
}
st := apistatus.FromStatusV2(resp.GetMetaHeader().GetStatus())
err = apistatus.ErrFromStatus(st)
Correct! Fixed
fe1d365e8f
toa0c261104e