Change mode of shard components #1121

Merged
fyrchik merged 3 commits from achuprov/frostfs-node:feat/change_mode_shard_components into master 2024-06-05 05:55:27 +00:00
Showing only changes of commit 0b0d829346 - Show all commits

View file

@ -8,27 +8,25 @@ type Mode uint32
const ( const (
// ReadWrite is a Mode value for shard that is available // ReadWrite is a Mode value for shard that is available
// for read and write operations. Default shard mode. // for read and write operations. Default shard mode.
ReadWrite Mode = 0 ReadWrite Mode = 0b000
// DegradedReadOnly is a Mode value for shard that is set automatically // ReadOnly is a Mode value for shard that does not
// after a certain number of errors is encountered. It is the same as // accept write operation but is readable.
// `mode.Degraded` but also is read-only. ReadOnly Mode = 0b001
DegradedReadOnly = Degraded | ReadOnly
// Degraded is a Mode value for shard when the metabase is unavailable.
// It is hard to perform some modifying operations in this mode, thus it can only be set by an administrator.
Degraded Mode = 0b010
// Disabled mode is a mode where a shard is disabled. // Disabled mode is a mode where a shard is disabled.
// An existing shard can't have this mode, but it can be used in // An existing shard can't have this mode, but it can be used in
// the configuration or control service commands. // the configuration or control service commands.
Disabled = math.MaxUint32 Disabled Mode = math.MaxUint32
)
const ( // DegradedReadOnly is a Mode value for shard that is set automatically
// ReadOnly is a Mode value for shard that does not // after a certain number of errors is encountered. It is the same as
// accept write operation but is readable. // `mode.Degraded` but also is read-only.
ReadOnly Mode = 1 << iota DegradedReadOnly Mode = Degraded | ReadOnly
// Degraded is a Mode value for shard when the metabase is unavailable.
// It is hard to perform some modifying operations in this mode, thus it can only be set by an administrator.
Degraded
) )
func (m Mode) String() string { func (m Mode) String() string {