From 0b78af467e1dd13157433386ed5a1b1c6f006617 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 7 Dec 2022 16:27:13 +0300 Subject: [PATCH] [#2140] engine: Fix error handling in `TreeMove` Signed-off-by: Evgenii Stratonikov --- CHANGELOG.md | 1 + pkg/local_object_storage/engine/tree.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab4e47017..debfd7c3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,7 @@ Changelog for NeoFS Node - Notary requests on shutdown (#2075) - `neofs-cli container create ` check the sufficiency of the number of nodes in the selector for replicas (#2038) - Data duplication during request forwarding (#2047) +- Tree service panic on `TreeMove` operation (#2140) ### Removed - `-g` option from `neofs-cli control ...` and `neofs-cli container create` commands (#2089) diff --git a/pkg/local_object_storage/engine/tree.go b/pkg/local_object_storage/engine/tree.go index dc275b47f..8ac0afe83 100644 --- a/pkg/local_object_storage/engine/tree.go +++ b/pkg/local_object_storage/engine/tree.go @@ -14,7 +14,7 @@ var _ pilorama.Forest = (*StorageEngine)(nil) // TreeMove implements the pilorama.Forest interface. func (e *StorageEngine) TreeMove(d pilorama.CIDDescriptor, treeID string, m *pilorama.Move) (*pilorama.LogMove, error) { index, lst, err := e.getTreeShard(d.CID, treeID) - if err != nil || !errors.Is(err, pilorama.ErrTreeNotFound) { + if err != nil && !errors.Is(err, pilorama.ErrTreeNotFound) { return nil, err }