status

package
v0.0.0-...-a3e98d7 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EpochPrepending indicates we have sent an epoch-change, but waiting for a quorum
	EpochPrepending = iota

	// EpochPending indicates that we have a quorum of epoch-change messages, waits on new-epoch
	EpochPending

	// EpochVerifying indicates we have received a new view message but it references epoch changes we cannot yet verify
	EpochVerifying

	// EpochFetching indicates we have received and verified a new epoch messages, and are waiting to get state
	EpochFetching

	// EpochEchoing indicates we have received and validated a new-epoch, waiting for a quorum of echos
	EpochEchoing

	// EpochReadying indicates we have received a quorum of echos, waiting a on qourum of readies
	EpochReadying

	// EpochReady indicates the new epoch is ready to begin
	EpochReady

	// EpochInProgress indicates the epoch is currently active
	EpochInProgress

	// EpochDone indicates this epoch has ended, either gracefully or because we sent an epoch change
	EpochDone
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket struct {
	ID        uint64          `json:"id"`
	Leader    bool            `json:"leader"`
	Sequences []SequenceState `json:"sequences"`
}

type Checkpoint

type Checkpoint struct {
	SeqNo         uint64 `json:"seq_no"`
	MaxAgreements int    `json:"max_agreements"`
	NetQuorum     bool   `json:"net_quorum"`
	LocalDecision bool   `json:"local_decision"`
}

type ClientTracker

type ClientTracker struct {
	ClientID      uint64   `json:"client_id"`
	LowWatermark  uint64   `json:"low_watermark"`
	HighWatermark uint64   `json:"high_watermark"`
	Allocated     []uint64 `json:"allocated"`
}

type EpochChange

type EpochChange struct {
	Source uint64            `json:"source"`
	Msgs   []*EpochChangeMsg `json:"messages"`
}

type EpochChangeMsg

type EpochChangeMsg struct {
	Digest []byte   `json:"digest"`
	Acks   []uint64 `json:"acks"`
}

type EpochTarget

type EpochTarget struct {
	Number       uint64           `json:"number"`
	State        EpochTargetState `json:"state"`
	EpochChanges []*EpochChange   `json:"epoch_changes"`
	Echos        []uint64         `json:"echos"`
	Readies      []uint64         `json:"readies"`
	Suspicions   []uint64         `json:"suspicions"`
	Leaders      []uint64         `json:"leaders"`
}

type EpochTargetState

type EpochTargetState int

type EpochTracker

type EpochTracker struct {
	ActiveEpoch *EpochTarget `json:"last_active_epoch"`
}

type MsgBuffer

type MsgBuffer struct {
	Component string `json:"component"`
	Size      int    `json:"size"`
	Msgs      int    `json:"msgs"`
}

func (*MsgBuffer) Compare

func (mb *MsgBuffer) Compare(other *MsgBuffer) int

Used for sorting MsgBuffers (e.g. to produce deterministic output after iteration over a map). Returns a value > 0 if mb is "greater than" other,

< 0 if mb is "smaller than" other,
0 if mb and other are equal.

Definition of greater / smaller is arbitrary.

type NodeBucket

type NodeBucket struct {
	BucketID    int    `json:"bucket_id"`
	IsLeader    bool   `json:"is_leader"`
	LastPrepare uint64 `json:"last_prepare"`
	LastCommit  uint64 `json:"last_commit"`
}

type NodeBuffer

type NodeBuffer struct {
	ID         uint64       `json:"id"`
	Size       int          `json:"size"`
	Msgs       int          `json:"msgs"`
	MsgBuffers []*MsgBuffer `json:"msg_buffers"`
}

type SequenceState

type SequenceState int
const (
	// SequenceUnitialized indicates no batch has been assigned to this sequence.
	SequenceUninitialized SequenceState = iota

	// SequenceAllocated indicates that a potentially valid batch has been assigned to this sequence.
	SequenceAllocated

	// SequencePendingRequests indicates that we are waiting for missing requests to arrive or be validated.
	SequencePendingRequests

	// SequenceReady indicates that we have all requests and are ready to proceed with the 3-phase commit.
	SequenceReady

	// SequencePreprepared indicates that we have sent a Prepare/Preprepare as follow/leader respectively.
	SequencePreprepared

	// SequencePreprepared indicates that we have sent a Commit message.
	SequencePrepared

	// SequenceCommitted indicates that we have a quorum of commit messages and the sequence is
	// eligible to commit.  Note though, that all prior sequences must commit prior to the consumer
	// seeing this commit event.
	SequenceCommitted
)

type StateMachine

type StateMachine struct {
	NodeID        uint64           `json:"node_id"`
	LowWatermark  uint64           `json:"low_watermark"`
	HighWatermark uint64           `json:"high_watermark"`
	EpochTracker  *EpochTracker    `json:"epoch_tracker"`
	NodeBuffers   []*NodeBuffer    `json:"node_buffers"`
	Buckets       []*Bucket        `json:"buckets"`
	Checkpoints   []*Checkpoint    `json:"checkpoints"`
	ClientWindows []*ClientTracker `json:"client_tracker"`
}

func (*StateMachine) Pretty

func (s *StateMachine) Pretty() string

Jump to

Keyboard shortcuts

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