storagenode: delete piece when upload is cancelled (#2286)
* storagenode: delete piece when upload is cancelled * don't delete when piece info has been committed
This commit is contained in:
parent
4f2e893e68
commit
23e081f0c7
@ -295,7 +295,9 @@ func (endpoint *Endpoint) Upload(stream pb.Piecestore_UploadServer) (err error)
|
||||
}
|
||||
|
||||
if err := endpoint.pieceinfo.Add(ctx, info); err != nil {
|
||||
return ErrInternal.Wrap(err)
|
||||
ignoreCancelContext := context.Background()
|
||||
deleteErr := endpoint.store.Delete(ignoreCancelContext, limit.SatelliteId, limit.PieceId)
|
||||
return ErrInternal.Wrap(errs.Combine(err, deleteErr))
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user