diff --git a/CHANGELOG.md b/CHANGELOG.md index 995f4941..3cc38e4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/pkg/services/tree/sync.go b/pkg/services/tree/sync.go index 896dea55..d14b4c54 100644 --- a/pkg/services/tree/sync.go +++ b/pkg/services/tree/sync.go @@ -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)