From 9ac74efc41882d1b5e88756197187ae4e78871ab Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Tue, 18 Jun 2024 11:11:56 +0300 Subject: [PATCH] [#1173] shard: Use `mode` from config on `reload` Signed-off-by: Anton Nikiforov --- internal/logs/logs.go | 1 - pkg/local_object_storage/shard/control.go | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/internal/logs/logs.go b/internal/logs/logs.go index eeb2fbf3..78f00c4e 100644 --- a/internal/logs/logs.go +++ b/internal/logs/logs.go @@ -247,7 +247,6 @@ const ( ShardCouldNotCloseShardComponent = "could not close shard component" ShardCantOpenMetabaseMoveToADegradedMode = "can't open metabase, move to a degraded mode" ShardCantInitializeMetabaseMoveToADegradedreadonlyMode = "can't initialize metabase, move to a degraded-read-only mode" - ShardTryingToRestoreReadwriteMode = "trying to restore read-write mode" ShardStopEventListenerByClosedEventChannel = "stop event listener by closed `event` channel" ShardStopEventListenerByClosedStopChannel = "stop event listener by closed `stop` channel" ShardStopEventListenerByContext = "stop event listener by context" diff --git a/pkg/local_object_storage/shard/control.go b/pkg/local_object_storage/shard/control.go index 38a29cb1..90d7afdd 100644 --- a/pkg/local_object_storage/shard/control.go +++ b/pkg/local_object_storage/shard/control.go @@ -418,9 +418,7 @@ func (s *Shard) Reload(ctx context.Context, opts ...Option) error { return err } } - - s.log.Info(logs.ShardTryingToRestoreReadwriteMode) - return s.setMode(mode.ReadWrite) + return s.setMode(c.info.Mode) } func (s *Shard) lockExclusive() func() {