gracefulexit

package
v0.24.2 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2019 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Error = errs.Class("gracefulexit")

Error is the default error class for graceful exit package.

Functions

This section is empty.

Types

type Chore

type Chore struct {
	Loop sync2.Cycle
	// contains filtered or unexported fields
}

Chore checks for satellites that the node is exiting and creates a worker per satellite to complete the process.

architecture: Chore

func NewChore

func NewChore(log *zap.Logger, config Config, store *pieces.Store, trust *trust.Pool, dialer rpc.Dialer, satelliteDB satellites.DB) *Chore

NewChore instantiates Chore.

func (*Chore) Close

func (chore *Chore) Close() error

Close closes chore.

func (*Chore) Run

func (chore *Chore) Run(ctx context.Context) (err error)

Run starts the chore.

type Config

type Config struct {
	ChoreInterval time.Duration `help:"how often to run the chore to check for satellites for the node to exit." releaseDefault:"15m" devDefault:"10s"`
	NumWorkers    int           `help:"number of workers to handle satellite exits" default:"3"`
}

Config for the chore

type Endpoint

type Endpoint struct {
	// contains filtered or unexported fields
}

Endpoint is

func NewEndpoint

func NewEndpoint(log *zap.Logger, trust *trust.Pool, satellites satellites.DB, usageCache *pieces.BlobsUsageCache) *Endpoint

NewEndpoint creates a new graceful exit endpoint.

func (*Endpoint) GetExitProgress

GetExitProgress returns graceful exit progress on each satellite that a storagde node has started exiting.

func (*Endpoint) GetNonExitingSatellites

GetNonExitingSatellites returns a list of satellites that the storagenode has not begun a graceful exit for.

func (*Endpoint) InitiateGracefulExit

func (e *Endpoint) InitiateGracefulExit(ctx context.Context, req *pb.InitiateGracefulExitRequest) (*pb.ExitProgress, error)

InitiateGracefulExit updates one or more satellites in the storagenode's database to be gracefully exiting.

type Worker

type Worker struct {
	// contains filtered or unexported fields
}

Worker is responsible for completing the graceful exit for a given satellite.

func NewWorker

func NewWorker(log *zap.Logger, store *pieces.Store, satelliteDB satellites.DB, dialer rpc.Dialer, satelliteID storj.NodeID, satelliteAddr string) *Worker

NewWorker instantiates Worker.

func (*Worker) Close

func (worker *Worker) Close() error

Close halts the worker.

func (*Worker) Run

func (worker *Worker) Run(ctx context.Context, done func()) (err error)

Run calls the satellite endpoint, transfers pieces, validates, and responds with success or failure. It also marks the satellite finished once all the pieces have been transferred TODO handle transfers in parallel

Jump to

Keyboard shortcuts

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