Documentation ¶
Overview ¶
Package version provides functions for getting/saving storage version.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func IsValidVersionChange ¶
IsValidVersionChange checks the two scenario when version is valid to change: 1. Downgrade: cluster version is 1 minor version higher than local version, cluster version should change. 2. Cluster start: when not all members version are available, cluster version is set to MinVersion(3.0), when all members are at higher version, cluster version is lower than local version, cluster version should change
Types ¶
type DowngradeInfo ¶
type DowngradeInfo struct { // TargetVersion is the target downgrade version, if the cluster is not under downgrading, // the targetVersion will be an empty string TargetVersion string `json:"target-version"` // Enabled indicates whether the cluster is enabled to downgrade Enabled bool `json:"enabled"` }
func (*DowngradeInfo) GetTargetVersion ¶
func (d *DowngradeInfo) GetTargetVersion() *semver.Version
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager contains logic to manage etcd cluster version downgrade process.
func NewManager ¶
NewManager returns a new manager instance
func (*Manager) DowngradeCancel ¶
DowngradeCancel cancels ongoing downgrade process.
func (*Manager) DowngradeEnable ¶
DowngradeEnable initiates etcd cluster version downgrade process.
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
Monitor contains logic used by cluster leader to monitor version changes and decide on cluster version or downgrade progress.
func (*Monitor) CancelDowngradeIfNeeded ¶
func (m *Monitor) CancelDowngradeIfNeeded()
func (*Monitor) UpdateClusterVersionIfNeeded ¶
func (m *Monitor) UpdateClusterVersionIfNeeded()
UpdateClusterVersionIfNeeded updates the cluster version.
func (*Monitor) UpdateStorageVersionIfNeeded ¶
func (m *Monitor) UpdateStorageVersionIfNeeded()
UpdateStorageVersionIfNeeded updates the storage version if it differs from cluster version.
type Server ¶
type Server interface { GetClusterVersion() *semver.Version GetDowngradeInfo() *DowngradeInfo GetMembersVersions() map[string]*version.Versions UpdateClusterVersion(string) LinearizableReadNotify(ctx context.Context) error DowngradeEnable(ctx context.Context, targetVersion *semver.Version) error DowngradeCancel(ctx context.Context) error GetStorageVersion() *semver.Version UpdateStorageVersion(semver.Version) error }
Server lists EtcdServer methods needed by Monitor