From 1beafea0b51c1e146cdfb80f5b90dd9489cc772f Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Sun, 16 Oct 2022 16:19:14 +0300 Subject: [PATCH] [#1869] shard: Add logs for `SetMode` operations on reload Signed-off-by: Evgenii Stratonikov --- pkg/local_object_storage/shard/control.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/local_object_storage/shard/control.go b/pkg/local_object_storage/shard/control.go index cbb9b38e..fd1f8811 100644 --- a/pkg/local_object_storage/shard/control.go +++ b/pkg/local_object_storage/shard/control.go @@ -282,6 +282,7 @@ func (s *Shard) Reload(opts ...Option) error { ok, err := s.metaBase.Reload(c.metaOpts...) if err != nil { if errors.Is(err, meta.ErrDegradedMode) { + s.log.Error("can't open metabase, move to a degraded mode", zap.Error(err)) _ = s.setMode(mode.DegradedReadOnly) } return err @@ -297,10 +298,12 @@ func (s *Shard) Reload(opts ...Option) error { err = s.metaBase.Init() } if err != nil { + s.log.Error("can't initialize metabase, move to a degraded-read-only mode", zap.Error(err)) _ = s.setMode(mode.DegradedReadOnly) return err } } + s.log.Info("trying to restore read-write mode") return s.setMode(mode.ReadWrite) }