diff --git a/pkg/services/object_manager/placement/traverser.go b/pkg/services/object_manager/placement/traverser.go index 47f79a6274..c59146e2ba 100644 --- a/pkg/services/object_manager/placement/traverser.go +++ b/pkg/services/object_manager/placement/traverser.go @@ -97,10 +97,16 @@ func NewTraverser(opts ...Option) (*Traverser, error) { } else { rem = defaultCopiesVector(cfg.policy) + // compatibleZeroVector is a bool flag which is set when cfg.copyNumbers + // is [0]. In this case we should not modify `rem` slice unless track + // copies are ignored, because [0] means that all copies should be + // stored before returning OK to the client. + compatibleZeroVector := len(cfg.copyNumbers) == 1 && cfg.copyNumbers[0] == 0 + for i := range rem { if !cfg.trackCopies { rem[i] = -1 - } else if len(cfg.copyNumbers) > i { + } else if len(cfg.copyNumbers) > i && !compatibleZeroVector { rem[i] = int(cfg.copyNumbers[i]) } }