[#2154] services/tree: Do not log an error when synchronizing container of 1 node

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2022-12-15 15:15:43 +03:00 committed by Anton Nikiforov
parent 387d1e2977
commit 3bb5a320d7
2 changed files with 3 additions and 3 deletions

View file

@ -60,6 +60,7 @@ Changelog for NeoFS Node
- Incomplete object put errors do contain the deepest error's message (#2092)
- Prioritize internal addresses for clients (#2156)
- Force object removal via control service (#2145)
- Synchronizing a tree now longer reports an error for a single-node container (#2154)
### Removed
- `-g` option from `neofs-cli control ...` and `neofs-cli container create` commands (#2089)

View file

@ -21,7 +21,6 @@ import (
// ErrNotInContainer is returned when operation could not be performed
// because the node is not included in the container.
var ErrNotInContainer = errors.New("node is not in container")
var errNoOtherNodes = errors.New("no nodes to fetch trees from")
// SynchronizeAllTrees synchronizes all the trees of the container. It fetches
// tree IDs from the other container nodes. Returns ErrNotInContainer if the node
@ -43,7 +42,7 @@ func (s *Service) SynchronizeAllTrees(ctx context.Context, cid cid.ID) error {
nodes = randomizeNodeOrder(nodes, pos)
if len(nodes) == 0 {
return errNoOtherNodes
return nil
}
rawCID := make([]byte, sha256.Size)
@ -112,7 +111,7 @@ func (s *Service) SynchronizeTree(ctx context.Context, cid cid.ID, treeID string
nodes = randomizeNodeOrder(nodes, pos)
if len(nodes) == 0 {
return errNoOtherNodes
return nil
}
return s.synchronizeTree(ctx, d, treeID, nodes)