upgrade

package
v0.0.0-...-44a46bf Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// CurrentVersion represents the current version of the cluster.
	CurrentVersion = NewVersion(currentInternalNo, version.ReleaseVersion)
	// MinVersion represents the minimum version of the cluster.
	// this version only be set after finished importing from v1.0.x, but has not upgraded to the current version.
	MinVersion = NewVersion(minInternalNo, "min-ver")
)

Functions

func PutVersion

func PutVersion(cli *clientv3.Client, ver Version) (int64, error)

PutVersion puts the version into etcd.

func TryUpgrade

func TryUpgrade(cli *clientv3.Client, uctx Context) error

TryUpgrade tries to upgrade the cluster from an older version to a new version. This methods should have no side effects even calling multiple times.

func TryUpgradeBeforeSchedulerStart

func TryUpgradeBeforeSchedulerStart(ctx context.Context, cli *clientv3.Client) error

TryUpgradeBeforeSchedulerStart tries to upgrade the cluster before scheduler start. This methods should have no side effects even calling multiple times.

func UntouchVersionUpgrade

func UntouchVersionUpgrade(cli *clientv3.Client, uctx Context) error

UntouchVersionUpgrade runs all upgrade functions but doesn't change cluster version. This function is called when upgrade from v1.0, with a later PutVersion in caller after success.

Types

type Context

type Context struct {
	context.Context
	SubTaskConfigs map[string]map[string]config.SubTaskConfig
}

Context is used to pass something to TryUpgrade NOTE that zero value of Context is nil, be aware of nil-dereference.

type Version

type Version struct {
	InternalNo uint64 `json:"internal-no"` // internal version number
	ReleaseVer string `json:"release-ver"` // release version, like `v2.0.0`, human readable
}

Version represents the version of the DM cluster used when upgrading from an older version.

func GetVersion

func GetVersion(cli *clientv3.Client) (Version, int64, error)

GetVersion gets the version from etcd.

func NewVersion

func NewVersion(internalNo uint64, releaseVer string) Version

NewVersion creates a new instance of Version.

func (Version) Compare

func (v Version) Compare(other Version) int

Compare compares the version with another version. NOTE: we only compare `InternalNo` now.

func (Version) NotSet

func (v Version) NotSet() bool

NotSet returns whether the version is not set.

func (Version) String

func (v Version) String() string

String implements Stringer interface.

Jump to

Keyboard shortcuts

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