version

package
v1.1.0-beta.0...-57a73ea Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// ServerTypeUnknown represents unknown server type
	ServerTypeUnknown = iota
	// ServerTypeMySQL represents MySQL server type
	ServerTypeMySQL
	// ServerTypeMariaDB represents MariaDB server type
	ServerTypeMariaDB
	// ServerTypeTiDB represents TiDB server type
	ServerTypeTiDB

	// ServerTypeAll represents All server types
	ServerTypeAll
)

Variables

View Source
var (

	// Once TableInfoVersion updated. BR need to check compatibility with
	// new TableInfoVersion. both snapshot restore and pitr need to be checked.
	CURRENT_BACKUP_SUPPORT_TABLE_INFO_VERSION = model.TableInfoVersion5
)

Functions

func CheckCheckpointSupport

func CheckCheckpointSupport() error

func CheckClusterVersion

func CheckClusterVersion(ctx context.Context, client pd.Client, checker VerChecker) error

CheckClusterVersion check TiKV version.

func CheckPITRSupportBatchKVFiles

func CheckPITRSupportBatchKVFiles() bool

func CheckTiDBVersion

func CheckTiDBVersion(versionStr string, requiredMinVersion, requiredMaxVersion semver.Version) error

CheckTiDBVersion is equals to ExtractTiDBVersion followed by CheckVersion.

func CheckVersion

func CheckVersion(component string, actual, requiredMinVersion, requiredMaxVersion semver.Version) error

CheckVersion checks if the actual version is within [requiredMinVersion, requiredMaxVersion).

func CheckVersionForBR

func CheckVersionForBR(s *metapb.Store, tikvVersion *semver.Version) error

CheckVersionForBR checks whether version of the cluster and BR itself is compatible.

func CheckVersionForBRPiTR

func CheckVersionForBRPiTR(s *metapb.Store, tikvVersion *semver.Version) error

CheckVersionForBRPiTR checks whether version of the cluster and BR-pitr itself is compatible. Note: BR'version >= 6.1.0 at least in this function

func CheckVersionForDDL

func CheckVersionForDDL(s *metapb.Store, tikvVersion *semver.Version) error

CheckVersionForDDL checks whether we use queue or table to execute ddl during restore.

func CheckVersionForKeyspaceBR

func CheckVersionForKeyspaceBR(_ *metapb.Store, tikvVersion *semver.Version) error

CheckVersionForKeyspaceBR checks whether the cluster is support Backup/Restore keyspace data.

func ExtractTiDBVersion

func ExtractTiDBVersion(version string) (*semver.Version, error)

ExtractTiDBVersion extracts TiDB version from TiDB SQL `version()` outputs.

func FetchVersion

func FetchVersion(ctx context.Context, db dbutil.QueryExecutor) (string, error)

FetchVersion gets the version information from the database server

NOTE: the executed query will be: - `select tidb_version()` if target db is tidb - `select version()` if target db is not tidb

func NextMajorVersion

func NextMajorVersion() semver.Version

NextMajorVersion returns the next major version.

func NormalizeBackupVersion

func NormalizeBackupVersion(version string) *semver.Version

NormalizeBackupVersion normalizes the version string from backupmeta.

Types

type ServerInfo

type ServerInfo struct {
	ServerType    ServerType
	ServerVersion *semver.Version
	HasTiKV       bool
}

ServerInfo is the combination of ServerType and ServerInfo

func ParseServerInfo

func ParseServerInfo(src string) ServerInfo

ParseServerInfo parses exported server type and version info from version string

type ServerType

type ServerType int

func (ServerType) String

func (s ServerType) String() string

String implements Stringer.String

type VerChecker

type VerChecker func(store *metapb.Store, ver *semver.Version) error

VerChecker is a callback for the CheckClusterVersion, decides whether the cluster is suitable to execute restore. See also: CheckVersionForBackup and CheckVersionForBR.

func CheckVersionForBackup

func CheckVersionForBackup(backupVersion *semver.Version) VerChecker

CheckVersionForBackup checks the version for backup and

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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