Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoAliveFollowers = errors.New("quorum: replica set does not have any alive followers or all of them were excluded from the election") ErrNoCandidateFound = errors.New("quorum: no available candidate found") )
Functions ¶
This section is empty.
Types ¶
type Elector ¶
type Elector interface { // ChooseMaster selects new master and returns back its uuid. ChooseMaster(set vshard.ReplicaSet) (vshard.InstanceUUID, error) // Mode returns the elector type. Mode() Mode }
func NewIdleElector ¶ added in v1.1.0
NewIdleElector returns a new elector based on the follower's idle value.
This elector chooses the candidate to be a master selecting the follower with a minimum idle value.
func NewSmartElector ¶
NewSmartElector returns a new elector based on rules:
- compare vshard configuration consistency,
- compare upstream status,
- compare LSN behind the master,
- compare when replica got last heartbeat signal or data from master,
- user promotion rules based on instance priorities.
Click to show internal directories.
Click to hide internal directories.