From 2429508ac5df680bebc63c339d1e24a527ef1739 Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Wed, 14 Feb 2024 15:39:28 +0300 Subject: [PATCH] [#959] shard: Skip rebuild in `DEGRADED` mode Signed-off-by: Anton Nikiforov --- pkg/local_object_storage/shard/control.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pkg/local_object_storage/shard/control.go b/pkg/local_object_storage/shard/control.go index 408354b55..774fe8045 100644 --- a/pkg/local_object_storage/shard/control.go +++ b/pkg/local_object_storage/shard/control.go @@ -173,8 +173,9 @@ func (s *Shard) Init(ctx context.Context) error { s.gc.init(ctx) s.rb = newRebuilder(s.rebuildLimiter) - s.rb.Start(ctx, s.blobStor, s.metaBase, s.log) - + if !m.NoMetabase() { + s.rb.Start(ctx, s.blobStor, s.metaBase, s.log) + } return nil } @@ -327,9 +328,11 @@ func (s *Shard) Reload(ctx context.Context, opts ...Option) error { defer unlock() s.rb.Stop(s.log) - defer func() { - s.rb.Start(ctx, s.blobStor, s.metaBase, s.log) - }() + if !s.info.Mode.NoMetabase() { + defer func() { + s.rb.Start(ctx, s.blobStor, s.metaBase, s.log) + }() + } ok, err := s.metaBase.Reload(c.metaOpts...) if err != nil {