From d8ad68d61360b6f6f3f05fa77c2c6a8ddeb1605c Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 4 May 2022 12:42:32 +0300 Subject: [PATCH] [#1344] engine: Log errors in Tree* operations Signed-off-by: Evgenii Stratonikov --- pkg/local_object_storage/engine/tree.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/pkg/local_object_storage/engine/tree.go b/pkg/local_object_storage/engine/tree.go index 04362b8c..ee2083a2 100644 --- a/pkg/local_object_storage/engine/tree.go +++ b/pkg/local_object_storage/engine/tree.go @@ -3,6 +3,7 @@ package engine import ( "github.com/nspcc-dev/neofs-node/pkg/local_object_storage/pilorama" cidSDK "github.com/nspcc-dev/neofs-sdk-go/container/id" + "go.uber.org/zap" ) var _ pilorama.Forest = (*StorageEngine)(nil) @@ -14,6 +15,10 @@ func (e *StorageEngine) TreeMove(cid cidSDK.ID, treeID string, m *pilorama.Move) for _, sh := range e.sortShardsByWeight(cid) { lm, err = sh.TreeMove(cid, treeID, m) if err != nil { + e.log.Debug("can't put node in a tree", + zap.Stringer("cid", cid), + zap.String("tree", treeID), + zap.String("err", err.Error())) continue } return lm, nil @@ -28,6 +33,10 @@ func (e *StorageEngine) TreeAddByPath(cid cidSDK.ID, treeID string, attr string, for _, sh := range e.sortShardsByWeight(cid) { lm, err = sh.TreeAddByPath(cid, treeID, attr, path, m) if err != nil { + e.log.Debug("can't put node in a tree", + zap.Stringer("cid", cid), + zap.String("tree", treeID), + zap.String("err", err.Error())) continue } return lm, nil @@ -41,6 +50,10 @@ func (e *StorageEngine) TreeApply(cid cidSDK.ID, treeID string, m *pilorama.Move for _, sh := range e.sortShardsByWeight(cid) { err = sh.TreeApply(cid, treeID, m) if err != nil { + e.log.Debug("can't put node in a tree", + zap.Stringer("cid", cid), + zap.String("tree", treeID), + zap.String("err", err.Error())) continue } return nil @@ -56,6 +69,10 @@ func (e *StorageEngine) TreeGetByPath(cid cidSDK.ID, treeID string, attr string, for _, sh := range e.sortShardsByWeight(cid) { nodes, err = sh.TreeGetByPath(cid, treeID, attr, path, latest) if err != nil { + e.log.Debug("can't put node in a tree", + zap.Stringer("cid", cid), + zap.String("tree", treeID), + zap.String("err", err.Error())) continue } return nodes, nil @@ -70,6 +87,10 @@ func (e *StorageEngine) TreeGetMeta(cid cidSDK.ID, treeID string, nodeID piloram for _, sh := range e.sortShardsByWeight(cid) { m, err = sh.TreeGetMeta(cid, treeID, nodeID) if err != nil { + e.log.Debug("can't put node in a tree", + zap.Stringer("cid", cid), + zap.String("tree", treeID), + zap.String("err", err.Error())) continue } return m, nil @@ -84,6 +105,10 @@ func (e *StorageEngine) TreeGetChildren(cid cidSDK.ID, treeID string, nodeID pil for _, sh := range e.sortShardsByWeight(cid) { nodes, err = sh.TreeGetChildren(cid, treeID, nodeID) if err != nil { + e.log.Debug("can't put node in a tree", + zap.Stringer("cid", cid), + zap.String("tree", treeID), + zap.String("err", err.Error())) continue } return nodes, nil