[#197] object: Make Delete method return correct status #433
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#433
Loading…
Reference in a new issue
No description provided.
Delete branch "aarifullin/frostfs-node:fix/197-correct_delete_status"
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?
Signed-off-by: Airat Arifullin a.arifullin@yadro.com
827789148b
tobca9e93a08
@ -88,3 +90,3 @@
zap.String("error", err.Error()),
)
case err == nil:
case err == nil, apiclient.IsErrObjectAlreadyRemoved(err):
Why deleting already marked for deletion object is success?
Marked for deletion object are the same as non existing objects i think.
Please, check the issue :)
Briefly: because
Delete
should return only specified statutesOk, but then we can fix case
delete of non-existing object
, because nowfrostfs-cli object delete --cid <cid> --oid <some non existing object id>
returns
failed to get raw object header: read object header via client: status: code = 2049 message = object not found
It is tricky I believe we should change API too: if we had not found an object, but it exists, we should not return OK. cc @alexvanin @realloc
@dstepanov-yadro
Oh, really. I didn't know that but you're right - I checked on my own using CLI and api methods within unittest.
It seems it's easier to extend
Delete
specification (as @fyrchik suggested above) with two statuses and avoid tricks like in my PRcc @alexvanin
So, we decided
OBJECT_ALREADY_REMOVED
cannot be returned by this function but have not decided yet should it returnOBJECT_NOT_FOUND
instead. I'd keep this PR like that - return success in the case ofOBJECT_ALREADY_REMOVED
error[#197] object: Make Delete method return correct statusto WIP: [#197] object: Make Delete method return correct statusWIP: [#197] object: Make Delete method return correct statusto [#197] object: Make Delete method return correct status