liveness

package
v0.0.0-...-653efa9 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2021 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateAlive   = "alive"
	StateDead    = "dead"
	StateUnknown = "unknown"
)
View Source
const (
	PrivateClusterUDPPortDefault = uint16(8123)

	UDPPacketSizeMin = uint64(1000) // Presumably >> udpPacketHeaderSize
	UDPPacketSizeMax = uint64(8000) // Presumably >> udpPacketHeaderSize

	UDPPacketSendSizeDefault = uint64(1400)
	UDPPacketRecvSizeDefault = uint64(1500)

	UDPPacketCapPerMessageDefault = uint8(math.MaxUint8)

	HeartBeatDurationDefault = "1s"

	HeartBeatMissLimitMin     = uint64(2)
	HeartBeatMissLimitDefault = uint64(3)

	MessageQueueDepthPerPeerMin     = uint64(1)
	MessageQueueDepthPerPeerDefault = uint64(4)

	MaxRequestDurationDefault = "1s"

	LivenessCheckRedundancyMin     = uint64(1)
	LivenessCheckRedundancyDefault = uint64(2)

	LogLevelNone           = uint64(0)
	LogLevelStateChanges   = uint64(1)
	LogLevelMessages       = uint64(2)
	LogLevelMessageDetails = uint64(3)
	LogLevelMax            = uint64(4)

	LogLevelDefault = LogLevelNone

	DefaultSwiftReconNoWriteThreshold   = 80
	DefaultSwiftReconReadOnlyThreshold  = 90
	DefaultSwiftConfDir                 = "/etc/swift"
	DefaultSwiftReconChecksPerConfCheck = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FetchLivenessReportRequestStruct

type FetchLivenessReportRequestStruct struct {
	MsgType MsgType //    == MsgTypeFetchLivenessReportRequest
	//                    Used to request Liveness Report from who we think is the Leader
	MsgTag      uint64 // Used for matching this FetchLivenessReportRequestStruct to a subsequent FetchLivenessReportResponseStruct
	CurrentTerm uint64
}

type FetchLivenessReportResponseStruct

type FetchLivenessReportResponseStruct struct {
	MsgType        MsgType               // == MsgTypeFetchLivenessReportResponse
	MsgTag         uint64                // Used for matching this FetchLivenessReportResponseStruct to a previous FetchLivenessReportRequestStruct
	CurrentTerm    uint64                // == LeaderTerm if Success === true (by definition)
	CurrentLeader  string                // If Success == false, this is who should actually be contacted for this (if known)
	Success        bool                  // == true if Leader is responding; == false if we are not the Leader
	LivenessReport *LivenessReportStruct // Liveness Report as collected by Leader
}

type HeartBeatRequestStruct

type HeartBeatRequestStruct struct {
	MsgType    MsgType //              == MsgTypeHeartBeatRequest
	MsgTag     uint64  //              Used for matching this HeartBeatRequestStruct to a subsequent HeartBeatResponseStruct
	LeaderTerm uint64
	NewRWMode  inode.RWModeType     // One of inode.RWModeNormal, inode.RWModeNoWrite, or inode.RWModeReadOnly
	ToObserve  *ObservingPeerStruct // VolumeStruct.State & VolumeStruct.LastCheckTime are ignored
}

type HeartBeatResponseStruct

type HeartBeatResponseStruct struct {
	MsgType     MsgType // == MsgTypeHeartBeatResponse
	MsgTag      uint64  // Used for matching this HeartBeatResponseStruct to a previous HeartBeatRequestStruct
	CurrentTerm uint64
	Success     bool
	Observed    *ObservingPeerStruct
}

type LivenessReportStruct

type LivenessReportStruct struct {
	ObservingPeer []*ObservingPeerStruct
}

func FetchLivenessReport

func FetchLivenessReport() (livenessReport *LivenessReportStruct)

type MsgType

type MsgType uint8
const (
	MsgTypeHeartBeatRequest MsgType = iota + 1 // Skip zero to avoid msg's missing the MsgType field
	MsgTypeHeartBeatResponse
	MsgTypeRequestVoteRequest
	MsgTypeRequestVoteResponse
	MsgTypeFetchLivenessReportRequest
	MsgTypeFetchLivenessReportResponse
)

type MsgTypeStruct

type MsgTypeStruct struct {
	MsgType MsgType
	MsgTag  uint64 // Used for matching a *RequestStruct to a subsequent *ResponseStruct
}

type ObservingPeerStruct

type ObservingPeerStruct struct {
	Name          string
	ServingPeer   []*ServingPeerStruct
	ReconEndpoint []*ReconEndpointStruct
}

type ReconEndpointStruct

type ReconEndpointStruct struct {
	IPAddrPort             string
	MaxDiskUsagePercentage uint8
}

type RequestVoteRequestStruct

type RequestVoteRequestStruct struct {
	MsgType       MsgType // == MsgTypeRequestVoteRequest
	MsgTag        uint64  // Used for matching this RequestVoteRequestStruct to a subsequent RequestVoteResponseStruct
	CandidateTerm uint64
}

type RequestVoteResponseStruct

type RequestVoteResponseStruct struct {
	MsgType     MsgType // == MsgTypeRequestVoteResponse
	MsgTag      uint64  // Used for matching this RequestVoteResponseStruct to a previous RequestVoteRequestStruct
	CurrentTerm uint64
	VoteGranted bool
}

type ServingPeerStruct

type ServingPeerStruct struct {
	Name          string
	State         string // One of const State{Alive|Dead|Unknown}
	LastCheckTime time.Time
	VolumeGroup   []*VolumeGroupStruct
}

type VolumeGroupStruct

type VolumeGroupStruct struct {
	Name          string
	State         string // One of const State{Alive|Dead|Unknown}
	LastCheckTime time.Time
	Volume        []*VolumeStruct
}

type VolumeStruct

type VolumeStruct struct {
	Name          string
	State         string // One of const State{Alive|Dead|Unknown}
	LastCheckTime time.Time
}

Jump to

Keyboard shortcuts

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