diff --git a/pkg/local_object_storage/engine/tree.go b/pkg/local_object_storage/engine/tree.go index 4af255649..891806fdd 100644 --- a/pkg/local_object_storage/engine/tree.go +++ b/pkg/local_object_storage/engine/tree.go @@ -6,7 +6,6 @@ import ( "github.com/nspcc-dev/neofs-node/pkg/local_object_storage/pilorama" "github.com/nspcc-dev/neofs-node/pkg/local_object_storage/shard" cidSDK "github.com/nspcc-dev/neofs-sdk-go/container/id" - "go.uber.org/zap" ) var _ pilorama.Forest = (*StorageEngine)(nil) @@ -21,9 +20,9 @@ func (e *StorageEngine) TreeMove(d pilorama.CIDDescriptor, treeID string, m *pil if errors.Is(err, shard.ErrReadOnlyMode) { return nil, err } - e.reportShardError(sh, sh.writeErrorCount, "can't perform `TreeMove`", err, - zap.Stringer("cid", d.CID), - zap.String("tree", treeID)) + //e.reportShardError(sh, sh.writeErrorCount, "can't perform `TreeMove`", err, + // zap.Stringer("cid", d.CID), + // zap.String("tree", treeID)) continue } return lm, nil @@ -41,9 +40,9 @@ func (e *StorageEngine) TreeAddByPath(d pilorama.CIDDescriptor, treeID string, a if errors.Is(err, shard.ErrReadOnlyMode) { return nil, err } - e.reportShardError(sh, sh.writeErrorCount, "can't perform `TreeAddByPath`", err, - zap.Stringer("cid", d.CID), - zap.String("tree", treeID)) + //e.reportShardError(sh, sh.writeErrorCount, "can't perform `TreeAddByPath`", err, + // zap.Stringer("cid", d.CID), + // zap.String("tree", treeID)) continue } return lm, nil @@ -60,9 +59,9 @@ func (e *StorageEngine) TreeApply(d pilorama.CIDDescriptor, treeID string, m *pi if errors.Is(err, shard.ErrReadOnlyMode) { return err } - e.reportShardError(sh, sh.writeErrorCount, "can't perform `TreeApply`", err, - zap.Stringer("cid", d.CID), - zap.String("tree", treeID)) + //e.reportShardError(sh, sh.writeErrorCount, "can't perform `TreeApply`", err, + // zap.Stringer("cid", d.CID), + // zap.String("tree", treeID)) continue } return nil @@ -99,9 +98,9 @@ func (e *StorageEngine) TreeGetMeta(cid cidSDK.ID, treeID string, nodeID piloram m, p, err = sh.TreeGetMeta(cid, treeID, nodeID) if err != nil { if !errors.Is(err, pilorama.ErrTreeNotFound) { - e.reportShardError(sh, sh.writeErrorCount, "can't perform `TreeGetMeta`", err, - zap.Stringer("cid", cid), - zap.String("tree", treeID)) + //e.reportShardError(sh, sh.writeErrorCount, "can't perform `TreeGetMeta`", err, + // zap.Stringer("cid", cid), + // zap.String("tree", treeID)) } continue } diff --git a/pkg/local_object_storage/shard/tree.go b/pkg/local_object_storage/shard/tree.go index 33f120a91..e6d7c85a1 100644 --- a/pkg/local_object_storage/shard/tree.go +++ b/pkg/local_object_storage/shard/tree.go @@ -9,7 +9,7 @@ var _ pilorama.Forest = (*Shard)(nil) // TreeMove implements the pilorama.Forest interface. func (s *Shard) TreeMove(d pilorama.CIDDescriptor, treeID string, m *pilorama.Move) (*pilorama.LogMove, error) { - if s.GetMode() != ModeReadWrite { + if s.GetMode() == ModeReadOnly { return nil, ErrReadOnlyMode } return s.pilorama.TreeMove(d, treeID, m) @@ -17,7 +17,7 @@ func (s *Shard) TreeMove(d pilorama.CIDDescriptor, treeID string, m *pilorama.Mo // TreeAddByPath implements the pilorama.Forest interface. func (s *Shard) TreeAddByPath(d pilorama.CIDDescriptor, treeID string, attr string, path []string, meta []pilorama.KeyValue) ([]pilorama.LogMove, error) { - if s.GetMode() != ModeReadWrite { + if s.GetMode() == ModeReadOnly { return nil, ErrReadOnlyMode } return s.pilorama.TreeAddByPath(d, treeID, attr, path, meta) @@ -25,7 +25,7 @@ func (s *Shard) TreeAddByPath(d pilorama.CIDDescriptor, treeID string, attr stri // TreeApply implements the pilorama.Forest interface. func (s *Shard) TreeApply(d pilorama.CIDDescriptor, treeID string, m *pilorama.Move) error { - if s.GetMode() != ModeReadWrite { + if s.GetMode() == ModeReadOnly { return ErrReadOnlyMode } return s.pilorama.TreeApply(d, treeID, m)