Documentation ¶
Index ¶
- Constants
- func CheckClusterVersion(ctx context.Context, client pd.Client, checker VerChecker) error
- func CheckTiDBVersion(versionStr string, requiredMinVersion, requiredMaxVersion semver.Version) error
- func CheckVersion(component string, ...) error
- func CheckVersionForBR(s *metapb.Store, tikvVersion *semver.Version) error
- func ExtractTiDBVersion(version string) (*semver.Version, error)
- func FetchVersion(ctx context.Context, db utils.QueryExecutor) (string, error)
- func IsTiFlash(store *metapb.Store) bool
- func NextMajorVersion() semver.Version
- func NormalizeBackupVersion(version string) *semver.Version
- type ServerInfo
- type ServerType
- type VerChecker
Constants ¶
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 ¶
This section is empty.
Functions ¶
func CheckClusterVersion ¶
CheckClusterVersion check TiKV version.
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 ¶
CheckVersionForBR checks whether version of the cluster and BR itself is compatible.
func ExtractTiDBVersion ¶
ExtractTiDBVersion extracts TiDB version from TiDB SQL `version()` outputs.
func FetchVersion ¶
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 ¶
NextMajorVersion returns the next major version.
func NormalizeBackupVersion ¶
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
type VerChecker ¶
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