Documentation ¶
Index ¶
- Constants
- func GetLatestFailedReplica(rs ...*longhorn.Replica) (res *longhorn.Replica)
- func IsPotentiallyReusableReplica(r *longhorn.Replica, hardNodeAffinity string) bool
- type Disk
- type DiskSchedulingInfo
- type ReplicaScheduler
- func (rcs *ReplicaScheduler) CheckAndReuseFailedReplica(replicas map[string]*longhorn.Replica, volume *longhorn.Volume, ...) (*longhorn.Replica, error)
- func (rcs *ReplicaScheduler) CheckReplicasSizeExpansion(v *longhorn.Volume, oldSize, newSize int64) (diskScheduleMultiError util.MultiError, err error)
- func (rcs *ReplicaScheduler) GetDiskSchedulingInfo(disk longhorn.DiskSpec, diskStatus *longhorn.DiskStatus) (*DiskSchedulingInfo, error)
- func (rcs *ReplicaScheduler) IsSchedulableToDisk(size int64, requiredStorage int64, info *DiskSchedulingInfo) bool
- func (rcs *ReplicaScheduler) RequireNewReplica(replicas map[string]*longhorn.Replica, volume *longhorn.Volume, ...) time.Duration
- func (rcs *ReplicaScheduler) ScheduleReplica(replica *longhorn.Replica, replicas map[string]*longhorn.Replica, ...) (*longhorn.Replica, util.MultiError, error)
Constants ¶
View Source
const (
FailedReplicaMaxRetryCount = 5
)
Variables ¶
This section is empty.
Functions ¶
func GetLatestFailedReplica ¶ added in v1.1.0
func IsPotentiallyReusableReplica ¶ added in v1.1.0
IsPotentiallyReusableReplica is used to check if a failed replica is potentially reusable. A potentially reusable replica means this failed replica may be able to reuse it later but it’s not valid now due to node/disk down issue.
Types ¶
type DiskSchedulingInfo ¶
type ReplicaScheduler ¶
type ReplicaScheduler struct {
// contains filtered or unexported fields
}
func NewReplicaScheduler ¶
func NewReplicaScheduler(ds *datastore.DataStore) *ReplicaScheduler
func (*ReplicaScheduler) CheckAndReuseFailedReplica ¶ added in v1.1.0
func (*ReplicaScheduler) CheckReplicasSizeExpansion ¶ added in v1.2.1
func (rcs *ReplicaScheduler) CheckReplicasSizeExpansion(v *longhorn.Volume, oldSize, newSize int64) (diskScheduleMultiError util.MultiError, err error)
func (*ReplicaScheduler) GetDiskSchedulingInfo ¶
func (rcs *ReplicaScheduler) GetDiskSchedulingInfo(disk longhorn.DiskSpec, diskStatus *longhorn.DiskStatus) (*DiskSchedulingInfo, error)
func (*ReplicaScheduler) IsSchedulableToDisk ¶
func (rcs *ReplicaScheduler) IsSchedulableToDisk(size int64, requiredStorage int64, info *DiskSchedulingInfo) bool
func (*ReplicaScheduler) RequireNewReplica ¶ added in v1.1.0
func (rcs *ReplicaScheduler) RequireNewReplica(replicas map[string]*longhorn.Replica, volume *longhorn.Volume, hardNodeAffinity string) time.Duration
RequireNewReplica is used to check if creating new replica immediately is necessary **after a reusable failed replica is not found**. If creating new replica immediately is necessary, returns 0. Otherwise, returns the duration that the caller should recheck. A new replica needs to be created when:
- the volume is a new volume (volume.Status.Robustness is Empty)
- data locality is required (hardNodeAffinity is not Empty and volume.Status.Robustness is Healthy)
- replica eviction happens (volume.Status.Robustness is Healthy)
- there is no potential reusable replica
- there is potential reusable replica but the replica replenishment wait interval is passed.
func (*ReplicaScheduler) ScheduleReplica ¶
func (rcs *ReplicaScheduler) ScheduleReplica(replica *longhorn.Replica, replicas map[string]*longhorn.Replica, volume *longhorn.Volume) (*longhorn.Replica, util.MultiError, error)
ScheduleReplica will return (nil, nil) for unschedulable replica
Click to show internal directories.
Click to hide internal directories.