Documentation ¶
Index ¶
- Constants
- type BalSlot
- type CommandBallot
- type P1a
- type P1b
- type P2a
- type P2b
- type P2bAggregated
- type P3
- type P3RecoverReply
- type P3RecoverRequest
- type PeerGroup
- type PigPaxos
- func (p *PigPaxos) Ballot() idservice.Ballot
- func (p *PigPaxos) CheckTimeout(timeout int64)
- func (p *PigPaxos) CleanupLog()
- func (p *PigPaxos) GetSafeLogCleanupMarker() int
- func (p *PigPaxos) HandleP1a(m P1a, reply idservice.ID)
- func (p *PigPaxos) HandleP1b(m P1b)
- func (p *PigPaxos) HandleP2a(m P2a, reply idservice.ID)
- func (p *PigPaxos) HandleP2b(msgSlot int, msgBallot idservice.Ballot, votedIds []idservice.ID)
- func (p *PigPaxos) HandleP3(m P3)
- func (p *PigPaxos) HandleP3RecoverReply(m P3RecoverReply)
- func (p *PigPaxos) HandleP3RecoverRequest(m P3RecoverRequest)
- func (p *PigPaxos) HandleRequest(r net.Request, reply reply)
- func (p *PigPaxos) IsLeader() bool
- func (p *PigPaxos) Leader() idservice.ID
- func (p *PigPaxos) P1a()
- func (p *PigPaxos) P2a(r *net.Request, reply reply)
- func (p *PigPaxos) RetryP1a()
- func (p *PigPaxos) RetryP2a(slot int, e *entry)
- func (p *PigPaxos) SetActive(active bool)
- func (p *PigPaxos) SetBallot(b idservice.Ballot)
- func (p *PigPaxos) UpdateLastExecuteByNode(id idservice.ID, lastExecute int)
- type RelayToLeader
- type Replica
- type RoutedMsg
Constants ¶
View Source
const GrayTimeoutMultiplier = 1000
View Source
const TickerDuration = 10
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandBallot ¶
CommandBallot combines each command with its ballot number
func (CommandBallot) String ¶
func (cb CommandBallot) String() string
type P1b ¶
type P1b struct { ID idservice.ID // from node id Ballot idservice.Ballot Log map[int]CommandBallot // uncommitted logs }
P1b promise message
type P2bAggregated ¶
type P2bAggregated struct { MissingIDs []idservice.ID // node ids not collected by relay RelayID idservice.ID RelayLastExecute int Ballot idservice.Ballot Slot int }
P2b accepted message
func (P2bAggregated) String ¶
func (m P2bAggregated) String() string
type P3RecoverReply ¶
func (P3RecoverReply) String ¶
func (m P3RecoverReply) String() string
type P3RecoverRequest ¶
func (P3RecoverRequest) String ¶
func (m P3RecoverRequest) String() string
type PeerGroup ¶
type PeerGroup struct {
// contains filtered or unexported fields
}
func (*PeerGroup) GetRandomNodeId ¶
type PigPaxos ¶
type PigPaxos struct { node.Node // Quorums Q1 func(*quorum.Quorum) bool Q2 func(*quorum.Quorum) bool ReplyWhenCommit bool // contains filtered or unexported fields }
Paxos instance
func NewPigPaxos ¶
NewPaxos creates new paxos instance
func (*PigPaxos) CheckTimeout ¶
func (*PigPaxos) CleanupLog ¶
func (p *PigPaxos) CleanupLog()
func (*PigPaxos) GetSafeLogCleanupMarker ¶
func (*PigPaxos) HandleP3RecoverReply ¶
func (p *PigPaxos) HandleP3RecoverReply(m P3RecoverReply)
HandleP3RecoverReply handles slot recovery
func (*PigPaxos) HandleP3RecoverRequest ¶
func (p *PigPaxos) HandleP3RecoverRequest(m P3RecoverRequest)
HandleP3RecoverRequest handles slot recovery request at leader
func (*PigPaxos) HandleRequest ¶
HandleRequest handles request and start phase 1 or phase 2
type RelayToLeader ¶
type RelayToLeader struct { BalSlot // contains filtered or unexported fields }
type Replica ¶
type Replica struct { node.Node *PigPaxos NodeIdsToGroup map[idservice.ID]int // crash suspects GrayNodes map[idservice.ID]time.Time sync.RWMutex GrayLock sync.RWMutex // contains filtered or unexported fields }
Replica for one PigPaxos instance
func (*Replica) Broadcast ¶
func (r *Replica) Broadcast(m interface{})
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ Messaging ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Overrides Broadcast in node
Click to show internal directories.
Click to hide internal directories.