[#643] objsvc/put: Unify extraBroadcastEnabled usage
All checks were successful
DCO action / DCO (pull_request) Successful in 1m26s
Vulncheck / Vulncheck (pull_request) Successful in 2m44s
Build / Build Components (1.20) (pull_request) Successful in 3m26s
Tests and linters / Staticcheck (pull_request) Successful in 3m51s
Tests and linters / Tests (1.20) (pull_request) Successful in 5m4s
Tests and linters / Tests (1.21) (pull_request) Successful in 5m46s
Tests and linters / Tests with -race (pull_request) Successful in 6m23s
Build / Build Components (1.21) (pull_request) Successful in 13m1s
Tests and linters / Lint (pull_request) Successful in 19m46s

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2023-08-23 20:38:25 +03:00
parent facd3b2c4b
commit c9e3c9956e
3 changed files with 7 additions and 8 deletions

View file

@ -130,12 +130,6 @@ func (t *distributedTarget) WriteObject(ctx context.Context, obj *objectSDK.Obje
if t.objMeta, err = t.fmtValidator.ValidateContent(t.obj); err != nil {
return fmt.Errorf("(%T) could not validate payload content: %w", t, err)
}
if len(t.obj.Children()) > 0 {
// enabling extra broadcast for linking objects
t.extraBroadcastEnabled = true
}
return t.iteratePlacement(ctx)
}
@ -157,6 +151,6 @@ func (t *distributedTarget) iteratePlacement(ctx context.Context) error {
id, _ := t.obj.ID()
iter := t.cfg.newNodeIterator(append(t.placementOpts, placement.ForObject(id)))
iter.extraBroadcastEnabled = t.extraBroadcastEnabled
iter.extraBroadcastEnabled = needAdditionalBroadcast(t.obj, false /* Distributed target is for cluster-wide PUT */)
return iter.forEachNode(ctx, t.sendObject)
}