forked from TrueCloudLab/frostfs-node
[#240] logs: Move log messages to constants
Drop duplicate entities. Format entities. Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com> Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
d29b13454f
commit
0e31c12e63
149 changed files with 1481 additions and 687 deletions
|
@ -4,6 +4,7 @@ import (
|
|||
"errors"
|
||||
"sync"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard/mode"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/util/logicerr"
|
||||
|
@ -87,24 +88,24 @@ func (e *StorageEngine) moveToDegraded(sh *shard.Shard, errCount uint32) {
|
|||
sid := sh.ID()
|
||||
err := sh.SetMode(mode.DegradedReadOnly)
|
||||
if err != nil {
|
||||
e.log.Error("failed to move shard in degraded-read-only mode, moving to read-only",
|
||||
e.log.Error(logs.EngineFailedToMoveShardInDegradedreadonlyModeMovingToReadonly,
|
||||
zap.Stringer("shard_id", sid),
|
||||
zap.Uint32("error count", errCount),
|
||||
zap.Error(err))
|
||||
|
||||
err = sh.SetMode(mode.ReadOnly)
|
||||
if err != nil {
|
||||
e.log.Error("failed to move shard in read-only mode",
|
||||
e.log.Error(logs.EngineFailedToMoveShardInReadonlyMode,
|
||||
zap.Stringer("shard_id", sid),
|
||||
zap.Uint32("error count", errCount),
|
||||
zap.Error(err))
|
||||
} else {
|
||||
e.log.Info("shard is moved in read-only mode due to error threshold",
|
||||
e.log.Info(logs.EngineShardIsMovedInReadonlyModeDueToErrorThreshold,
|
||||
zap.Stringer("shard_id", sid),
|
||||
zap.Uint32("error count", errCount))
|
||||
}
|
||||
} else {
|
||||
e.log.Info("shard is moved in degraded mode due to error threshold",
|
||||
e.log.Info(logs.EngineShardIsMovedInDegradedModeDueToErrorThreshold,
|
||||
zap.Stringer("shard_id", sid),
|
||||
zap.Uint32("error count", errCount))
|
||||
}
|
||||
|
@ -182,7 +183,7 @@ func (e *StorageEngine) reportShardErrorWithFlags(
|
|||
default:
|
||||
// For background workers we can have a lot of such errors,
|
||||
// thus logging is done with DEBUG level.
|
||||
e.log.Debug("mode change is in progress, ignoring set-mode request",
|
||||
e.log.Debug(logs.EngineModeChangeIsInProgressIgnoringSetmodeRequest,
|
||||
zap.Stringer("shard_id", sid),
|
||||
zap.Uint32("error_count", errCount))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue