[#1559] shard: Change Degraded mode string representation

It is a flag, but is a `degraded-read-write` mode for a user.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-07-19 16:12:37 +03:00 committed by fyrchik
parent fabe717d32
commit 50e28f22f9
3 changed files with 4 additions and 5 deletions

View file

@ -108,7 +108,7 @@ func shardModeToString(m control.ShardMode) string {
case control.ShardMode_READ_ONLY:
return "read-only"
case control.ShardMode_DEGRADED:
return "degraded"
return "degraded-read-write"
case control.ShardMode_DEGRADED_READ_ONLY:
return "degraded-read-only"
default:

View file

@ -19,7 +19,7 @@ const (
shardModeReadOnly = "read-only"
shardModeReadWrite = "read-write"
shardModeDegraded = "degraded"
shardModeDegraded = "degraded-read-write"
shardModeDegradedReadOnly = "degraded-read-only"
)

View file

@ -10,8 +10,7 @@ const (
// DegradedReadOnly is a Mode value for shard that is set automatically
// after a certain number of errors is encountered. It is the same as
// `mode.ReadOnly` but also enables fallback algorithms for getting object
// in case metabase is corrupted.
// `mode.Degraded` but also is read-only.
DegradedReadOnly = Degraded | ReadOnly
)
@ -34,7 +33,7 @@ func (m Mode) String() string {
case ReadOnly:
return "READ_ONLY"
case Degraded:
return "DEGRADED"
return "DEGRADED_READ_WRITE"
case DegradedReadOnly:
return "DEGRADED_READ_ONLY"
}