Documentation ¶
Index ¶
- Constants
- Variables
- func CheckCheckpointSupport() error
- func CheckClusterVersion(ctx context.Context, client pd.Client, checker VerChecker) error
- func CheckPITRSupportBatchKVFiles() bool
- func CheckTiDBVersion(versionStr string, requiredMinVersion, requiredMaxVersion semver.Version) error
- func CheckVersion(component string, ...) error
- func CheckVersionForBR(s *metapb.Store, tikvVersion *semver.Version) error
- func CheckVersionForBRPiTR(s *metapb.Store, tikvVersion *semver.Version) error
- func CheckVersionForDDL(s *metapb.Store, tikvVersion *semver.Version) error
- func CheckVersionForKeyspaceBR(_ *metapb.Store, tikvVersion *semver.Version) error
- func ExtractTiDBVersion(version string) (*semver.Version, error)
- func FetchVersion(ctx context.Context, db utils.QueryExecutor) (string, error)
- 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 ¶
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 ¶
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 ¶
CheckVersionForBR checks whether version of the cluster and BR itself is compatible.
func CheckVersionForBRPiTR ¶
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 ¶
CheckVersionForDDL checks whether we use queue or table to execute ddl during restore.
func CheckVersionForKeyspaceBR ¶
CheckVersionForKeyspaceBR checks whether the cluster is support Backup/Restore keyspace data.
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