fix cannot recognize restore path with spaces in

This commit is contained in:
wxhwang
2023-08-11 04:12:46 +00:00
committed by ob-robot
parent 766e0c2c35
commit 727e11ecf3
5 changed files with 19 additions and 11 deletions

View File

@ -58,7 +58,7 @@ int validate_uri_type(const common::ObString &uri)
if (!uri.prefix_match(OB_OSS_PREFIX) &&
!uri.prefix_match(OB_FILE_PREFIX)) {
ret = OB_INVALID_BACKUP_DEST;
STORAGE_LOG(ERROR, "invlaid backup uri", K(ret), K(uri));
STORAGE_LOG(ERROR, "invalid backup uri", K(ret), K(uri));
}
return ret;
}

View File

@ -21364,10 +21364,10 @@ static const _error _error_OB_INVALID_BACKUP_DEST = {
.mysql_errno = -1,
.sqlstate = "HY000",
.str_error = "backup destination is not valid",
.str_user_error = "backup destination is not valid",
.str_user_error = "%s is not a valid uri",
.oracle_errno = 600,
.oracle_str_error = "ORA-00600: internal error code, arguments: -9026, backup destination is not valid",
.oracle_str_user_error = "ORA-00600: internal error code, arguments: -9026, backup destination is not valid"
.oracle_str_user_error = "ORA-00600: internal error code, arguments: -9026, %s is not a valid uri"
};
static const _error _error_OB_LOG_ARCHIVE_INTERRUPTED = {
.error_name = "OB_LOG_ARCHIVE_INTERRUPTED",

View File

@ -1957,7 +1957,7 @@ DEFINE_ERROR(OB_STOP_DROP_SCHEMA, -9022, -1, "HY000", "physical backup switch is
DEFINE_ERROR(OB_CANNOT_START_LOG_ARCHIVE_BACKUP, -9023, -1, "HY000", "cannot start log archive backup");
DEFINE_ERROR(OB_ALREADY_NO_LOG_ARCHIVE_BACKUP, -9024, -1, "HY000", "log archive backup is already disabled");
DEFINE_ERROR(OB_LOG_ARCHIVE_BACKUP_INFO_NOT_EXIST, -9025, -1, "HY000", "log archive backup info not exists");
DEFINE_ERROR_DEP(OB_INVALID_BACKUP_DEST, -9026, -1, "HY000", "backup destination is not valid");
DEFINE_ERROR_EXT_DEP(OB_INVALID_BACKUP_DEST, -9026, -1, "HY000", "backup destination is not valid", "%s is not a valid uri");
DEFINE_ERROR(OB_LOG_ARCHIVE_INTERRUPTED, -9027, -1, "HY000", "ob log archive interrupted");
DEFINE_ERROR(OB_LOG_ARCHIVE_STAT_NOT_MATCH, -9028, -1, "HY000", "ob log archive stat not match");
DEFINE_ERROR(OB_LOG_ARCHIVE_NOT_RUNNING, -9029, -1, "HY000", "log archive is not running");

View File

@ -3553,7 +3553,7 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219;
#define OB_CANNOT_START_LOG_ARCHIVE_BACKUP__USER_ERROR_MSG "cannot start log archive backup"
#define OB_ALREADY_NO_LOG_ARCHIVE_BACKUP__USER_ERROR_MSG "log archive backup is already disabled"
#define OB_LOG_ARCHIVE_BACKUP_INFO_NOT_EXIST__USER_ERROR_MSG "log archive backup info not exists"
#define OB_INVALID_BACKUP_DEST__USER_ERROR_MSG "backup destination is not valid"
#define OB_INVALID_BACKUP_DEST__USER_ERROR_MSG "%s is not a valid uri"
#define OB_LOG_ARCHIVE_INTERRUPTED__USER_ERROR_MSG "ob log archive interrupted"
#define OB_LOG_ARCHIVE_STAT_NOT_MATCH__USER_ERROR_MSG "ob log archive stat not match"
#define OB_LOG_ARCHIVE_NOT_RUNNING__USER_ERROR_MSG "log archive is not running"
@ -5667,7 +5667,7 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219;
#define OB_CANNOT_START_LOG_ARCHIVE_BACKUP__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -9023, cannot start log archive backup"
#define OB_ALREADY_NO_LOG_ARCHIVE_BACKUP__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -9024, log archive backup is already disabled"
#define OB_LOG_ARCHIVE_BACKUP_INFO_NOT_EXIST__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -9025, log archive backup info not exists"
#define OB_INVALID_BACKUP_DEST__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -9026, backup destination is not valid"
#define OB_INVALID_BACKUP_DEST__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -9026, %s is not a valid uri"
#define OB_LOG_ARCHIVE_INTERRUPTED__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -9027, ob log archive interrupted"
#define OB_LOG_ARCHIVE_STAT_NOT_MATCH__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -9028, ob log archive stat not match"
#define OB_LOG_ARCHIVE_NOT_RUNNING__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -9029, log archive is not running"

View File

@ -16,6 +16,7 @@
#include "common/ob_zone.h"
#include "lib/utility/utility.h"
#include "lib/restore/ob_storage_path.h"
#include "lib/restore/ob_storage.h"
#include "share/backup/ob_backup_io_adapter.h"
using namespace oceanbase::common;
@ -226,13 +227,20 @@ int ObPhysicalRestoreUriParser::parse(
tok = ::strtok_r(str, ",", &ptr);
if (OB_ISNULL(tok)) {
break;
} else if (OB_FAIL(find_repeat_(uri_list, tok, is_repeat))) {
LOG_WARN("failed to find repeat", KR(ret), K(tok), K(uri_list));
}
ObString path(tok);
const ObString actual_path = path.trim();
if (OB_FAIL(validate_uri_type(actual_path))) {
LOG_WARN("invalid uri", KR(ret), K(path), K(actual_path));
LOG_USER_ERROR(OB_INVALID_BACKUP_DEST, tok);
} else if (OB_FAIL(find_repeat_(uri_list, actual_path, is_repeat))) {
LOG_WARN("failed to find repeat", KR(ret), K(actual_path), K(uri_list));
} else if (is_repeat) {
// skip repeat path
LOG_INFO("skip repeat path", K(tok));
} else if (OB_FAIL(uri_list.push_back(tok))) {
LOG_WARN("failed to push back", KR(ret), K(tok));
LOG_INFO("skip repeat path", K(actual_path));
} else if (OB_FAIL(uri_list.push_back(actual_path))) {
LOG_WARN("failed to push back", KR(ret), K(actual_path));
}
}
}