forked from TrueCloudLab/frostfs-node
[#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:
parent
fabe717d32
commit
50e28f22f9
3 changed files with 4 additions and 5 deletions
|
@ -108,7 +108,7 @@ func shardModeToString(m control.ShardMode) string {
|
||||||
case control.ShardMode_READ_ONLY:
|
case control.ShardMode_READ_ONLY:
|
||||||
return "read-only"
|
return "read-only"
|
||||||
case control.ShardMode_DEGRADED:
|
case control.ShardMode_DEGRADED:
|
||||||
return "degraded"
|
return "degraded-read-write"
|
||||||
case control.ShardMode_DEGRADED_READ_ONLY:
|
case control.ShardMode_DEGRADED_READ_ONLY:
|
||||||
return "degraded-read-only"
|
return "degraded-read-only"
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -19,7 +19,7 @@ const (
|
||||||
|
|
||||||
shardModeReadOnly = "read-only"
|
shardModeReadOnly = "read-only"
|
||||||
shardModeReadWrite = "read-write"
|
shardModeReadWrite = "read-write"
|
||||||
shardModeDegraded = "degraded"
|
shardModeDegraded = "degraded-read-write"
|
||||||
shardModeDegradedReadOnly = "degraded-read-only"
|
shardModeDegradedReadOnly = "degraded-read-only"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,7 @@ const (
|
||||||
|
|
||||||
// DegradedReadOnly is a Mode value for shard that is set automatically
|
// DegradedReadOnly is a Mode value for shard that is set automatically
|
||||||
// after a certain number of errors is encountered. It is the same as
|
// after a certain number of errors is encountered. It is the same as
|
||||||
// `mode.ReadOnly` but also enables fallback algorithms for getting object
|
// `mode.Degraded` but also is read-only.
|
||||||
// in case metabase is corrupted.
|
|
||||||
DegradedReadOnly = Degraded | ReadOnly
|
DegradedReadOnly = Degraded | ReadOnly
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -34,7 +33,7 @@ func (m Mode) String() string {
|
||||||
case ReadOnly:
|
case ReadOnly:
|
||||||
return "READ_ONLY"
|
return "READ_ONLY"
|
||||||
case Degraded:
|
case Degraded:
|
||||||
return "DEGRADED"
|
return "DEGRADED_READ_WRITE"
|
||||||
case DegradedReadOnly:
|
case DegradedReadOnly:
|
||||||
return "DEGRADED_READ_ONLY"
|
return "DEGRADED_READ_ONLY"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue