shard: Use mode from config on reload #1182

Merged
fyrchik merged 1 commit from acid-ant/frostfs-node:bugfix/1173-use-mode-from-cfg-on-reload into master 2024-06-20 11:29:19 +00:00
2 changed files with 1 additions and 4 deletions

View file

@ -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"

View file

@ -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)
}

Add zap.Stringer("mode", mode) ?

Add `zap.Stringer("mode", mode)` ?

О in Gitea stays for "Отзывчивость"

О in Gitea stays for "Отзывчивость"

It's already done here, looks redundant.

It's already done [here](https://git.frostfs.info/TrueCloudLab/frostfs-node/src/commit/75eedf71f31c8d0d68500779954e708fa884c3ee/pkg/local_object_storage/shard/mode.go#L28), looks redundant.

How about removing this line then? Seems redundant.

How about removing this line then? Seems redundant.

Agree, updated.

Agree, updated.

Add zap.Stringer("mode", mode) ?

Add `zap.Stringer("mode", mode)` ?

Add zap.Stringer("mode", mode) ?

Add `zap.Stringer("mode", mode)` ?

Add zap.Stringer("mode", mode) ?

Add `zap.Stringer("mode", mode)` ?

Add zap.Stringer("mode", mode) ?

Add `zap.Stringer("mode", mode)` ?

Add zap.Stringer("mode", mode) ?

Add `zap.Stringer("mode", mode)` ?
func (s *Shard) lockExclusive() func() {