Documentation ¶
Index ¶
- Constants
- type CommandBallot
- type P1a
- type P1b
- type P2a
- type P2b
- type P3
- type P3RecoverReply
- type P3RecoverRequest
- type Paxos
- func (p *Paxos) Ballot() idservice.Ballot
- func (p *Paxos) CleanupLog()
- func (p *Paxos) GetSafeLogCleanupMarker() int
- func (p *Paxos) HandleP1a(m P1a)
- func (p *Paxos) HandleP1b(m P1b)
- func (p *Paxos) HandleP2a(m P2a)
- func (p *Paxos) HandleP2b(m P2b)
- func (p *Paxos) HandleP3(m P3)
- func (p *Paxos) HandleP3RecoverReply(m P3RecoverReply)
- func (p *Paxos) HandleP3RecoverRequest(m P3RecoverRequest)
- func (p *Paxos) HandleRequest(r net.Request, reply reply)
- func (p *Paxos) IsLeader() bool
- func (p *Paxos) Leader() idservice.ID
- func (p *Paxos) P1a()
- func (p *Paxos) P2a(r *net.Request, reply reply)
- func (p *Paxos) P3Sync(tnow int64)
- func (p *Paxos) SetActive(active bool)
- func (p *Paxos) SetBallot(b idservice.Ballot)
- func (p *Paxos) UpdateLastExecuteByNode(id idservice.ID, lastExecute int)
- type Replica
Constants ¶
View Source
const ( PropertyHeaderSlot = "Slot" PropertyHeaderBallot = "Ballot" PropertyExecute = "Execute" PropertyInProgress = "Inprogress" )
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 { Ballot idservice.Ballot ID idservice.ID // from node id Log map[int]CommandBallot // uncommitted logs }
P1b promise message
type P3RecoverReply ¶
func (*P3RecoverReply) String ¶
func (m *P3RecoverReply) String() string
type P3RecoverRequest ¶
type P3RecoverRequest struct { Ballot idservice.Ballot Slot int // contains filtered or unexported fields }
func (*P3RecoverRequest) String ¶
func (m *P3RecoverRequest) String() string
type Paxos ¶
type Paxos struct { node.Node Q1 func(*quorum.Quorum) bool Q2 func(*quorum.Quorum) bool ReplyWhenCommit bool // contains filtered or unexported fields }
Paxos instance
func (*Paxos) CleanupLog ¶
func (p *Paxos) CleanupLog()
func (*Paxos) GetSafeLogCleanupMarker ¶
func (*Paxos) HandleP3RecoverReply ¶
func (p *Paxos) HandleP3RecoverReply(m P3RecoverReply)
HandleP3RecoverReply handles slot recovery
func (*Paxos) HandleP3RecoverRequest ¶
func (p *Paxos) HandleP3RecoverRequest(m P3RecoverRequest)
HandleP3RecoverRequest handles slot recovery request at leader
func (*Paxos) HandleRequest ¶
HandleQuorumRequest handles request and start phase 1 or phase 2
func (*Paxos) P3Sync ¶
forceful sync of P3 messages if no progress was done in past 10 ms and no P3 msg was piggybacked
Click to show internal directories.
Click to hide internal directories.