Documentation ¶
Index ¶
- func AllocForRMId(txn msgs.Txn, rmId common.RMId) *msgs.Allocation
- func GetAcceptorsFromTxn(txnCap msgs.Txn) common.RMIds
- func MakeAbortBallots(txn *txnreader.TxnReader, alloc *msgs.Allocation) []*eng.Ballot
- func MakeTxnLocallyCompleteMsg(txnId *common.TxnId) []byte
- func MakeTxnSubmissionAbortMsg(txnId *common.TxnId) []byte
- func MakeTxnSubmissionCompleteMsg(txnId, subscriberId *common.TxnId) []byte
- func NewBadReads() badReads
- func NewProposal(pm *ProposerManager, txn *txnreader.TxnReader, twoFInc int, ...) *proposal
- type Acceptor
- func (arb *Acceptor) BallotAccepted(instanceRMId common.RMId, inst *instance, vUUId *common.VarUUId, ...)
- func (arb *Acceptor) ConnectedRMs(conns map[common.RMId]sconn.ServerConnection)
- func (arb *Acceptor) ConnectionEstablished(conn sconn.ServerConnection, conns map[common.RMId]sconn.ServerConnection, ...)
- func (arb *Acceptor) ConnectionLost(rmId common.RMId, conns map[common.RMId]sconn.ServerConnection)
- func (a *Acceptor) Log(keyvals ...interface{}) error
- func (a *Acceptor) Start()
- func (a *Acceptor) Status(sc *status.StatusConsumer)
- func (aalc *Acceptor) TopologyChanged(topology *configuration.Topology)
- func (aalc *Acceptor) TxnLocallyCompleteReceived(sender common.RMId)
- func (aalc *Acceptor) TxnSubmissionCompleteReceived(subId common.TxnId)
- type AcceptorDispatcher
- func (ad *AcceptorDispatcher) OneATxnVotesReceived(sender common.RMId, oneATxnVotes msgs.OneATxnVotes)
- func (ad *AcceptorDispatcher) SetMetrics(metrics *AcceptorMetrics)
- func (ad *AcceptorDispatcher) Status(sc *status.StatusConsumer)
- func (ad *AcceptorDispatcher) TwoATxnVotesReceived(sender common.RMId, twoATxnVotes msgs.TwoATxnVotes)
- func (ad *AcceptorDispatcher) TxnLocallyCompleteReceived(sender common.RMId, tlc msgs.TxnLocallyComplete)
- func (ad *AcceptorDispatcher) TxnSubmissionCompleteReceived(sender common.RMId, tsc msgs.TxnSubmissionComplete)
- type AcceptorManager
- func (am *AcceptorManager) AcceptorFinished(txnId *common.TxnId)
- func (am *AcceptorManager) OneATxnVotesReceived(sender common.RMId, txnId *common.TxnId, oneATxnVotes msgs.OneATxnVotes)
- func (am *AcceptorManager) SetMetrics(metrics *AcceptorMetrics)
- func (am *AcceptorManager) Status(sc *status.StatusConsumer)
- func (am *AcceptorManager) TopologyChanged(topology *configuration.Topology, done func(bool))
- func (am *AcceptorManager) TwoATxnVotesReceived(sender common.RMId, txn *txnreader.TxnReader, twoATxnVotes msgs.TwoATxnVotes)
- func (am *AcceptorManager) TxnLocallyCompleteReceived(sender common.RMId, txnId *common.TxnId, tlc msgs.TxnLocallyComplete)
- func (am *AcceptorManager) TxnSubmissionCompleteReceived(sender common.RMId, txnId *common.TxnId, tsc msgs.TxnSubmissionComplete)
- type AcceptorMetrics
- type BallotAccumulator
- func (ba *BallotAccumulator) AddInstancesToSeg(seg *capn.Segment) msgs.InstancesForVar_List
- func (ba *BallotAccumulator) BallotReceived(instanceRMId common.RMId, inst *instance, vUUId *common.VarUUId, ...) (*outcomeEqualId, common.TxnIds)
- func (ba *BallotAccumulator) Status(sc *status.StatusConsumer)
- type Dispatchers
- type OutcomeAccumulator
- func (oa *OutcomeAccumulator) BallotOutcomeReceived(acceptorId common.RMId, outcome *msgs.Outcome) (*msgs.Outcome, bool)
- func (oa *OutcomeAccumulator) IsAllAborts() (acceptors []common.RMId)
- func (oa *OutcomeAccumulator) Status(sc *status.StatusConsumer)
- func (oa *OutcomeAccumulator) TopologyChanged(topology *configuration.Topology) bool
- func (oa *OutcomeAccumulator) TxnGloballyCompleteReceived(acceptorId common.RMId) bool
- type Proposer
- func (pab *Proposer) Abort() (bool, error)
- func (pro *Proposer) BallotOutcomeReceived(sender common.RMId, outcome *msgs.Outcome)
- func (p *Proposer) IsTopologyTxn() bool
- func (p *Proposer) Log(keyvals ...interface{}) error
- func (p *Proposer) Start()
- func (p *Proposer) Status(sc *status.StatusConsumer)
- func (p *Proposer) TLCDone() bool
- func (p *Proposer) TopologyChanged(topology *configuration.Topology)
- func (pab *Proposer) TxnBallotsComplete(ballots ...*eng.Ballot)
- func (paf *Proposer) TxnFinished(*eng.Txn)
- func (prgc *Proposer) TxnGloballyCompleteReceived(sender common.RMId)
- func (palc *Proposer) TxnLocallyComplete(*eng.Txn)
- type ProposerDispatcher
- func (pd *ProposerDispatcher) ImmigrationReceived(migration msgs.Migration, stateChange eng.TxnLocalStateChange)
- func (pd *ProposerDispatcher) OneBTxnVotesReceived(sender common.RMId, oneBTxnVotes msgs.OneBTxnVotes)
- func (pd *ProposerDispatcher) SetMetrics(metrics *ProposerMetrics)
- func (pd *ProposerDispatcher) Status(sc *status.StatusConsumer)
- func (pd *ProposerDispatcher) TwoBTxnVotesReceived(sender common.RMId, twoBTxnVotes msgs.TwoBTxnVotes)
- func (pd *ProposerDispatcher) TxnGloballyCompleteReceived(sender common.RMId, tgc msgs.TxnGloballyComplete)
- func (pd *ProposerDispatcher) TxnReceived(sender common.RMId, txn *txnreader.TxnReader)
- func (pd *ProposerDispatcher) TxnSubmissionAbortReceived(sender common.RMId, tsa msgs.TxnSubmissionAbort)
- type ProposerManager
- func (pm *ProposerManager) FinishProposals(txnId *common.TxnId)
- func (pm *ProposerManager) ImmigrationReceived(txn *txnreader.TxnReader, varCaps msgs.Var_List, ...)
- func (pm *ProposerManager) NewPaxosProposals(txn *txnreader.TxnReader, twoFInc int, ballots []*eng.Ballot, ...)
- func (pm *ProposerManager) OneBTxnVotesReceived(sender common.RMId, txnId *common.TxnId, oneBTxnVotes msgs.OneBTxnVotes)
- func (pm *ProposerManager) SetMetrics(metrics *ProposerMetrics)
- func (pm *ProposerManager) Status(sc *status.StatusConsumer)
- func (pm *ProposerManager) TopologyChanged(topology *configuration.Topology, done func(bool))
- func (pm *ProposerManager) TwoBTxnVotesReceived(sender common.RMId, txnId *common.TxnId, txn *txnreader.TxnReader, ...)
- func (pm *ProposerManager) TxnFinished(proposer *Proposer)
- func (pm *ProposerManager) TxnGloballyCompleteReceived(sender common.RMId, txnId *common.TxnId)
- func (pm *ProposerManager) TxnLocallyComplete(p *Proposer)
- func (pm *ProposerManager) TxnReceived(sender common.RMId, txn *txnreader.TxnReader)
- func (pm *ProposerManager) TxnSubmissionAbortReceived(sender common.RMId, txnId *common.TxnId)
- type ProposerMetrics
- type ProposerMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeAbortBallots ¶
func MakeTxnSubmissionCompleteMsg ¶
func NewBadReads ¶
func NewBadReads() badReads
Types ¶
type Acceptor ¶
type Acceptor struct {
// contains filtered or unexported fields
}
func AcceptorFromData ¶
func AcceptorFromData(txnId *common.TxnId, outcome *msgs.Outcome, subsCap [][]byte, sendToAll bool, instances *msgs.InstancesForVar_List, am *AcceptorManager) *Acceptor
func NewAcceptor ¶
func NewAcceptor(txn *txnreader.TxnReader, am *AcceptorManager) *Acceptor
func (*Acceptor) BallotAccepted ¶
func (*Acceptor) ConnectedRMs ¶
func (arb *Acceptor) ConnectedRMs(conns map[common.RMId]sconn.ServerConnection)
func (*Acceptor) ConnectionEstablished ¶
func (arb *Acceptor) ConnectionEstablished(conn sconn.ServerConnection, conns map[common.RMId]sconn.ServerConnection, done func())
func (*Acceptor) ConnectionLost ¶
func (*Acceptor) Status ¶
func (a *Acceptor) Status(sc *status.StatusConsumer)
func (*Acceptor) TopologyChanged ¶
func (aalc *Acceptor) TopologyChanged(topology *configuration.Topology)
func (*Acceptor) TxnLocallyCompleteReceived ¶
type AcceptorDispatcher ¶
type AcceptorDispatcher struct { dispatcher.Dispatcher // contains filtered or unexported fields }
func NewAcceptorDispatcher ¶
func NewAcceptorDispatcher(count uint8, rmId common.RMId, cm connectionmanager.ConnectionManager, db *db.Databases, logger log.Logger) *AcceptorDispatcher
func (*AcceptorDispatcher) OneATxnVotesReceived ¶
func (ad *AcceptorDispatcher) OneATxnVotesReceived(sender common.RMId, oneATxnVotes msgs.OneATxnVotes)
func (*AcceptorDispatcher) SetMetrics ¶
func (ad *AcceptorDispatcher) SetMetrics(metrics *AcceptorMetrics)
func (*AcceptorDispatcher) Status ¶
func (ad *AcceptorDispatcher) Status(sc *status.StatusConsumer)
func (*AcceptorDispatcher) TwoATxnVotesReceived ¶
func (ad *AcceptorDispatcher) TwoATxnVotesReceived(sender common.RMId, twoATxnVotes msgs.TwoATxnVotes)
func (*AcceptorDispatcher) TxnLocallyCompleteReceived ¶
func (ad *AcceptorDispatcher) TxnLocallyCompleteReceived(sender common.RMId, tlc msgs.TxnLocallyComplete)
func (*AcceptorDispatcher) TxnSubmissionCompleteReceived ¶
func (ad *AcceptorDispatcher) TxnSubmissionCompleteReceived(sender common.RMId, tsc msgs.TxnSubmissionComplete)
type AcceptorManager ¶
type AcceptorManager struct { sconn.ServerConnectionPublisher RMId common.RMId DB *db.Databases Exe *dispatcher.Executor Topology *configuration.Topology // contains filtered or unexported fields }
func NewAcceptorManager ¶
func NewAcceptorManager(rmId common.RMId, exe *dispatcher.Executor, cm connectionmanager.ConnectionManager, db *db.Databases, logger log.Logger) *AcceptorManager
func (*AcceptorManager) AcceptorFinished ¶
func (am *AcceptorManager) AcceptorFinished(txnId *common.TxnId)
func (*AcceptorManager) OneATxnVotesReceived ¶
func (am *AcceptorManager) OneATxnVotesReceived(sender common.RMId, txnId *common.TxnId, oneATxnVotes msgs.OneATxnVotes)
func (*AcceptorManager) SetMetrics ¶
func (am *AcceptorManager) SetMetrics(metrics *AcceptorMetrics)
func (*AcceptorManager) Status ¶
func (am *AcceptorManager) Status(sc *status.StatusConsumer)
func (*AcceptorManager) TopologyChanged ¶
func (am *AcceptorManager) TopologyChanged(topology *configuration.Topology, done func(bool))
func (*AcceptorManager) TwoATxnVotesReceived ¶
func (am *AcceptorManager) TwoATxnVotesReceived(sender common.RMId, txn *txnreader.TxnReader, twoATxnVotes msgs.TwoATxnVotes)
func (*AcceptorManager) TxnLocallyCompleteReceived ¶
func (am *AcceptorManager) TxnLocallyCompleteReceived(sender common.RMId, txnId *common.TxnId, tlc msgs.TxnLocallyComplete)
func (*AcceptorManager) TxnSubmissionCompleteReceived ¶
func (am *AcceptorManager) TxnSubmissionCompleteReceived(sender common.RMId, txnId *common.TxnId, tsc msgs.TxnSubmissionComplete)
type AcceptorMetrics ¶
type AcceptorMetrics struct { Gauge prometheus.Gauge Lifespan prometheus.Observer }
type BallotAccumulator ¶
type BallotAccumulator struct {
// contains filtered or unexported fields
}
func BallotAccumulatorFromData ¶
func BallotAccumulatorFromData(txn *txnreader.TxnReader, outcome *outcomeEqualId, subsCap [][]byte, instances *msgs.InstancesForVar_List, logger log.Logger) *BallotAccumulator
func NewBallotAccumulator ¶
func NewBallotAccumulator(txn *txnreader.TxnReader, logger log.Logger) *BallotAccumulator
func (*BallotAccumulator) AddInstancesToSeg ¶
func (ba *BallotAccumulator) AddInstancesToSeg(seg *capn.Segment) msgs.InstancesForVar_List
func (*BallotAccumulator) BallotReceived ¶
func (ba *BallotAccumulator) BallotReceived(instanceRMId common.RMId, inst *instance, vUUId *common.VarUUId, txn *txnreader.TxnReader) (*outcomeEqualId, common.TxnIds)
For every vUUId involved in this txn, we should see fInc * ballots: one from each RM voting for each vUUId.
func (*BallotAccumulator) Status ¶
func (ba *BallotAccumulator) Status(sc *status.StatusConsumer)
type Dispatchers ¶
type Dispatchers struct { AcceptorDispatcher *AcceptorDispatcher VarDispatcher *eng.VarDispatcher ProposerDispatcher *ProposerDispatcher // contains filtered or unexported fields }
func NewDispatchers ¶
func NewDispatchers(cm connectionmanager.ConnectionManager, rmId common.RMId, bootCount uint32, count uint8, db *db.Databases, lc localconnection.LocalConnection, logger log.Logger) *Dispatchers
func (*Dispatchers) IsDatabaseEmpty ¶
func (d *Dispatchers) IsDatabaseEmpty() (bool, error)
type OutcomeAccumulator ¶
type OutcomeAccumulator struct {
// contains filtered or unexported fields
}
OutcomeAccumulator groups together all the different outcomes we've received for a given txn. Once we have at least fInc outcomes from distinct acceptors which all have equal Clocks, we know we have a consensus on the result.
func NewOutcomeAccumulator ¶
func (*OutcomeAccumulator) BallotOutcomeReceived ¶
func (*OutcomeAccumulator) IsAllAborts ¶
func (oa *OutcomeAccumulator) IsAllAborts() (acceptors []common.RMId)
func (*OutcomeAccumulator) Status ¶
func (oa *OutcomeAccumulator) Status(sc *status.StatusConsumer)
func (*OutcomeAccumulator) TopologyChanged ¶
func (oa *OutcomeAccumulator) TopologyChanged(topology *configuration.Topology) bool
func (*OutcomeAccumulator) TxnGloballyCompleteReceived ¶
func (oa *OutcomeAccumulator) TxnGloballyCompleteReceived(acceptorId common.RMId) bool
type Proposer ¶
type Proposer struct {
// contains filtered or unexported fields
}
func NewProposer ¶
func NewProposer(pm *ProposerManager, txn *txnreader.TxnReader, mode ProposerMode, topology *configuration.Topology) *Proposer
func ProposerFromData ¶
func ProposerFromData(pm *ProposerManager, txnId *common.TxnId, data []byte, topology *configuration.Topology) (*Proposer, error)
func (*Proposer) BallotOutcomeReceived ¶
func (*Proposer) Status ¶
func (p *Proposer) Status(sc *status.StatusConsumer)
func (*Proposer) TopologyChanged ¶
func (p *Proposer) TopologyChanged(topology *configuration.Topology)
func (*Proposer) TxnBallotsComplete ¶
func (*Proposer) TxnGloballyCompleteReceived ¶
type ProposerDispatcher ¶
type ProposerDispatcher struct { dispatcher.Dispatcher // contains filtered or unexported fields }
func NewProposerDispatcher ¶
func NewProposerDispatcher(count uint8, rmId common.RMId, bootCount uint32, cm connectionmanager.ConnectionManager, db *db.Databases, varDispatcher *eng.VarDispatcher, logger log.Logger) *ProposerDispatcher
func (*ProposerDispatcher) ImmigrationReceived ¶
func (pd *ProposerDispatcher) ImmigrationReceived(migration msgs.Migration, stateChange eng.TxnLocalStateChange)
func (*ProposerDispatcher) OneBTxnVotesReceived ¶
func (pd *ProposerDispatcher) OneBTxnVotesReceived(sender common.RMId, oneBTxnVotes msgs.OneBTxnVotes)
func (*ProposerDispatcher) SetMetrics ¶
func (pd *ProposerDispatcher) SetMetrics(metrics *ProposerMetrics)
func (*ProposerDispatcher) Status ¶
func (pd *ProposerDispatcher) Status(sc *status.StatusConsumer)
func (*ProposerDispatcher) TwoBTxnVotesReceived ¶
func (pd *ProposerDispatcher) TwoBTxnVotesReceived(sender common.RMId, twoBTxnVotes msgs.TwoBTxnVotes)
func (*ProposerDispatcher) TxnGloballyCompleteReceived ¶
func (pd *ProposerDispatcher) TxnGloballyCompleteReceived(sender common.RMId, tgc msgs.TxnGloballyComplete)
func (*ProposerDispatcher) TxnReceived ¶
func (pd *ProposerDispatcher) TxnReceived(sender common.RMId, txn *txnreader.TxnReader)
func (*ProposerDispatcher) TxnSubmissionAbortReceived ¶
func (pd *ProposerDispatcher) TxnSubmissionAbortReceived(sender common.RMId, tsa msgs.TxnSubmissionAbort)
type ProposerManager ¶
type ProposerManager struct { sconn.ServerConnectionPublisher RMId common.RMId BootCount uint32 VarDispatcher *eng.VarDispatcher Exe *dispatcher.Executor DB *db.Databases // contains filtered or unexported fields }
func NewProposerManager ¶
func NewProposerManager(exe *dispatcher.Executor, rmId common.RMId, bootCount uint32, cm connectionmanager.ConnectionManager, db *db.Databases, varDispatcher *eng.VarDispatcher, logger log.Logger) *ProposerManager
func (*ProposerManager) FinishProposals ¶
func (pm *ProposerManager) FinishProposals(txnId *common.TxnId)
We have an outcome by this point, so we should stop sending proposals.
func (*ProposerManager) ImmigrationReceived ¶
func (pm *ProposerManager) ImmigrationReceived(txn *txnreader.TxnReader, varCaps msgs.Var_List, stateChange eng.TxnLocalStateChange)
func (*ProposerManager) NewPaxosProposals ¶
func (*ProposerManager) OneBTxnVotesReceived ¶
func (pm *ProposerManager) OneBTxnVotesReceived(sender common.RMId, txnId *common.TxnId, oneBTxnVotes msgs.OneBTxnVotes)
from network
func (*ProposerManager) SetMetrics ¶
func (pm *ProposerManager) SetMetrics(metrics *ProposerMetrics)
func (*ProposerManager) Status ¶
func (pm *ProposerManager) Status(sc *status.StatusConsumer)
func (*ProposerManager) TopologyChanged ¶
func (pm *ProposerManager) TopologyChanged(topology *configuration.Topology, done func(bool))
func (*ProposerManager) TwoBTxnVotesReceived ¶
func (pm *ProposerManager) TwoBTxnVotesReceived(sender common.RMId, txnId *common.TxnId, txn *txnreader.TxnReader, twoBTxnVotes msgs.TwoBTxnVotes)
from network
func (*ProposerManager) TxnFinished ¶
func (pm *ProposerManager) TxnFinished(proposer *Proposer)
from proposer
func (*ProposerManager) TxnGloballyCompleteReceived ¶
func (pm *ProposerManager) TxnGloballyCompleteReceived(sender common.RMId, txnId *common.TxnId)
from network
func (*ProposerManager) TxnLocallyComplete ¶
func (pm *ProposerManager) TxnLocallyComplete(p *Proposer)
from proposer, callback
type ProposerMetrics ¶
type ProposerMetrics struct { Gauge prometheus.Gauge Lifespan prometheus.Observer }
type ProposerMode ¶
type ProposerMode uint8
const ( ProposerActiveVoter ProposerMode = iota ProposerActiveLearner ProposerMode = iota ProposerPassiveLearner ProposerMode = iota )
Click to show internal directories.
Click to hide internal directories.