fix restore failure in open source release
This commit is contained in:
committed by
LINxiansheng
parent
2a8f9bf095
commit
b3780cad79
@ -643,7 +643,7 @@ int ObRestoreUtil::fill_compat_backup_path(
|
|||||||
|
|
||||||
if (OB_SUCC(ret)) {
|
if (OB_SUCC(ret)) {
|
||||||
// for compat backup path, clog restore use multi restore path
|
// for compat backup path, clog restore use multi restore path
|
||||||
if (OB_FAIL(fill_clog_path_list(arg.uri_, arg, job))) {
|
if (OB_FAIL(inner_fill_compat_backup_path(arg.uri_, arg, job))) {
|
||||||
if (OB_ENTRY_NOT_EXIST == ret) {
|
if (OB_ENTRY_NOT_EXIST == ret) {
|
||||||
ret = OB_SUCCESS;
|
ret = OB_SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
@ -655,7 +655,7 @@ int ObRestoreUtil::fill_compat_backup_path(
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ObRestoreUtil::fill_clog_path_list(
|
int ObRestoreUtil::inner_fill_compat_backup_path(
|
||||||
const ObString &uri, const obrpc::ObPhysicalRestoreTenantArg &arg, share::ObPhysicalRestoreJob &job)
|
const ObString &uri, const obrpc::ObPhysicalRestoreTenantArg &arg, share::ObPhysicalRestoreJob &job)
|
||||||
{
|
{
|
||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
@ -663,7 +663,6 @@ int ObRestoreUtil::fill_clog_path_list(
|
|||||||
uint64_t backup_tenant_id = OB_INVALID_ID;
|
uint64_t backup_tenant_id = OB_INVALID_ID;
|
||||||
const int64_t restore_timestamp = arg.restore_timestamp_;
|
const int64_t restore_timestamp = arg.restore_timestamp_;
|
||||||
ObArray<ObSimpleBackupSetPath> backup_set_list;
|
ObArray<ObSimpleBackupSetPath> backup_set_list;
|
||||||
ObArray<ObSimpleBackupSetPath> fake_backup_set_list;
|
|
||||||
ObArray<ObSimpleBackupPiecePath> backup_piece_list;
|
ObArray<ObSimpleBackupPiecePath> backup_piece_list;
|
||||||
if (OB_FAIL(uri_list.push_back(uri))) {
|
if (OB_FAIL(uri_list.push_back(uri))) {
|
||||||
LOG_WARN("failed to push back", KR(ret), K(uri));
|
LOG_WARN("failed to push back", KR(ret), K(uri));
|
||||||
@ -684,7 +683,7 @@ int ObRestoreUtil::fill_clog_path_list(
|
|||||||
backup_set_list,
|
backup_set_list,
|
||||||
backup_piece_list))) {
|
backup_piece_list))) {
|
||||||
LOG_WARN("failed to get backup path list", KR(ret), K(uri_list));
|
LOG_WARN("failed to get backup path list", KR(ret), K(uri_list));
|
||||||
} else if (OB_FAIL(job.multi_restore_path_list_.set(fake_backup_set_list, backup_piece_list))) {
|
} else if (OB_FAIL(job.multi_restore_path_list_.set(backup_set_list, backup_piece_list))) {
|
||||||
LOG_WARN("failed to set mutli restore path list", KR(ret));
|
LOG_WARN("failed to set mutli restore path list", KR(ret));
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
@ -141,7 +141,7 @@ private:
|
|||||||
static int fill_backup_path(const obrpc::ObPhysicalRestoreTenantArg& arg, share::ObPhysicalRestoreJob& job);
|
static int fill_backup_path(const obrpc::ObPhysicalRestoreTenantArg& arg, share::ObPhysicalRestoreJob& job);
|
||||||
static int fill_multi_backup_path(const obrpc::ObPhysicalRestoreTenantArg& arg, share::ObPhysicalRestoreJob& job);
|
static int fill_multi_backup_path(const obrpc::ObPhysicalRestoreTenantArg& arg, share::ObPhysicalRestoreJob& job);
|
||||||
static int fill_compat_backup_path(const obrpc::ObPhysicalRestoreTenantArg& arg, share::ObPhysicalRestoreJob& job);
|
static int fill_compat_backup_path(const obrpc::ObPhysicalRestoreTenantArg& arg, share::ObPhysicalRestoreJob& job);
|
||||||
static int fill_clog_path_list(
|
static int inner_fill_compat_backup_path(
|
||||||
const ObString &uri, const obrpc::ObPhysicalRestoreTenantArg &arg, share::ObPhysicalRestoreJob &job);
|
const ObString &uri, const obrpc::ObPhysicalRestoreTenantArg &arg, share::ObPhysicalRestoreJob &job);
|
||||||
static int get_multi_path_file_info_list(const common::ObArray<share::ObSimpleBackupSetPath>& backup_set_list,
|
static int get_multi_path_file_info_list(const common::ObArray<share::ObSimpleBackupSetPath>& backup_set_list,
|
||||||
const common::ObArray<share::ObSimpleBackupPiecePath>& backup_piece_list,
|
const common::ObArray<share::ObSimpleBackupPiecePath>& backup_piece_list,
|
||||||
|
|||||||
@ -1398,7 +1398,6 @@ int ObBackupDest::set(const char* backup_dest)
|
|||||||
} else if (OB_FAIL(get_storage_type_from_path(bakup_dest_str, type))) {
|
} else if (OB_FAIL(get_storage_type_from_path(bakup_dest_str, type))) {
|
||||||
LOG_WARN("failed to get storage type", K(ret));
|
LOG_WARN("failed to get storage type", K(ret));
|
||||||
} else {
|
} else {
|
||||||
// oss://backup_dir/?host=http://oss-cn-hangzhou-zmf.aliyuncs.com&access_id=111&access_key=222
|
|
||||||
// file:///root_backup_dir"
|
// file:///root_backup_dir"
|
||||||
while (backup_dest[pos] != '\0') {
|
while (backup_dest[pos] != '\0') {
|
||||||
if (backup_dest[pos] == '?') {
|
if (backup_dest[pos] == '?') {
|
||||||
@ -3454,8 +3453,7 @@ void ObPhysicalRestoreInfo::reset()
|
|||||||
|
|
||||||
bool ObPhysicalRestoreInfo::is_valid() const
|
bool ObPhysicalRestoreInfo::is_valid() const
|
||||||
{
|
{
|
||||||
return (strlen(backup_dest_) > 0 || multi_restore_path_list_.get_backup_set_path_list().count() > 0) &&
|
return !(0 == strlen(backup_dest_) && 0 == multi_restore_path_list_.get_backup_set_path_list().count()) &&
|
||||||
!(strlen(backup_dest_) > 0 && multi_restore_path_list_.get_backup_set_path_list().count() > 0) &&
|
|
||||||
strlen(cluster_name_) > 0 && cluster_id_ > 0 && OB_START_INCARNATION == incarnation_ && tenant_id_ > 0 &&
|
strlen(cluster_name_) > 0 && cluster_id_ > 0 && OB_START_INCARNATION == incarnation_ && tenant_id_ > 0 &&
|
||||||
full_backup_set_id_ > 0 && inc_backup_set_id_ > 0 && log_archive_round_ > 0 && restore_snapshot_version_ > 0 &&
|
full_backup_set_id_ > 0 && inc_backup_set_id_ > 0 && log_archive_round_ > 0 && restore_snapshot_version_ > 0 &&
|
||||||
restore_start_ts_ > 0 && compatible_ > 0 && cluster_version_ > 0 && backup_date_ >= 0;
|
restore_start_ts_ > 0 && compatible_ > 0 && cluster_version_ > 0 && backup_date_ >= 0;
|
||||||
|
|||||||
@ -716,6 +716,13 @@ int ObExternBackupInfoMgr::get_extern_backup_info(const ObBaseBackupInfoStruct&
|
|||||||
extern_backup_info.prev_backup_data_version_ =
|
extern_backup_info.prev_backup_data_version_ =
|
||||||
info.backup_type_.is_full_backup() ? 0 : last_succeed_info_.backup_data_version_;
|
info.backup_type_.is_full_backup() ? 0 : last_succeed_info_.backup_data_version_;
|
||||||
extern_backup_info.backup_type_ = info.backup_type_.type_;
|
extern_backup_info.backup_type_ = info.backup_type_.type_;
|
||||||
|
#ifdef ERRSIM
|
||||||
|
const bool use_fake_date = ObServerConfig::get_instance().fake_backup_date_for_incremental_backup;
|
||||||
|
static const int64_t FAKE_DATE_DELTA = 1;
|
||||||
|
if (!info.backup_type_.is_full_backup() && use_fake_date) {
|
||||||
|
extern_backup_info.date_ += FAKE_DATE_DELTA;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -89,9 +89,12 @@ int ObMultiBackupDestUtil::check_all_path_is_same_type(
|
|||||||
ObMultiBackupPathType tmp_type = BACKUP_PATH_MAX;
|
ObMultiBackupPathType tmp_type = BACKUP_PATH_MAX;
|
||||||
for (int64_t i = 0; OB_SUCC(ret) && i < path_list.count(); ++i) {
|
for (int64_t i = 0; OB_SUCC(ret) && i < path_list.count(); ++i) {
|
||||||
ObBackupDest backup_dest;
|
ObBackupDest backup_dest;
|
||||||
|
char backup_dest_str[OB_MAX_BACKUP_DEST_LENGTH] = "";
|
||||||
const ObString &path = path_list.at(i);
|
const ObString &path = path_list.at(i);
|
||||||
if (OB_FAIL(backup_dest.set(path.ptr()))) {
|
if (OB_FAIL(databuff_printf(backup_dest_str, OB_MAX_BACKUP_DEST_LENGTH, "%.*s", path.length(), path.ptr()))) {
|
||||||
LOG_WARN("failed to set backup path", KR(ret));
|
LOG_WARN("failed to databuff printf", KR(ret), K(path));
|
||||||
|
} else if (OB_FAIL(backup_dest.set(backup_dest_str))) {
|
||||||
|
LOG_WARN("failed to set backup path", KR(ret), K(backup_dest_str));
|
||||||
} else if (OB_FAIL(get_path_type(backup_dest.root_path_, backup_dest.storage_info_, type))) {
|
} else if (OB_FAIL(get_path_type(backup_dest.root_path_, backup_dest.storage_info_, type))) {
|
||||||
LOG_WARN("failed to get path type", KR(ret), K(path));
|
LOG_WARN("failed to get path type", KR(ret), K(path));
|
||||||
} else {
|
} else {
|
||||||
@ -153,6 +156,7 @@ int ObMultiBackupDestUtil::get_multi_backup_path_list(const bool is_preview, con
|
|||||||
const ObString &backup_dest_str = list.at(i);
|
const ObString &backup_dest_str = list.at(i);
|
||||||
int64_t snapshot_version = 0;
|
int64_t snapshot_version = 0;
|
||||||
int64_t start_replay_log_ts = 0;
|
int64_t start_replay_log_ts = 0;
|
||||||
|
bool is_compat_path = false;
|
||||||
if (OB_FAIL(get_backup_set_list(is_preview,
|
if (OB_FAIL(get_backup_set_list(is_preview,
|
||||||
cluster_name,
|
cluster_name,
|
||||||
cluster_id,
|
cluster_id,
|
||||||
@ -161,9 +165,29 @@ int ObMultiBackupDestUtil::get_multi_backup_path_list(const bool is_preview, con
|
|||||||
backup_dest_str,
|
backup_dest_str,
|
||||||
set_list,
|
set_list,
|
||||||
snapshot_version,
|
snapshot_version,
|
||||||
start_replay_log_ts))) {
|
start_replay_log_ts,
|
||||||
|
is_compat_path))) {
|
||||||
LOG_WARN("failed to get backup set", KR(ret), K(tenant_id), K(restore_timestamp), K(list));
|
LOG_WARN("failed to get backup set", KR(ret), K(tenant_id), K(restore_timestamp), K(list));
|
||||||
} else if (OB_FAIL(get_backup_piece_list(is_preview,
|
} else {
|
||||||
|
if (is_compat_path) {
|
||||||
|
if (OB_FAIL(get_compat_backup_piece_list(cluster_name,
|
||||||
|
cluster_id,
|
||||||
|
tenant_id,
|
||||||
|
snapshot_version,
|
||||||
|
restore_timestamp,
|
||||||
|
backup_dest_str,
|
||||||
|
piece_list))) {
|
||||||
|
LOG_WARN("failed to get compat backup piece list",
|
||||||
|
KR(ret),
|
||||||
|
K(cluster_name),
|
||||||
|
K(cluster_id),
|
||||||
|
K(tenant_id),
|
||||||
|
K(snapshot_version),
|
||||||
|
K(restore_timestamp),
|
||||||
|
K(backup_dest_str));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (OB_FAIL(get_backup_piece_list(is_preview,
|
||||||
cluster_name,
|
cluster_name,
|
||||||
cluster_id,
|
cluster_id,
|
||||||
tenant_id,
|
tenant_id,
|
||||||
@ -176,6 +200,8 @@ int ObMultiBackupDestUtil::get_multi_backup_path_list(const bool is_preview, con
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -357,6 +383,50 @@ int ObMultiBackupDestUtil::check_multi_path_is_complete(const int64_t restore_ti
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ObMultiBackupDestUtil::check_is_compat_backup_path(const char *cluster_name, const int64_t cluster_id,
|
||||||
|
const share::ObBackupDest &backup_dest, const uint64_t tenant_id, const int64_t restore_timestamp,
|
||||||
|
int64_t &snapshot_version, bool &is_compat_path)
|
||||||
|
{
|
||||||
|
int ret = OB_SUCCESS;
|
||||||
|
is_compat_path = false;
|
||||||
|
ObExternBackupInfoMgr mgr;
|
||||||
|
ObClusterBackupDest cluster_backup_dest;
|
||||||
|
ObFakeBackupLeaseService lease_service;
|
||||||
|
ObArray<ObExternBackupInfo> backup_info_list;
|
||||||
|
if (OB_INVALID_ID == tenant_id || restore_timestamp < 0) {
|
||||||
|
ret = OB_INVALID_ARGUMENT;
|
||||||
|
LOG_WARN("get invalid args", KR(ret), K(tenant_id), K(restore_timestamp));
|
||||||
|
} else if (OB_FAIL(get_cluster_backup_dest(backup_dest, cluster_name, cluster_id, cluster_backup_dest))) {
|
||||||
|
LOG_WARN("failed to get cluster backup dest", KR(ret), K(backup_dest), K(cluster_name), K(cluster_id));
|
||||||
|
} else if (OB_FAIL(mgr.init(tenant_id, cluster_backup_dest, lease_service))) {
|
||||||
|
LOG_WARN("failed to init extern backup info mgr", KR(ret), K(tenant_id), K(cluster_backup_dest));
|
||||||
|
} else if (OB_FAIL(mgr.get_extern_backup_infos(backup_info_list))) {
|
||||||
|
LOG_WARN("failed to get extern backup infos", KR(ret));
|
||||||
|
} else {
|
||||||
|
bool exist = false;
|
||||||
|
for (int64_t i = backup_info_list.count() - 1; OB_SUCC(ret) && i >= 0; --i) {
|
||||||
|
const ObExternBackupInfo &info = backup_info_list.at(i);
|
||||||
|
if (ObExternBackupInfo::SUCCESS != info.status_) {
|
||||||
|
// do nothing
|
||||||
|
} else if (info.backup_snapshot_version_ <= restore_timestamp) {
|
||||||
|
if (ObBackupCompatibleVersion::OB_BACKUP_COMPATIBLE_VERSION_V1 == info.compatible_) {
|
||||||
|
is_compat_path = true;
|
||||||
|
snapshot_version = info.backup_snapshot_version_;
|
||||||
|
} else {
|
||||||
|
is_compat_path = false;
|
||||||
|
}
|
||||||
|
exist = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (OB_SUCC(ret) && !exist) {
|
||||||
|
ret = OB_ENTRY_NOT_EXIST;
|
||||||
|
LOG_WARN("do not exist backup set", KR(ret), K(tenant_id), K(restore_timestamp));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
int ObMultiBackupDestUtil::get_backup_set_info_path(const common::ObString &user_path, ObBackupPath &backup_set_path)
|
int ObMultiBackupDestUtil::get_backup_set_info_path(const common::ObString &user_path, ObBackupPath &backup_set_path)
|
||||||
{
|
{
|
||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
@ -534,9 +604,12 @@ int ObMultiBackupDestUtil::inner_get_backup_tenant_id_from_tenant_name_info(cons
|
|||||||
tenant_id = OB_INVALID_ID;
|
tenant_id = OB_INVALID_ID;
|
||||||
ObClusterBackupDest cluster_backup_dest;
|
ObClusterBackupDest cluster_backup_dest;
|
||||||
ObTenantNameSimpleMgr mgr;
|
ObTenantNameSimpleMgr mgr;
|
||||||
|
char backup_dest_str[OB_MAX_BACKUP_DEST_LENGTH] = "";
|
||||||
if (OB_FAIL(mgr.init())) {
|
if (OB_FAIL(mgr.init())) {
|
||||||
LOG_WARN("failed to init tenant name simple mgr", KR(ret));
|
LOG_WARN("failed to init tenant name simple mgr", KR(ret));
|
||||||
} else if (OB_FAIL(cluster_backup_dest.set(url.ptr(), cluster_name.ptr(), cluster_id, OB_START_INCARNATION))) {
|
} else if (OB_FAIL(databuff_printf(backup_dest_str, OB_MAX_BACKUP_DEST_LENGTH, "%.*s", url.length(), url.ptr()))) {
|
||||||
|
LOG_WARN("failed to databuff printf", KR(ret), K(url));
|
||||||
|
} else if (OB_FAIL(cluster_backup_dest.set(backup_dest_str, cluster_name.ptr(), cluster_id, OB_START_INCARNATION))) {
|
||||||
LOG_WARN("failed to set cluster backup dest", KR(ret), K(url), K(cluster_name));
|
LOG_WARN("failed to set cluster backup dest", KR(ret), K(url), K(cluster_name));
|
||||||
} else if (OB_FAIL(mgr.read_backup_file(cluster_backup_dest))) {
|
} else if (OB_FAIL(mgr.read_backup_file(cluster_backup_dest))) {
|
||||||
LOG_WARN("failed to read backup file", KR(ret), K(cluster_backup_dest));
|
LOG_WARN("failed to read backup file", KR(ret), K(cluster_backup_dest));
|
||||||
@ -563,7 +636,7 @@ int ObMultiBackupDestUtil::get_cluster_backup_dest(const ObBackupDest& backup_de
|
|||||||
int ObMultiBackupDestUtil::get_backup_set_list(const bool is_preview, const char *cluster_name,
|
int ObMultiBackupDestUtil::get_backup_set_list(const bool is_preview, const char *cluster_name,
|
||||||
const int64_t cluster_id, const uint64_t tenant_id, const int64_t restore_timestamp,
|
const int64_t cluster_id, const uint64_t tenant_id, const int64_t restore_timestamp,
|
||||||
const common::ObString &backup_dest_str, common::ObArray<ObSimpleBackupSetPath> &list, int64_t &snapshot_version,
|
const common::ObString &backup_dest_str, common::ObArray<ObSimpleBackupSetPath> &list, int64_t &snapshot_version,
|
||||||
int64_t& start_replay_log_ts)
|
int64_t &start_replay_log_ts, bool &is_compat_path)
|
||||||
{
|
{
|
||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
snapshot_version = 0;
|
snapshot_version = 0;
|
||||||
@ -590,7 +663,8 @@ int ObMultiBackupDestUtil::get_backup_set_list(const bool is_preview, const char
|
|||||||
backup_dest,
|
backup_dest,
|
||||||
tmp_list,
|
tmp_list,
|
||||||
snapshot_version,
|
snapshot_version,
|
||||||
start_replay_log_ts))) {
|
start_replay_log_ts,
|
||||||
|
is_compat_path))) {
|
||||||
LOG_WARN("failed to inner get backup set list", KR(ret), K(tenant_id), K(backup_dest));
|
LOG_WARN("failed to inner get backup set list", KR(ret), K(tenant_id), K(backup_dest));
|
||||||
} else if (OB_FAIL(append(list, tmp_list))) {
|
} else if (OB_FAIL(append(list, tmp_list))) {
|
||||||
LOG_WARN("failed to add array", KR(ret), K(tmp_list));
|
LOG_WARN("failed to add array", KR(ret), K(tmp_list));
|
||||||
@ -601,11 +675,12 @@ int ObMultiBackupDestUtil::get_backup_set_list(const bool is_preview, const char
|
|||||||
int ObMultiBackupDestUtil::do_get_backup_set_list(const bool is_preview, const char *cluster_name,
|
int ObMultiBackupDestUtil::do_get_backup_set_list(const bool is_preview, const char *cluster_name,
|
||||||
const int64_t cluster_id, const uint64_t tenant_id, const int64_t restore_timestamp,
|
const int64_t cluster_id, const uint64_t tenant_id, const int64_t restore_timestamp,
|
||||||
const ObBackupDest &backup_dest, common::ObArray<ObSimpleBackupSetPath> &path_list, int64_t &snapshot_version,
|
const ObBackupDest &backup_dest, common::ObArray<ObSimpleBackupSetPath> &path_list, int64_t &snapshot_version,
|
||||||
int64_t& start_replay_log_ts)
|
int64_t &start_replay_log_ts, bool &is_compat_path)
|
||||||
{
|
{
|
||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
path_list.reset();
|
path_list.reset();
|
||||||
start_replay_log_ts = -1;
|
start_replay_log_ts = -1;
|
||||||
|
is_compat_path = false;
|
||||||
ObMultiBackupPathType type;
|
ObMultiBackupPathType type;
|
||||||
const ObString path(backup_dest.root_path_);
|
const ObString path(backup_dest.root_path_);
|
||||||
const ObString storage_info(backup_dest.storage_info_);
|
const ObString storage_info(backup_dest.storage_info_);
|
||||||
@ -617,7 +692,12 @@ int ObMultiBackupDestUtil::do_get_backup_set_list(const bool is_preview, const c
|
|||||||
LOG_WARN("failed to get path type", KR(ret), K(path), K(storage_info));
|
LOG_WARN("failed to get path type", KR(ret), K(path), K(storage_info));
|
||||||
} else {
|
} else {
|
||||||
if (BACKUP_PATH_CLUSTER_LEVEL == type) {
|
if (BACKUP_PATH_CLUSTER_LEVEL == type) {
|
||||||
if (OB_FAIL(do_get_backup_set_list_from_cluster_level(is_preview,
|
if (OB_FAIL(check_is_compat_backup_path(
|
||||||
|
cluster_name, cluster_id, backup_dest, tenant_id, restore_timestamp, snapshot_version, is_compat_path))) {
|
||||||
|
LOG_WARN("failed to check is compat backup path", KR(ret), K(tenant_id), K(restore_timestamp));
|
||||||
|
} else if (is_compat_path) {
|
||||||
|
LOG_INFO("is compat backup path", K(tenant_id), K(restore_timestamp));
|
||||||
|
} else if (OB_FAIL(do_get_backup_set_list_from_cluster_level(is_preview,
|
||||||
cluster_name,
|
cluster_name,
|
||||||
cluster_id,
|
cluster_id,
|
||||||
tenant_id,
|
tenant_id,
|
||||||
@ -700,6 +780,7 @@ int ObMultiBackupDestUtil::do_get_backup_set_list_from_cluster_level(const bool
|
|||||||
} else if (OB_FAIL(do_inner_get_backup_set_list(cluster_name,
|
} else if (OB_FAIL(do_inner_get_backup_set_list(cluster_name,
|
||||||
cluster_id,
|
cluster_id,
|
||||||
restore_timestamp,
|
restore_timestamp,
|
||||||
|
backup_dest,
|
||||||
file_infos,
|
file_infos,
|
||||||
path_list,
|
path_list,
|
||||||
snapshot_version,
|
snapshot_version,
|
||||||
@ -748,7 +829,7 @@ int ObMultiBackupDestUtil::do_get_backup_set_list_from_cluster_level(const bool
|
|||||||
: tmp_file_info.prev_full_backup_set_id_;
|
: tmp_file_info.prev_full_backup_set_id_;
|
||||||
ObClusterBackupDest cluster_backup_dest;
|
ObClusterBackupDest cluster_backup_dest;
|
||||||
ObBackupDest tmp_backup_dest;
|
ObBackupDest tmp_backup_dest;
|
||||||
char tmp_backup_dest_str[OB_MAX_BACKUP_DEST_LENGTH] = "";
|
char tmp_simple_path_str[OB_MAX_BACKUP_DEST_LENGTH] = "";
|
||||||
if (OB_FAIL(cluster_backup_dest.set(
|
if (OB_FAIL(cluster_backup_dest.set(
|
||||||
tmp_file_info.backup_dest_.ptr(), cluster_name, cluster_id, OB_START_INCARNATION))) {
|
tmp_file_info.backup_dest_.ptr(), cluster_name, cluster_id, OB_START_INCARNATION))) {
|
||||||
LOG_WARN("failed to set cluster backup dest");
|
LOG_WARN("failed to set cluster backup dest");
|
||||||
@ -764,9 +845,9 @@ int ObMultiBackupDestUtil::do_get_backup_set_list_from_cluster_level(const bool
|
|||||||
LOG_WARN("failed to get tenant data inc backup set path", KR(ret), K(base_data_path_info));
|
LOG_WARN("failed to get tenant data inc backup set path", KR(ret), K(base_data_path_info));
|
||||||
} else if (OB_FAIL(tmp_backup_dest.set(backup_path.get_ptr(), cluster_backup_dest.get_storage_info()))) {
|
} else if (OB_FAIL(tmp_backup_dest.set(backup_path.get_ptr(), cluster_backup_dest.get_storage_info()))) {
|
||||||
LOG_WARN("failed to set backup dest", KR(ret), K(backup_path), K(cluster_backup_dest));
|
LOG_WARN("failed to set backup dest", KR(ret), K(backup_path), K(cluster_backup_dest));
|
||||||
} else if (OB_FAIL(tmp_backup_dest.get_backup_dest_str(tmp_backup_dest_str, OB_MAX_BACKUP_DEST_LENGTH))) {
|
} else if (OB_FAIL(tmp_backup_dest.get_backup_dest_str(tmp_simple_path_str, OB_MAX_BACKUP_DEST_LENGTH))) {
|
||||||
LOG_WARN("failed to get backup dest str", KR(ret));
|
LOG_WARN("failed to get backup dest str", KR(ret));
|
||||||
} else if (OB_FAIL(new_simple_path.backup_dest_.assign(tmp_backup_dest_str))) {
|
} else if (OB_FAIL(new_simple_path.backup_dest_.assign(tmp_simple_path_str))) {
|
||||||
LOG_WARN("failed to assign str", KR(ret), K(tmp_file_info));
|
LOG_WARN("failed to assign str", KR(ret), K(tmp_file_info));
|
||||||
} else if (OB_FAIL(tmp_path_list.push_back(new_simple_path))) {
|
} else if (OB_FAIL(tmp_path_list.push_back(new_simple_path))) {
|
||||||
LOG_WARN("failed to push back info", KR(ret), K(new_simple_path));
|
LOG_WARN("failed to push back info", KR(ret), K(new_simple_path));
|
||||||
@ -787,7 +868,7 @@ int ObMultiBackupDestUtil::do_get_backup_set_list_from_cluster_level(const bool
|
|||||||
}
|
}
|
||||||
|
|
||||||
int ObMultiBackupDestUtil::do_inner_get_backup_set_list(const char *cluster_name, const int64_t cluster_id,
|
int ObMultiBackupDestUtil::do_inner_get_backup_set_list(const char *cluster_name, const int64_t cluster_id,
|
||||||
const int64_t restore_timestamp, const ObArray<ObBackupSetFileInfo>& file_infos,
|
const int64_t restore_timestamp, const ObBackupDest &backup_dest, const ObArray<ObBackupSetFileInfo> &file_infos,
|
||||||
common::ObArray<ObSimpleBackupSetPath> &path_list, int64_t &snapshot_version, int64_t &start_replay_log_ts)
|
common::ObArray<ObSimpleBackupSetPath> &path_list, int64_t &snapshot_version, int64_t &start_replay_log_ts)
|
||||||
{
|
{
|
||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
@ -832,8 +913,11 @@ int ObMultiBackupDestUtil::do_inner_get_backup_set_list(const char* cluster_name
|
|||||||
info.backup_type_.is_full_backup() ? info.backup_set_id_ : info.prev_full_backup_set_id_;
|
info.backup_type_.is_full_backup() ? info.backup_set_id_ : info.prev_full_backup_set_id_;
|
||||||
ObClusterBackupDest cluster_backup_dest;
|
ObClusterBackupDest cluster_backup_dest;
|
||||||
ObBackupDest tmp_backup_dest;
|
ObBackupDest tmp_backup_dest;
|
||||||
char tmp_backup_dest_str[OB_MAX_BACKUP_DEST_LENGTH] = "";
|
char tmp_simple_path_str[OB_MAX_BACKUP_DEST_LENGTH] = "";
|
||||||
if (OB_FAIL(cluster_backup_dest.set(info.backup_dest_.ptr(), cluster_name, cluster_id, OB_START_INCARNATION))) {
|
char backup_dest_str[OB_MAX_BACKUP_DEST_LENGTH] = "";
|
||||||
|
if (OB_FAIL(backup_dest.get_backup_dest_str(backup_dest_str, OB_MAX_BACKUP_DEST_LENGTH))) {
|
||||||
|
LOG_WARN("failed to get backup dest str", K(ret));
|
||||||
|
} else if (OB_FAIL(cluster_backup_dest.set(backup_dest_str, cluster_name, cluster_id, OB_START_INCARNATION))) {
|
||||||
LOG_WARN("failed to set cluster backup dest");
|
LOG_WARN("failed to set cluster backup dest");
|
||||||
} else if (OB_FAIL(base_data_path_info.set(cluster_backup_dest,
|
} else if (OB_FAIL(base_data_path_info.set(cluster_backup_dest,
|
||||||
info.tenant_id_,
|
info.tenant_id_,
|
||||||
@ -846,9 +930,9 @@ int ObMultiBackupDestUtil::do_inner_get_backup_set_list(const char* cluster_name
|
|||||||
LOG_WARN("failed to get tenant data inc backup set path", KR(ret), K(base_data_path_info));
|
LOG_WARN("failed to get tenant data inc backup set path", KR(ret), K(base_data_path_info));
|
||||||
} else if (OB_FAIL(tmp_backup_dest.set(backup_path.get_ptr(), cluster_backup_dest.get_storage_info()))) {
|
} else if (OB_FAIL(tmp_backup_dest.set(backup_path.get_ptr(), cluster_backup_dest.get_storage_info()))) {
|
||||||
LOG_WARN("failed to set backup dest", KR(ret), K(backup_path), K(cluster_backup_dest));
|
LOG_WARN("failed to set backup dest", KR(ret), K(backup_path), K(cluster_backup_dest));
|
||||||
} else if (OB_FAIL(tmp_backup_dest.get_backup_dest_str(tmp_backup_dest_str, OB_MAX_BACKUP_DEST_LENGTH))) {
|
} else if (OB_FAIL(tmp_backup_dest.get_backup_dest_str(tmp_simple_path_str, OB_MAX_BACKUP_DEST_LENGTH))) {
|
||||||
LOG_WARN("failed to get backup dest str", KR(ret));
|
LOG_WARN("failed to get backup dest str", KR(ret));
|
||||||
} else if (OB_FAIL(simple_path.backup_dest_.assign(tmp_backup_dest_str))) {
|
} else if (OB_FAIL(simple_path.backup_dest_.assign(tmp_simple_path_str))) {
|
||||||
LOG_WARN("failed to assign str", KR(ret), K(info));
|
LOG_WARN("failed to assign str", KR(ret), K(info));
|
||||||
} else if (OB_FAIL(path_list.push_back(simple_path))) {
|
} else if (OB_FAIL(path_list.push_back(simple_path))) {
|
||||||
LOG_WARN("failed to push back info", KR(ret), K(simple_path));
|
LOG_WARN("failed to push back info", KR(ret), K(simple_path));
|
||||||
@ -860,6 +944,65 @@ int ObMultiBackupDestUtil::do_inner_get_backup_set_list(const char* cluster_name
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ObMultiBackupDestUtil::get_compat_backup_piece_list(const char *cluster_name, const int64_t cluster_id,
|
||||||
|
const uint64_t tenant_id, const int64_t snapshot_version, const int64_t restore_timestamp,
|
||||||
|
const common::ObString &backup_dest_str, common::ObArray<ObSimpleBackupPiecePath> &path_list)
|
||||||
|
{
|
||||||
|
int ret = OB_SUCCESS;
|
||||||
|
path_list.reset();
|
||||||
|
ObLogArchiveBackupInfoMgr mgr;
|
||||||
|
ObExternLogArchiveBackupInfo extern_infos;
|
||||||
|
ObTenantLogArchiveStatus log_archive_status;
|
||||||
|
ObClusterBackupDest cluster_backup_dest;
|
||||||
|
ObBackupPath backup_path;
|
||||||
|
ObBackupDest tmp_backup_dest;
|
||||||
|
char backup_dest_buf[OB_MAX_BACKUP_DEST_LENGTH] = "";
|
||||||
|
char tmp_backup_dest_str[OB_MAX_BACKUP_DEST_LENGTH] = "";
|
||||||
|
ObBackupDest backup_dest;
|
||||||
|
ObSimpleBackupPiecePath simple_path;
|
||||||
|
if (OB_FAIL(databuff_printf(
|
||||||
|
backup_dest_buf, OB_MAX_BACKUP_DEST_LENGTH, "%.*s", backup_dest_str.length(), backup_dest_str.ptr()))) {
|
||||||
|
LOG_WARN("failed to databuff printf", KR(ret));
|
||||||
|
} else if (OB_FAIL(backup_dest.set(backup_dest_buf))) {
|
||||||
|
LOG_WARN("failed to set backup path", KR(ret), K(backup_dest));
|
||||||
|
} else if (OB_FAIL(get_cluster_backup_dest(backup_dest, cluster_name, cluster_id, cluster_backup_dest))) {
|
||||||
|
LOG_WARN("failed to get cluster backup dest", KR(ret), K(backup_dest), K(cluster_name), K(cluster_id));
|
||||||
|
} else if (OB_FAIL(mgr.read_extern_log_archive_backup_info(cluster_backup_dest, tenant_id, extern_infos))) {
|
||||||
|
LOG_WARN("failed to read extern log archive backup info", KR(ret), K(cluster_backup_dest), K(tenant_id));
|
||||||
|
} else if (OB_FAIL(extern_infos.get_log_archive_status(restore_timestamp, log_archive_status))) {
|
||||||
|
LOG_WARN("failed to get log archive status", KR(ret), K(restore_timestamp));
|
||||||
|
} else if (snapshot_version < log_archive_status.start_ts_) {
|
||||||
|
ret = OB_ISOLATED_BACKUP_SET;
|
||||||
|
LOG_WARN(
|
||||||
|
"log archive status is not continue with backup info", KR(ret), K(snapshot_version), K(log_archive_status));
|
||||||
|
} else if (OB_FAIL(ObBackupPathUtil::get_tenant_clog_backup_piece_dir_path(cluster_backup_dest,
|
||||||
|
tenant_id,
|
||||||
|
log_archive_status.round_,
|
||||||
|
0 /*backup_piece_id*/,
|
||||||
|
0 /*create_date*/,
|
||||||
|
backup_path))) {
|
||||||
|
LOG_WARN("failed to get tenant clog backup piece dir path",
|
||||||
|
KR(ret),
|
||||||
|
K(cluster_backup_dest),
|
||||||
|
K(tenant_id),
|
||||||
|
K(log_archive_status));
|
||||||
|
} else if (OB_FAIL(tmp_backup_dest.set(backup_path.get_ptr(), cluster_backup_dest.get_storage_info()))) {
|
||||||
|
LOG_WARN("failed to set backup dest", KR(ret), K(backup_path), K(cluster_backup_dest));
|
||||||
|
} else if (OB_FAIL(tmp_backup_dest.get_backup_dest_str(tmp_backup_dest_str, OB_MAX_BACKUP_DEST_LENGTH))) {
|
||||||
|
LOG_WARN("failed to get backup dest str", KR(ret));
|
||||||
|
} else if (OB_FAIL(simple_path.backup_dest_.assign(tmp_backup_dest_str))) {
|
||||||
|
LOG_WARN("failed to assign str", KR(ret), K(tmp_backup_dest_str));
|
||||||
|
} else {
|
||||||
|
simple_path.backup_piece_id_ = 0;
|
||||||
|
simple_path.copy_id_ = 0;
|
||||||
|
simple_path.file_status_ = ObBackupFileStatus::BACKUP_FILE_AVAILABLE;
|
||||||
|
if (OB_FAIL(path_list.push_back(simple_path))) {
|
||||||
|
LOG_WARN("failed to push back info", KR(ret), K(simple_path));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
int ObMultiBackupDestUtil::get_backup_piece_list(const bool is_preview, const char *cluster_name,
|
int ObMultiBackupDestUtil::get_backup_piece_list(const bool is_preview, const char *cluster_name,
|
||||||
const int64_t cluster_id, const uint64_t tenant_id, const int64_t snapshot_version,
|
const int64_t cluster_id, const uint64_t tenant_id, const int64_t snapshot_version,
|
||||||
const int64_t start_replay_log_ts, const int64_t restore_timestamp, const common::ObString &backup_dest_str,
|
const int64_t start_replay_log_ts, const int64_t restore_timestamp, const common::ObString &backup_dest_str,
|
||||||
@ -1016,6 +1159,7 @@ int ObMultiBackupDestUtil::do_get_backup_piece_list_from_cluster_level(const boo
|
|||||||
snapshot_version,
|
snapshot_version,
|
||||||
start_replay_log_ts,
|
start_replay_log_ts,
|
||||||
restore_timestamp,
|
restore_timestamp,
|
||||||
|
backup_dest,
|
||||||
piece_array,
|
piece_array,
|
||||||
path_list))) {
|
path_list))) {
|
||||||
LOG_WARN("failed to do inner get backup piece list", KR(ret), K(restore_timestamp));
|
LOG_WARN("failed to do inner get backup piece list", KR(ret), K(restore_timestamp));
|
||||||
@ -1058,7 +1202,8 @@ int ObMultiBackupDestUtil::do_get_backup_piece_list_from_cluster_level(const boo
|
|||||||
ObBackupPath backup_path;
|
ObBackupPath backup_path;
|
||||||
ObClusterBackupDest cluster_backup_dest;
|
ObClusterBackupDest cluster_backup_dest;
|
||||||
ObBackupDest tmp_backup_dest;
|
ObBackupDest tmp_backup_dest;
|
||||||
char tmp_backup_dest_str[OB_MAX_BACKUP_DEST_LENGTH] = "";
|
char tmp_simple_path_str[OB_MAX_BACKUP_DEST_LENGTH] = "";
|
||||||
|
char backup_dest_str[OB_MAX_BACKUP_DEST_LENGTH] = "";
|
||||||
if (OB_FAIL(cluster_backup_dest.set(
|
if (OB_FAIL(cluster_backup_dest.set(
|
||||||
tmp_piece.backup_dest_.ptr(), cluster_name, cluster_id, OB_START_INCARNATION))) {
|
tmp_piece.backup_dest_.ptr(), cluster_name, cluster_id, OB_START_INCARNATION))) {
|
||||||
LOG_WARN("failed to set cluster backup dest", KR(ret));
|
LOG_WARN("failed to set cluster backup dest", KR(ret));
|
||||||
@ -1073,9 +1218,9 @@ int ObMultiBackupDestUtil::do_get_backup_piece_list_from_cluster_level(const boo
|
|||||||
tmp_backup_dest.set(backup_path.get_ptr(), cluster_backup_dest.get_storage_info()))) {
|
tmp_backup_dest.set(backup_path.get_ptr(), cluster_backup_dest.get_storage_info()))) {
|
||||||
LOG_WARN("failed to set backup dest", KR(ret), K(backup_path), K(cluster_backup_dest));
|
LOG_WARN("failed to set backup dest", KR(ret), K(backup_path), K(cluster_backup_dest));
|
||||||
} else if (OB_FAIL(
|
} else if (OB_FAIL(
|
||||||
tmp_backup_dest.get_backup_dest_str(tmp_backup_dest_str, OB_MAX_BACKUP_DEST_LENGTH))) {
|
tmp_backup_dest.get_backup_dest_str(tmp_simple_path_str, OB_MAX_BACKUP_DEST_LENGTH))) {
|
||||||
LOG_WARN("failed to get backup dest str", KR(ret));
|
LOG_WARN("failed to get backup dest str", KR(ret));
|
||||||
} else if (OB_FAIL(new_simple_path.backup_dest_.assign(tmp_backup_dest_str))) {
|
} else if (OB_FAIL(new_simple_path.backup_dest_.assign(tmp_simple_path_str))) {
|
||||||
LOG_WARN("failed to assign str", KR(ret), K(tmp_piece));
|
LOG_WARN("failed to assign str", KR(ret), K(tmp_piece));
|
||||||
} else if (OB_FAIL(tmp_path_list.push_back(new_simple_path))) {
|
} else if (OB_FAIL(tmp_path_list.push_back(new_simple_path))) {
|
||||||
LOG_WARN("failed to push back new simple path", KR(ret), K(new_simple_path));
|
LOG_WARN("failed to push back new simple path", KR(ret), K(new_simple_path));
|
||||||
@ -1099,7 +1244,8 @@ int ObMultiBackupDestUtil::do_get_backup_piece_list_from_cluster_level(const boo
|
|||||||
|
|
||||||
int ObMultiBackupDestUtil::do_inner_get_backup_piece_list(const char *cluster_name, const int64_t cluster_id,
|
int ObMultiBackupDestUtil::do_inner_get_backup_piece_list(const char *cluster_name, const int64_t cluster_id,
|
||||||
const int64_t snapshot_version, const int64_t start_replay_log_ts, const int64_t restore_timestamp,
|
const int64_t snapshot_version, const int64_t start_replay_log_ts, const int64_t restore_timestamp,
|
||||||
const common::ObArray<ObBackupPieceInfo>& piece_array, common::ObArray<ObSimpleBackupPiecePath>& path_list)
|
const ObBackupDest &backup_dest, const common::ObArray<ObBackupPieceInfo> &piece_array,
|
||||||
|
common::ObArray<ObSimpleBackupPiecePath> &path_list)
|
||||||
{
|
{
|
||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
int64_t idx = -1;
|
int64_t idx = -1;
|
||||||
@ -1142,8 +1288,11 @@ int ObMultiBackupDestUtil::do_inner_get_backup_piece_list(const char* cluster_na
|
|||||||
ObBackupPath backup_path;
|
ObBackupPath backup_path;
|
||||||
ObClusterBackupDest cluster_backup_dest;
|
ObClusterBackupDest cluster_backup_dest;
|
||||||
ObBackupDest tmp_backup_dest;
|
ObBackupDest tmp_backup_dest;
|
||||||
char tmp_backup_dest_str[OB_MAX_BACKUP_DEST_LENGTH] = "";
|
char tmp_simple_path_str[OB_MAX_BACKUP_DEST_LENGTH] = "";
|
||||||
if (OB_FAIL(cluster_backup_dest.set(piece.backup_dest_.ptr(), cluster_name, cluster_id, OB_START_INCARNATION))) {
|
char backup_dest_str[OB_MAX_BACKUP_DEST_LENGTH] = "";
|
||||||
|
if (OB_FAIL(backup_dest.get_backup_dest_str(backup_dest_str, OB_MAX_BACKUP_DEST_LENGTH))) {
|
||||||
|
LOG_WARN("failed to get backup dest str", K(ret));
|
||||||
|
} else if (OB_FAIL(cluster_backup_dest.set(backup_dest_str, cluster_name, cluster_id, OB_START_INCARNATION))) {
|
||||||
LOG_WARN("failed to set cluster backup dest", KR(ret));
|
LOG_WARN("failed to set cluster backup dest", KR(ret));
|
||||||
} else if (OB_FAIL(ObBackupPathUtil::get_tenant_clog_backup_piece_dir_path(cluster_backup_dest,
|
} else if (OB_FAIL(ObBackupPathUtil::get_tenant_clog_backup_piece_dir_path(cluster_backup_dest,
|
||||||
piece.key_.tenant_id_,
|
piece.key_.tenant_id_,
|
||||||
@ -1154,9 +1303,9 @@ int ObMultiBackupDestUtil::do_inner_get_backup_piece_list(const char* cluster_na
|
|||||||
LOG_WARN("failed to get cluster clog prefix path", KR(ret));
|
LOG_WARN("failed to get cluster clog prefix path", KR(ret));
|
||||||
} else if (OB_FAIL(tmp_backup_dest.set(backup_path.get_ptr(), cluster_backup_dest.get_storage_info()))) {
|
} else if (OB_FAIL(tmp_backup_dest.set(backup_path.get_ptr(), cluster_backup_dest.get_storage_info()))) {
|
||||||
LOG_WARN("failed to set backup dest", KR(ret), K(backup_path), K(cluster_backup_dest));
|
LOG_WARN("failed to set backup dest", KR(ret), K(backup_path), K(cluster_backup_dest));
|
||||||
} else if (OB_FAIL(tmp_backup_dest.get_backup_dest_str(tmp_backup_dest_str, OB_MAX_BACKUP_DEST_LENGTH))) {
|
} else if (OB_FAIL(tmp_backup_dest.get_backup_dest_str(tmp_simple_path_str, OB_MAX_BACKUP_DEST_LENGTH))) {
|
||||||
LOG_WARN("failed to get backup dest str", KR(ret));
|
LOG_WARN("failed to get backup dest str", KR(ret));
|
||||||
} else if (OB_FAIL(simple_path.backup_dest_.assign(tmp_backup_dest_str))) {
|
} else if (OB_FAIL(simple_path.backup_dest_.assign(tmp_simple_path_str))) {
|
||||||
LOG_WARN("failed to assign str", KR(ret), K(piece));
|
LOG_WARN("failed to assign str", KR(ret), K(piece));
|
||||||
} else if (OB_FAIL(path_list.push_back(simple_path))) {
|
} else if (OB_FAIL(path_list.push_back(simple_path))) {
|
||||||
LOG_WARN("failed to push back info", KR(ret), K(simple_path));
|
LOG_WARN("failed to push back info", KR(ret), K(simple_path));
|
||||||
|
|||||||
@ -64,6 +64,9 @@ public:
|
|||||||
common::ObArray<share::ObBackupPieceInfo> &piece_info_list, bool &is_complete);
|
common::ObArray<share::ObBackupPieceInfo> &piece_info_list, bool &is_complete);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
static int check_is_compat_backup_path(const char *cluster_name, const int64_t cluster_id,
|
||||||
|
const share::ObBackupDest &backup_dest, const uint64_t tenant_id, const int64_t restore_timestamp,
|
||||||
|
int64_t &snapshot_version, bool &is_compat_path);
|
||||||
static int get_backup_dest_list(
|
static int get_backup_dest_list(
|
||||||
const common::ObArray<common::ObString> &path_list, common::ObArray<ObBackupPathString> &dest_list);
|
const common::ObArray<common::ObString> &path_list, common::ObArray<ObBackupPathString> &dest_list);
|
||||||
static int get_backup_set_info_path(const common::ObString &user_path, ObBackupPath &backup_set_path);
|
static int get_backup_set_info_path(const common::ObString &user_path, ObBackupPath &backup_set_path);
|
||||||
@ -83,21 +86,26 @@ private:
|
|||||||
const int64_t cluster_id, share::ObClusterBackupDest &cluster_backup_dest);
|
const int64_t cluster_id, share::ObClusterBackupDest &cluster_backup_dest);
|
||||||
static int get_backup_set_list(const bool is_preview, const char *cluster_name, const int64_t cluster_id,
|
static int get_backup_set_list(const bool is_preview, const char *cluster_name, const int64_t cluster_id,
|
||||||
const uint64_t tenant_id, const int64_t restore_timestamp, const common::ObString &backup_dest_str,
|
const uint64_t tenant_id, const int64_t restore_timestamp, const common::ObString &backup_dest_str,
|
||||||
common::ObArray<ObSimpleBackupSetPath>& path_list, int64_t& snapshot_version, int64_t& start_replay_log_ts);
|
common::ObArray<ObSimpleBackupSetPath> &path_list, int64_t &snapshot_version, int64_t &start_replay_log_ts,
|
||||||
|
bool &is_compat_path);
|
||||||
static int do_get_backup_set_list(const bool is_preview, const char *cluster_name, const int64_t cluster_id,
|
static int do_get_backup_set_list(const bool is_preview, const char *cluster_name, const int64_t cluster_id,
|
||||||
const uint64_t tenant_id, const int64_t restore_timestamp, const ObBackupDest &backup_dest,
|
const uint64_t tenant_id, const int64_t restore_timestamp, const ObBackupDest &backup_dest,
|
||||||
common::ObArray<ObSimpleBackupSetPath>& path_list, int64_t& snapshot_version, int64_t& start_replay_log_ts);
|
common::ObArray<ObSimpleBackupSetPath> &path_list, int64_t &snapshot_version, int64_t &start_replay_log_ts,
|
||||||
|
bool &is_compat_path);
|
||||||
static int do_get_backup_set_list_from_cluster_level(const bool is_preview, const char *cluster_name,
|
static int do_get_backup_set_list_from_cluster_level(const bool is_preview, const char *cluster_name,
|
||||||
const int64_t cluster_id, const uint64_t tenant_id, const int64_t restore_timestamp,
|
const int64_t cluster_id, const uint64_t tenant_id, const int64_t restore_timestamp,
|
||||||
const ObBackupDest &backup_dest, common::ObArray<ObSimpleBackupSetPath> &path_list, int64_t &snapshot_version,
|
const ObBackupDest &backup_dest, common::ObArray<ObSimpleBackupSetPath> &path_list, int64_t &snapshot_version,
|
||||||
int64_t &start_replay_log_ts);
|
int64_t &start_replay_log_ts);
|
||||||
static int do_inner_get_backup_set_list(const char *cluster_name, const int64_t cluster_id,
|
static int do_inner_get_backup_set_list(const char *cluster_name, const int64_t cluster_id,
|
||||||
const int64_t restore_timestamp, const ObArray<ObBackupSetFileInfo>& file_infos,
|
const int64_t restore_timestamp, const ObBackupDest &backup_dest, const ObArray<ObBackupSetFileInfo> &file_infos,
|
||||||
common::ObArray<ObSimpleBackupSetPath> &path_list, int64_t &snapshot_version, int64_t &start_replay_log_ts);
|
common::ObArray<ObSimpleBackupSetPath> &path_list, int64_t &snapshot_version, int64_t &start_replay_log_ts);
|
||||||
static int get_backup_piece_list(const bool is_preview, const char *cluster_name, const int64_t cluster_id,
|
static int get_backup_piece_list(const bool is_preview, const char *cluster_name, const int64_t cluster_id,
|
||||||
const uint64_t tenant_id, const int64_t snapshot_version, const int64_t start_replay_log_ts,
|
const uint64_t tenant_id, const int64_t snapshot_version, const int64_t start_replay_log_ts,
|
||||||
const int64_t restore_timestamp, const common::ObString &backup_dest_str,
|
const int64_t restore_timestamp, const common::ObString &backup_dest_str,
|
||||||
common::ObArray<ObSimpleBackupPiecePath> &path_list);
|
common::ObArray<ObSimpleBackupPiecePath> &path_list);
|
||||||
|
static int get_compat_backup_piece_list(const char *cluster_name, const int64_t cluster_id, const uint64_t tenant_id,
|
||||||
|
const int64_t snapshot_version, const int64_t restore_timestamp, const common::ObString &backup_dest_str,
|
||||||
|
common::ObArray<ObSimpleBackupPiecePath> &path_list);
|
||||||
static int do_get_backup_piece_list(const bool is_preview, const char *cluster_name, const int64_t cluster_id,
|
static int do_get_backup_piece_list(const bool is_preview, const char *cluster_name, const int64_t cluster_id,
|
||||||
const uint64_t tenant_id, const int64_t snapshot_version, const int64_t start_replay_log_ts,
|
const uint64_t tenant_id, const int64_t snapshot_version, const int64_t start_replay_log_ts,
|
||||||
const int64_t restore_timestamp, const ObBackupDest &backup_dest,
|
const int64_t restore_timestamp, const ObBackupDest &backup_dest,
|
||||||
@ -108,7 +116,8 @@ private:
|
|||||||
common::ObArray<ObSimpleBackupPiecePath> &path_list);
|
common::ObArray<ObSimpleBackupPiecePath> &path_list);
|
||||||
static int do_inner_get_backup_piece_list(const char *cluster_name, const int64_t cluster_id,
|
static int do_inner_get_backup_piece_list(const char *cluster_name, const int64_t cluster_id,
|
||||||
const int64_t snapshot_version, const int64_t start_replay_log_ts, const int64_t restore_timestamp,
|
const int64_t snapshot_version, const int64_t start_replay_log_ts, const int64_t restore_timestamp,
|
||||||
const ObArray<ObBackupPieceInfo>& piece_array, common::ObArray<ObSimpleBackupPiecePath>& path_list);
|
const ObBackupDest &backup_dest, const ObArray<ObBackupPieceInfo> &piece_array,
|
||||||
|
common::ObArray<ObSimpleBackupPiecePath> &path_list);
|
||||||
static int may_need_replace_active_piece_info(const ObClusterBackupDest &dest, const common::ObString &storage_info,
|
static int may_need_replace_active_piece_info(const ObClusterBackupDest &dest, const common::ObString &storage_info,
|
||||||
common::ObArray<ObBackupPieceInfo> &piece_array);
|
common::ObArray<ObBackupPieceInfo> &piece_array);
|
||||||
static int check_backup_path_is_backup_backup(const char *cluster_name, const int64_t cluster_id,
|
static int check_backup_path_is_backup_backup(const char *cluster_name, const int64_t cluster_id,
|
||||||
|
|||||||
@ -210,8 +210,7 @@ ObPhysicalRestoreJob::ObPhysicalRestoreJob()
|
|||||||
bool ObPhysicalRestoreJob::is_valid() const
|
bool ObPhysicalRestoreJob::is_valid() const
|
||||||
{
|
{
|
||||||
return OB_INVALID_ID != job_id_ && PhysicalRestoreStatus::PHYSICAL_RESTORE_MAX_STATUS != status_ &&
|
return OB_INVALID_ID != job_id_ && PhysicalRestoreStatus::PHYSICAL_RESTORE_MAX_STATUS != status_ &&
|
||||||
((!multi_restore_path_list_.is_compat_backup_path() && strlen(backup_dest_) == 0) ||
|
!(0 == strlen(backup_dest_) && 0 == multi_restore_path_list_.get_backup_set_path_list().count());
|
||||||
(multi_restore_path_list_.is_compat_backup_path() && strlen(backup_dest_) > 0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DEF_TO_STRING(ObPhysicalRestoreJob)
|
DEF_TO_STRING(ObPhysicalRestoreJob)
|
||||||
|
|||||||
@ -1189,6 +1189,9 @@ ERRSIM_DEF_BOOL(allow_major_sstable_merge, OB_CLUSTER_PARAMETER, "True", "allow_
|
|||||||
ObParameterAttr(Section::OBSERVER, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
|
ObParameterAttr(Section::OBSERVER, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
|
||||||
ERRSIM_DEF_BOOL(trigger_reuse_table_in_table_mgr, OB_CLUSTER_PARAMETER, "False", "trigger_reuse_table_in_table_mgr",
|
ERRSIM_DEF_BOOL(trigger_reuse_table_in_table_mgr, OB_CLUSTER_PARAMETER, "False", "trigger_reuse_table_in_table_mgr",
|
||||||
ObParameterAttr(Section::OBSERVER, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
|
ObParameterAttr(Section::OBSERVER, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
|
||||||
|
ERRSIM_DEF_BOOL(fake_backup_date_for_incremental_backup, OB_CLUSTER_PARAMETER, "False",
|
||||||
|
"incremental backup use fake backup date",
|
||||||
|
ObParameterAttr(Section::OBSERVER, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
|
||||||
ERRSIM_DEF_CAP(slog_size, OB_CLUSTER_PARAMETER, "256M", "[0M,256M]", "size of the slog file. Range: [0, 256M]",
|
ERRSIM_DEF_CAP(slog_size, OB_CLUSTER_PARAMETER, "256M", "[0M,256M]", "size of the slog file. Range: [0, 256M]",
|
||||||
ObParameterAttr(Section::SSTABLE, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
|
ObParameterAttr(Section::SSTABLE, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
|
||||||
ERRSIM_DEF_BOOL(fake_replay_start_point, OB_CLUSTER_PARAMETER, "False", "fake_replay_start_point",
|
ERRSIM_DEF_BOOL(fake_replay_start_point, OB_CLUSTER_PARAMETER, "False", "fake_replay_start_point",
|
||||||
|
|||||||
Reference in New Issue
Block a user