Documentation ¶
Index ¶
- Variables
- type BlobsCleaner
- type Chore
- type Config
- type Endpoint
- func (e *Endpoint) GetExitProgress(ctx context.Context, req *internalpb.GetExitProgressRequest) (*internalpb.GetExitProgressResponse, error)
- func (e *Endpoint) GetNonExitingSatellites(ctx context.Context, req *internalpb.GetNonExitingSatellitesRequest) (*internalpb.GetNonExitingSatellitesResponse, error)
- func (e *Endpoint) GracefulExitFeasibility(ctx context.Context, request *internalpb.GracefulExitFeasibilityRequest) (*internalpb.GracefulExitFeasibilityResponse, error)
- func (e *Endpoint) InitiateGracefulExit(ctx context.Context, req *internalpb.InitiateGracefulExitRequest) (*internalpb.ExitProgress, error)
- type ExitingSatellite
- type Service
- func (c *Service) DeletePiece(ctx context.Context, satelliteID storj.NodeID, pieceID storj.PieceID) (err error)
- func (c *Service) DeleteSatelliteData(ctx context.Context, satelliteID storj.NodeID) (err error)
- func (c *Service) ExitCompleted(ctx context.Context, satelliteID storj.NodeID, completionReceipt []byte) (err error)
- func (c *Service) ExitFailed(ctx context.Context, satelliteID storj.NodeID, reason pb.ExitFailed_Reason, ...) (err error)
- func (c *Service) ExitNotPossible(ctx context.Context, satelliteID storj.NodeID) (err error)
- func (c *Service) ListPendingExits(ctx context.Context) (_ []ExitingSatellite, err error)
- type Worker
Constants ¶
This section is empty.
Variables ¶
var ( // Error is the default error class for graceful exit package. Error = errs.Class("gracefulexit") )
Functions ¶
This section is empty.
Types ¶
type BlobsCleaner ¶ added in v1.8.1
type BlobsCleaner struct {
// contains filtered or unexported fields
}
BlobsCleaner checks for satellites that the node has completed exit successfully and clear blobs of it.
architecture: Chore
func NewBlobsCleaner ¶ added in v1.8.1
func NewBlobsCleaner(log *zap.Logger, store *pieces.Store, trust *trust.Pool, satelliteDB satellites.DB) *BlobsCleaner
NewBlobsCleaner instantiates BlobsCleaner.
func (*BlobsCleaner) RemoveBlobs ¶ added in v1.8.1
func (blobsCleaner *BlobsCleaner) RemoveBlobs(ctx context.Context) (err error)
RemoveBlobs runs blobs cleaner for satellites on which GE is completed. On node's restart checks if any of trusted satellites has GE status "successfully exited" Deletes blobs/satellite folder if exists, so if garbage collector didn't clean all SNO won't keep trash.
type Chore ¶
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, service *Service, transferService piecetransfer.Service, dialer rpc.Dialer, config Config) *Chore
NewChore instantiates Chore.
func (*Chore) AddMissing ¶ added in v1.61.1
AddMissing starts any missing satellite 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:"1m" devDefault:"10s"` NumWorkers int `help:"number of workers to handle satellite exits" default:"4"` NumConcurrentTransfers int `help:"number of concurrent transfers per graceful exit worker" default:"5"` MinBytesPerSecond memory.Size `help:"the minimum acceptable bytes that an exiting node can transfer per second to the new node" default:"5KB"` MinDownloadTimeout time.Duration `help:"the minimum duration for downloading a piece from storage nodes before timing out" default:"2m"` }
Config for graceful exit.
type Endpoint ¶
type Endpoint struct { internalpb.DRPCNodeGracefulExitUnimplementedServer // contains filtered or unexported fields }
Endpoint implements private inspector for Graceful Exit.
func NewEndpoint ¶
func NewEndpoint(log *zap.Logger, trust *trust.Pool, satellites satellites.DB, dialer rpc.Dialer, usageCache *pieces.BlobsUsageCache) *Endpoint
NewEndpoint creates a new graceful exit endpoint.
func (*Endpoint) GetExitProgress ¶
func (e *Endpoint) GetExitProgress(ctx context.Context, req *internalpb.GetExitProgressRequest) (*internalpb.GetExitProgressResponse, error)
GetExitProgress returns graceful exit progress on each satellite that a storagde node has started exiting.
func (*Endpoint) GetNonExitingSatellites ¶
func (e *Endpoint) GetNonExitingSatellites(ctx context.Context, req *internalpb.GetNonExitingSatellitesRequest) (*internalpb.GetNonExitingSatellitesResponse, error)
GetNonExitingSatellites returns a list of satellites that the storagenode has not begun a graceful exit for.
func (*Endpoint) GracefulExitFeasibility ¶ added in v1.7.1
func (e *Endpoint) GracefulExitFeasibility(ctx context.Context, request *internalpb.GracefulExitFeasibilityRequest) (*internalpb.GracefulExitFeasibilityResponse, error)
GracefulExitFeasibility returns graceful exit feasibility by node's age on chosen satellite.
func (*Endpoint) InitiateGracefulExit ¶
func (e *Endpoint) InitiateGracefulExit(ctx context.Context, req *internalpb.InitiateGracefulExitRequest) (*internalpb.ExitProgress, error)
InitiateGracefulExit updates one or more satellites in the storagenode's database to be gracefully exiting.
type ExitingSatellite ¶ added in v1.16.1
type ExitingSatellite struct { satellites.ExitProgress NodeURL storj.NodeURL }
ExitingSatellite encapsulates a node address with its graceful exit progress.
type Service ¶ added in v1.16.1
type Service struct {
// contains filtered or unexported fields
}
Service exposes methods to manage GE progress.
architecture: Service
func NewService ¶ added in v1.16.1
func NewService(log *zap.Logger, store *pieces.Store, trust *trust.Pool, satelliteDB satellites.DB, dialer rpc.Dialer, config Config) *Service
NewService is a constructor for a GE service.
func (*Service) DeletePiece ¶ added in v1.16.1
func (c *Service) DeletePiece(ctx context.Context, satelliteID storj.NodeID, pieceID storj.PieceID) (err error)
DeletePiece deletes one piece stored for a satellite, and updates the deleted byte count for the corresponding graceful exit operation.
func (*Service) DeleteSatelliteData ¶ added in v1.62.1
DeleteSatelliteData deletes all pieces and blobs stored for a satellite.
Note: this should only ever be called after exit has finished.
func (*Service) ExitCompleted ¶ added in v1.16.1
func (c *Service) ExitCompleted(ctx context.Context, satelliteID storj.NodeID, completionReceipt []byte) (err error)
ExitCompleted updates the database when a graceful exit is completed.
func (*Service) ExitFailed ¶ added in v1.16.1
func (c *Service) ExitFailed(ctx context.Context, satelliteID storj.NodeID, reason pb.ExitFailed_Reason, exitFailedBytes []byte) (err error)
ExitFailed updates the database when a graceful exit has failed.
func (*Service) ExitNotPossible ¶ added in v1.16.1
ExitNotPossible deletes the entry for the corresponding graceful exit operation. This is intended to be called when a graceful exit operation was initiated but the satellite rejected it.
func (*Service) ListPendingExits ¶ added in v1.16.1
func (c *Service) ListPendingExits(ctx context.Context) (_ []ExitingSatellite, err error)
ListPendingExits returns a slice with one record for every satellite from which this node is gracefully exiting. Each record includes the satellite's ID/address and information about the graceful exit status and progress.
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
Worker is responsible for completing the graceful exit for a given satellite.