From ada1b9f737dce80d05ddb15bde9eb8339ccce4fc Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Fri, 3 May 2024 17:20:41 +0300 Subject: [PATCH] [#1120] objectSvc: Fix EC put placement Use parent object ID to compute placement. Fix too many copies saving. Signed-off-by: Dmitrii Stepanov --- pkg/services/object/put/ec.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/services/object/put/ec.go b/pkg/services/object/put/ec.go index 74db3c31f..6237872fb 100644 --- a/pkg/services/object/put/ec.go +++ b/pkg/services/object/put/ec.go @@ -147,7 +147,7 @@ func (e *ecWriter) relayToContainerNode(ctx context.Context) error { } func (e *ecWriter) writeECPart(ctx context.Context, obj *objectSDK.Object) error { - t, err := placement.NewTraverser(e.placementOpts...) + t, err := placement.NewTraverser(append(e.placementOpts, placement.ForObject(obj.ECHeader().Parent()))...) if err != nil { return err } @@ -162,6 +162,7 @@ func (e *ecWriter) writeECPart(ctx context.Context, obj *objectSDK.Object) error eg.Go(func() error { return e.writePart(egCtx, obj, int(obj.ECHeader().Index()), nodes) }) + t.SubmitSuccess() } if err := eg.Wait(); err != nil { return errIncompletePut{ @@ -181,7 +182,8 @@ func (e *ecWriter) writeRawObject(ctx context.Context, obj *objectSDK.Object) er if err != nil { return err } - t, err := placement.NewTraverser(e.placementOpts...) + objID, _ := obj.ID() + t, err := placement.NewTraverser(append(e.placementOpts, placement.ForObject(objID))...) if err != nil { return err } @@ -198,6 +200,7 @@ func (e *ecWriter) writeRawObject(ctx context.Context, obj *objectSDK.Object) er eg.Go(func() error { return e.writePart(egCtx, parts[idx], idx, nodes) }) + t.SubmitSuccess() } } if err := eg.Wait(); err != nil {