forked from TrueCloudLab/frostfs-node
[#1616] engine: Do not use batches in delete
Use a simple loop at the callsite. This way we remove as much as we can. Also, `Delete` metrics is more meaningful now. Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
parent
cda8f9df2e
commit
b064fb24d8
3 changed files with 46 additions and 41 deletions
|
@ -35,13 +35,20 @@ func (s *Server) DropObjects(_ context.Context, req *control.DropObjectsRequest)
|
|||
}
|
||||
}
|
||||
|
||||
var prm engine.DeletePrm
|
||||
prm.WithAddresses(addrList...)
|
||||
prm.WithForceRemoval()
|
||||
var firstErr error
|
||||
for i := range addrList {
|
||||
var prm engine.DeletePrm
|
||||
prm.WithForceRemoval()
|
||||
prm.WithAddress(addrList[i])
|
||||
|
||||
_, err := s.s.Delete(prm)
|
||||
if err != nil {
|
||||
return nil, status.Error(codes.Internal, err.Error())
|
||||
_, err := s.s.Delete(prm)
|
||||
if err != nil && firstErr == nil {
|
||||
firstErr = err
|
||||
}
|
||||
}
|
||||
|
||||
if firstErr != nil {
|
||||
return nil, status.Error(codes.Internal, firstErr.Error())
|
||||
}
|
||||
|
||||
// create and fill response
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue