stolon

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClusterdataBytes added in v1.5.0

func GetClusterdataBytes(ctx context.Context, client *clientv3.Client, key string) ([]byte, error)

GetClusterdataBytes returns a byte slice for dynamic manipulation.

Types

type Cluster

type Cluster struct {
	Spec ClusterSpec `json:"spec"`
}

type ClusterSpec

type ClusterSpec struct {
	SynchronousReplication bool `json:"synchronousReplication"`
	MinSynchronousStandbys int  `json:"minSynchronousStandbys"`
}

type Clusterdata

type Clusterdata struct {
	Cluster `json:"cluster"`
	Proxy   `json:"proxy"`
	Dbs     map[string]DB `json:"dbs"`
}

Clusterdata is a minimal extraction that we need from stolon. Whenever we upgrade stolon, we should verify that this definition is compatible.

func GetClusterdata

func GetClusterdata(ctx context.Context, client *clientv3.Client, key string) (*Clusterdata, error)

GetClusterdata fetches and parses from etcd using the given key

func (Clusterdata) AsynchronousStandbys

func (c Clusterdata) AsynchronousStandbys() []DB

func (Clusterdata) CheckHealthy

func (c Clusterdata) CheckHealthy(tolerateFailures int) error

CheckHealthy returns an error if the stolon cluster isn't healthy. Healthy is defined as:

The master keeper is healthy, and
The minimum number of synchronous standby keepers are healthy, and
The number of healthy standbys (sync and async) - minimum number of synchronous standbys < the failure tolerance

func (Clusterdata) Databases

func (c Clusterdata) Databases() []DB

func (Clusterdata) ListenAddresses

func (c Clusterdata) ListenAddresses() []string

func (Clusterdata) Master

func (c Clusterdata) Master() DB

func (Clusterdata) String

func (c Clusterdata) String() string

func (Clusterdata) SynchronousStandbys

func (c Clusterdata) SynchronousStandbys() []DB

SynchronousStandbys returns all the DBs that are configured as sync replicas to our current primary. If we use a dummy sync replica, then we'll return the empty DB value.

type DB

type DB struct {
	Spec   DBSpec   `json:"spec"`
	Status DBStatus `json:"status"`
}

func (DB) String

func (d DB) String() string

type DBSpec

type DBSpec struct {
	KeeperUID                   string   `json:"keeperUID"`
	ExternalSynchronousStandbys []string `json:"externalSynchronousStandbys"`
}

type DBStatus

type DBStatus struct {
	Healthy             bool     `json:"healthy"`
	ListenAddress       string   `json:"listenAddress"`
	Port                string   `json:"port"`
	SynchronousStandbys []string `json:"synchronousStandbys"`
}

type Proxy

type Proxy struct {
	Spec ProxySpec `json:"spec"`
}

type ProxySpec

type ProxySpec struct {
	MasterDbUID string `json:"masterDbUid"`
}

type Stolonctl

type Stolonctl struct {
	ClusterName, Backend, Prefix, Endpoints string
}

func (Stolonctl) CommandContext

func (s Stolonctl) CommandContext(ctx context.Context, args ...string) *exec.Cmd

Jump to

Keyboard shortcuts

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