[#559] Return error from multipart deleting #574
Labels
No labels
P0
P1
P2
P3
good first issue
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No project
No assignees
6 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-s3-gw#574
Loading…
Reference in a new issue
No description provided.
Delete branch "mbiryukova/frostfs-s3-gw:feature/multipart_tombstone"
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: Marina Biryukova m.biryukova@yadro.com
@ -48,3 +58,3 @@
if err := n.putTombstoneObject(ctx, tomb, bkt); err != nil {
n.reqLogger(ctx).Warn(logs.FailedToPutTombstoneObject, zap.String("cid", bkt.CID.EncodeToString()), zap.Error(err))
errCh <- fmt.Errorf("put tombstone object: %w", err)
It seems that we only return the first error from errCh in
putTombstones
. Should we leave log warnings for the rest?I can add logging of all errors from channel in
putTombstones
I don't mind having logs here or log it all at once in
putTombstones
. But we should definitely log it.@ -785,0 +786,4 @@
oids, err := relations.ListAllRelations(ctx, n.frostFS.Relations(), bkt.CID, nodeVersion.OID, tokens)
if err != nil {
if !client.IsErrObjectAlreadyRemoved(err) && !client.IsErrObjectNotFound(err) {
return fmt.Errorf("failed to list all object relations '%s': %w", nodeVersion.OID.EncodeToString(), err)
Both container and object IDs are
Stringer
s. There's no need to explicitly callEncodeToString
when formatting or loggingYes, but in most places it's called, so will leave the same
@ -785,0 +783,4 @@
return fmt.Errorf("put tombstones with parts: %w", err)
}
oids, err := relations.ListAllRelations(ctx, n.frostFS.Relations(), bkt.CID, nodeVersion.OID, tokens)
Can we use something like this, to simplify a little?
nodeVersion.OID
is deleted separately so that if errors occur during removal of parts, combined object is not deleted. It will allow to remove multipart againWe can leave a comment in code about this idea.
I just meant to do this in one
for
(or extract duplicated code to function)@ -586,12 +586,16 @@ func (n *Layer) deleteUploadedParts(ctx context.Context, bkt *data.BucketInfo, p
if err != nil {
n.reqLogger(ctx).Warn(logs.FailedToListAllObjectRelations, zap.String("cid", bkt.CID.EncodeToString()),
zap.String("oid", info.OID.EncodeToString()), zap.Error(err))
continue
Shouldn't we also check error and if it isn't
object already removed
orobject not found
then return error?I did it the way it was before not to change behavior
Overall looks good to me. Let's add some logs and we should be fine.
5b10514bd3
to6755ae912d
New commits pushed, approval review dismissed automatically according to repository settings
6755ae912d
tob5237b814b
New commits pushed, approval review dismissed automatically according to repository settings
New commits pushed, approval review dismissed automatically according to repository settings