arec

package
v0.0.0-...-7c6133f Latest Latest
Warning

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

Go to latest
Published: May 30, 2016 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidID     = errors.New("provided id is not a part of the running cluster")
	ErrEpochMismatch = errors.New("inconsistency between epoch in id and epoch in epoch vector")
)

Functions

This section is empty.

Types

type AReconfHandler

type AReconfHandler struct {
	// contains filtered or unexported fields
}

ReplacementHandler represents a Goxos submodule handling the core Asynchronous Reconfiguration protocol. It is responsible for handling startup for replicas joining a Goxos cluster as the result of a replacement. The module is also responsible for initiating replacements based failure indications.

func NewAReconfHandler

func NewAReconfHandler(id grp.ID, conf *config.Config, appID string,
	grpmgr grp.GroupManager, fd *liveness.Fd, ld liveness.LeaderDetector,
	bcast chan<- interface{}, ucast chan<- net.Packet, dmx net.Demuxer,
	asrch chan<- app.StateReq, acceptor paxos.Acceptor, proposer paxos.Proposer, adu *paxos.Adu,
	stopCheckIn *sync.WaitGroup) *AReconfHandler

NewAReconfHandler returns a new areconfig handler.

func (*AReconfHandler) IsReconfigInProgress

func (rh *AReconfHandler) IsReconfigInProgress() bool

IsReconfigInProgress returns the value uf reconfInProgress.

func (*AReconfHandler) RequestReconf

func (rh *AReconfHandler) RequestReconf(rcmd ReconfCmd) error

RequestReplacement request replacement of the replica specified by rcmd.

func (*AReconfHandler) RunningPaxos

func (rh *AReconfHandler) RunningPaxos()

WaitForActivation blocks until a replica is activated by using the protocol. The method returns immediately if the replica is already activated. This method should be used by a replacer replica during startup.

func (*AReconfHandler) SetReconfigInProgress

func (rh *AReconfHandler) SetReconfigInProgress(inProgress bool)

SetReconfigInProgress is used to indicate that a reconfiguration is being prepared

func (*AReconfHandler) Start

func (rh *AReconfHandler) Start()

Start starts the AReconfHandler by spawning a goroutine to handle incoming and outgoing messages.

func (*AReconfHandler) Stop

func (rh *AReconfHandler) Stop()

Stop stops the AReconfHandler.

type Activation

type Activation struct {
	Epoch    grp.Epoch
	AduSlot  paxos.SlotID
	AccState *paxos.AcceptorSlotMap
	Confs    map[grp.Epoch]map[grp.ID]grp.Node
}

func (Activation) String

func (ac Activation) String() string

type CPromise

type CPromise struct {
	ID         grp.ID
	QuorumSize uint
	Sender     grp.Node
	NewEpoch   grp.Epoch
	Confs      map[grp.Epoch]map[grp.ID]grp.Node
	AduSlot    paxos.SlotID
	AccState   paxos.AcceptorSlotMap
}

func (CPromise) String

func (cp CPromise) String() string

type ReconfCmd

type ReconfCmd struct {
	// contains filtered or unexported fields
}

ReconfCmd encapsualtes a replacement command.

func NewReconfCmdFromID

func NewReconfCmdFromID(id grp.ID) *ReconfCmd

NewReconfCmdFromID returns a replacement command for the replica with identifier id.

func NewReconfCmdFromSlice

func NewReconfCmdFromSlice(ids []grp.ID) ReconfCmd

NewReconfCmdFromSlice returns a replacement command for the replicas specified.

func (ReconfCmd) String

func (rc ReconfCmd) String() string

String returns a text representation of the replacement command.

type ReconfMsg

type ReconfMsg struct {
	NewEpoch grp.Epoch
	NodeMap  map[grp.ID]grp.Node
	OldIds   map[grp.ID]bool
	AduSlot  paxos.SlotID
}

func (ReconfMsg) String

func (rm ReconfMsg) String() string

Jump to

Keyboard shortcuts

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