[UPGRADE] Forbid restoring tenant with unsupported data version
This commit is contained in:
@ -809,6 +809,11 @@ int ObRestoreUtil::check_backup_set_version_match_(share::ObBackupSetFileDesc &b
|
|||||||
ret = OB_OP_NOT_ALLOW;
|
ret = OB_OP_NOT_ALLOW;
|
||||||
LOG_WARN("restore from version 4.0 is not allowd", K(ret), K(backup_file_desc.tenant_compatible_), K(data_version));
|
LOG_WARN("restore from version 4.0 is not allowd", K(ret), K(backup_file_desc.tenant_compatible_), K(data_version));
|
||||||
LOG_USER_ERROR(OB_OP_NOT_ALLOW, "restore from version 4.0 is");
|
LOG_USER_ERROR(OB_OP_NOT_ALLOW, "restore from version 4.0 is");
|
||||||
|
} else if (!ObUpgradeChecker::check_data_version_valid_for_backup(backup_file_desc.tenant_compatible_)) {
|
||||||
|
ret = OB_OP_NOT_ALLOW;
|
||||||
|
LOG_WARN("restore from backup with unsupported data version",
|
||||||
|
KR(ret), K(backup_file_desc.tenant_compatible_), K(data_version));
|
||||||
|
LOG_USER_ERROR(OB_OP_NOT_ALLOW, "restore from backup with unsupported data version is");
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -99,6 +99,13 @@ bool ObUpgradeChecker::check_data_version_exist(
|
|||||||
return bret;
|
return bret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: should correspond to upgrade YML file.
|
||||||
|
// For now, just consider the valid upgrade path for 4.x .
|
||||||
|
bool ObUpgradeChecker::check_data_version_valid_for_backup(const uint64_t data_version)
|
||||||
|
{
|
||||||
|
return DATA_VERSION_4_3_0_0 <= data_version;
|
||||||
|
}
|
||||||
|
|
||||||
//FIXME:(yanmu.ztl) cluster version should be discrete.
|
//FIXME:(yanmu.ztl) cluster version should be discrete.
|
||||||
bool ObUpgradeChecker::check_cluster_version_exist(
|
bool ObUpgradeChecker::check_cluster_version_exist(
|
||||||
const uint64_t version)
|
const uint64_t version)
|
||||||
|
@ -168,6 +168,7 @@ class ObUpgradeChecker
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static bool check_data_version_exist(const uint64_t version);
|
static bool check_data_version_exist(const uint64_t version);
|
||||||
|
static bool check_data_version_valid_for_backup(const uint64_t data_version);
|
||||||
static bool check_cluster_version_exist(const uint64_t version);
|
static bool check_cluster_version_exist(const uint64_t version);
|
||||||
static int get_data_version_by_cluster_version(
|
static int get_data_version_by_cluster_version(
|
||||||
const uint64_t cluster_version,
|
const uint64_t cluster_version,
|
||||||
|
Reference in New Issue
Block a user