heal

package
v0.0.0-...-4afb59e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Bitrot       = "bitrotscan"
	Sleep        = "max_sleep"
	IOCount      = "max_io"
	DriveWorkers = "drive_workers"

	EnvBitrot       = "MINIO_HEAL_BITROTSCAN"
	EnvSleep        = "MINIO_HEAL_MAX_SLEEP"
	EnvIOCount      = "MINIO_HEAL_MAX_IO"
	EnvDriveWorkers = "MINIO_HEAL_DRIVE_WORKERS"
)

Compression environment variables

Variables

View Source
var DefaultKVS = config.KVS{
	config.KV{
		Key:   Bitrot,
		Value: config.EnableOff,
	},
	config.KV{
		Key:   Sleep,
		Value: "250ms",
	},
	config.KV{
		Key:   IOCount,
		Value: "100",
	},
	config.KV{
		Key:   DriveWorkers,
		Value: "",
	},
}

DefaultKVS - default KV config for heal settings

View Source
var (

	// Help provides help for config values
	Help = config.HelpKVS{
		config.HelpKV{
			Key:         Bitrot,
			Description: `perform bitrot scan on drives when checking objects during scanner` + defaultHelpPostfix(Bitrot),
			Optional:    true,
			Type:        "on|off",
		},
		config.HelpKV{
			Key:         Sleep,
			Description: `maximum sleep duration between objects to slow down heal operation` + defaultHelpPostfix(Sleep),
			Optional:    true,
			Type:        "duration",
		},
		config.HelpKV{
			Key:         IOCount,
			Description: `maximum IO requests allowed between objects to slow down heal operation` + defaultHelpPostfix(IOCount),
			Optional:    true,
			Type:        "int",
		},
		config.HelpKV{
			Key:         DriveWorkers,
			Description: `the number of workers per drive to heal a new disk replacement` + defaultHelpPostfix(DriveWorkers),
			Optional:    true,
			Type:        "int",
		},
	}
)

Help template for caching feature.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Bitrot will perform bitrot scan on local disk when checking objects.
	Bitrot string `json:"bitrotscan"`

	// maximum sleep duration between objects to slow down heal operation.
	Sleep   time.Duration `json:"sleep"`
	IOCount int           `json:"iocount"`

	DriveWorkers int `json:"drive_workers"`
	// contains filtered or unexported fields
}

Config represents the heal settings.

func LookupConfig

func LookupConfig(kvs config.KVS) (cfg Config, err error)

LookupConfig - lookup config and override with valid environment settings if any.

func (Config) BitrotScanCycle

func (opts Config) BitrotScanCycle() (d time.Duration)

BitrotScanCycle returns the configured cycle for the scanner healing -1 for not enabled

0 for contiunous bitrot scanning

>0 interval duration between cycles

func (Config) Clone

func (opts Config) Clone() (int, time.Duration, string)

Clone safely the heal configuration

func (Config) GetWorkers

func (opts Config) GetWorkers() int

GetWorkers returns the number of workers, -1 is none configured

func (*Config) Update

func (opts *Config) Update(nopts Config)

Update updates opts with nopts

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL