From 1f1d5c08ae60f6e2222f2eafc66521096d5c20a1 Mon Sep 17 00:00:00 2001 From: LoLolobster <949673574@qq.com> Date: Tue, 6 Feb 2024 09:42:16 +0000 Subject: [PATCH] Modify err msg of OB_BACKUP_FORMAT_FILE_NOT_EXIST and OB_BACKUP_FORMAT_FILE_NOT_MATCH --- deps/oblib/src/lib/ob_errno.h | 2 ++ src/share/backup/ob_backup_store.cpp | 10 ++++++++-- src/share/ob_errno.cpp | 16 ++++++++-------- src/share/ob_errno.def | 4 ++-- src/share/ob_errno.h | 10 ++++------ 5 files changed, 24 insertions(+), 18 deletions(-) diff --git a/deps/oblib/src/lib/ob_errno.h b/deps/oblib/src/lib/ob_errno.h index f8af1f990f..202e12bd13 100644 --- a/deps/oblib/src/lib/ob_errno.h +++ b/deps/oblib/src/lib/ob_errno.h @@ -392,6 +392,8 @@ constexpr int OB_BACKUP_IO_PROHIBITED = -9063; constexpr int OB_BACKUP_PERMISSION_DENIED = -9071; constexpr int OB_ESI_OBS_ERROR = -9073; constexpr int OB_BACKUP_META_INDEX_NOT_EXIST = -9076; +constexpr int OB_BACKUP_FORMAT_FILE_NOT_EXIST = -9080; +constexpr int OB_BACKUP_FORMAT_FILE_NOT_MATCH = -9081; constexpr int OB_BACKUP_DEVICE_OUT_OF_SPACE = -9082; constexpr int OB_BACKUP_PWRITE_OFFSET_NOT_MATCH = -9083; constexpr int OB_BACKUP_PWRITE_CONTENT_NOT_MATCH = -9084; diff --git a/src/share/backup/ob_backup_store.cpp b/src/share/backup/ob_backup_store.cpp index 89bc6ba2d9..a985c0c2c7 100644 --- a/src/share/backup/ob_backup_store.cpp +++ b/src/share/backup/ob_backup_store.cpp @@ -441,6 +441,7 @@ int ObBackupDestMgr::check_dest_validity(obrpc::ObSrvRpcProxy &rpc_proxy, const } else if (!is_exist) { ret = OB_BACKUP_FORMAT_FILE_NOT_EXIST; LOG_WARN("format file does not exist", K(ret), K_(backup_dest)); + LOG_USER_ERROR(OB_BACKUP_FORMAT_FILE_NOT_EXIST, ", try to set a new directory."); } else { share::ObBackupFormatDesc format_desc; share::ObBackupFormatDesc dest_format; @@ -450,21 +451,25 @@ int ObBackupDestMgr::check_dest_validity(obrpc::ObSrvRpcProxy &rpc_proxy, const } else if (dest_format.dest_type_ != dest_type_) { ret = OB_BACKUP_FORMAT_FILE_NOT_MATCH; LOG_WARN("dest_type not match", K(ret), K(dest_format), K(dest_type_)); + LOG_USER_ERROR(OB_BACKUP_FORMAT_FILE_NOT_MATCH, ", try to set a new directory."); } else if (OB_FAIL(ObBackupStorageInfoOperator::get_dest_id(*sql_proxy_, tenant_id_, backup_dest_, dest_id))) { LOG_WARN("fail to get dest id", K(ret), K_(tenant_id), K(backup_dest_)); } else if (OB_FAIL(ObBackupStorageInfoOperator::get_dest_type(*sql_proxy_, tenant_id_, backup_dest_, dest_type))) { LOG_WARN("fail to get dest type", K(ret), K_(tenant_id), K(backup_dest_)); } else if (dest_type != dest_type_) { ret = OB_BACKUP_FORMAT_FILE_NOT_MATCH; - LOG_WARN("dest type is not match", K(ret), K(dest_type), K(dest_type_)); + LOG_WARN("dest type is not match", K(ret), K(dest_type), K(dest_type_)); + LOG_USER_ERROR(OB_BACKUP_FORMAT_FILE_NOT_MATCH, ",try to set a new directory."); } else if (OB_FAIL(generate_format_desc_(dest_id, dest_type, format_desc))) { LOG_WARN("fail to generate format desc", K(ret), K(backup_dest_), K(dest_id)); } else if (format_desc.dest_type_ != dest_type_) { ret = OB_BACKUP_FORMAT_FILE_NOT_MATCH; LOG_WARN("dest_type not match", K(ret), K(dest_format), K(dest_type_)); + LOG_USER_ERROR(OB_BACKUP_FORMAT_FILE_NOT_MATCH, ", try to set a new directory."); } else if (!(format_desc.is_format_equal(dest_format))) { ret = OB_BACKUP_FORMAT_FILE_NOT_MATCH; LOG_WARN("format file is not match", K(ret), K(format_desc), K(dest_format)); + LOG_USER_ERROR(OB_BACKUP_FORMAT_FILE_NOT_MATCH, ", try to set a new directory."); } } } else { @@ -472,7 +477,8 @@ int ObBackupDestMgr::check_dest_validity(obrpc::ObSrvRpcProxy &rpc_proxy, const LOG_INFO("succ check dest validity", K_(backup_dest), K(is_empty)); } else { ret = OB_BACKUP_FORMAT_FILE_NOT_EXIST; - LOG_WARN("format file does not exist", K(ret), K_(backup_dest), K(is_empty)); + LOG_WARN("format file does not exist", K(ret), K_(backup_dest), K(is_empty)); + LOG_USER_ERROR(OB_BACKUP_FORMAT_FILE_NOT_EXIST, ", try to set a new directory."); } } return ret; diff --git a/src/share/ob_errno.cpp b/src/share/ob_errno.cpp index 2bcdde7a22..08c72da6ab 100644 --- a/src/share/ob_errno.cpp +++ b/src/share/ob_errno.cpp @@ -22647,11 +22647,11 @@ static const _error _error_OB_BACKUP_FORMAT_FILE_NOT_EXIST = { .error_solution = "Contact OceanBase Support", .mysql_errno = -1, .sqlstate = "HY000", - .str_error = "the format file does not exist under the destination", - .str_user_error = "the format file does not exist under the destination", + .str_error = "format file does not exist", + .str_user_error = "format file does not exist%s", .oracle_errno = 600, - .oracle_str_error = "ORA-00600: internal error code, arguments: -9080, the format file does not exist under the destination", - .oracle_str_user_error = "ORA-00600: internal error code, arguments: -9080, the format file does not exist under the destination" + .oracle_str_error = "ORA-00600: internal error code, arguments: -9080, format file does not exist", + .oracle_str_user_error = "ORA-00600: internal error code, arguments: -9080, format file does not exist%s" }; static const _error _error_OB_BACKUP_FORMAT_FILE_NOT_MATCH = { .error_name = "OB_BACKUP_FORMAT_FILE_NOT_MATCH", @@ -22659,11 +22659,11 @@ static const _error _error_OB_BACKUP_FORMAT_FILE_NOT_MATCH = { .error_solution = "Contact OceanBase Support", .mysql_errno = -1, .sqlstate = "HY000", - .str_error = "the content of the format file at the destination does not match", - .str_user_error = "the content of the format file at the destination does not match", + .str_error = "format file does not match", + .str_user_error = "format file does not match%s", .oracle_errno = 600, - .oracle_str_error = "ORA-00600: internal error code, arguments: -9081, the content of the format file at the destination does not match", - .oracle_str_user_error = "ORA-00600: internal error code, arguments: -9081, the content of the format file at the destination does not match" + .oracle_str_error = "ORA-00600: internal error code, arguments: -9081, format file does not match", + .oracle_str_user_error = "ORA-00600: internal error code, arguments: -9081, format file does not match%s" }; static const _error _error_OB_BACKUP_DEVICE_OUT_OF_SPACE = { .error_name = "OB_BACKUP_DEVICE_OUT_OF_SPACE", diff --git a/src/share/ob_errno.def b/src/share/ob_errno.def index cc864e7222..a166185d7c 100755 --- a/src/share/ob_errno.def +++ b/src/share/ob_errno.def @@ -2220,8 +2220,8 @@ DEFINE_ERROR_DEP(OB_BACKUP_META_INDEX_NOT_EXIST, -9076, -1, "HY000", "backup met DEFINE_ERROR(OB_ARCHIVE_ROUND_NOT_CONTINUOUS, -9077, -1, "HY000", "log discontinuous between two archive rounds"); DEFINE_ERROR(OB_ARCHIVE_LOG_TO_END, -9078, -1, "HY000", "archive log is to end"); DEFINE_ERROR(OB_ARCHIVE_LOG_RECYCLED, -9079, -1, "HY000", "archive log had been recycled"); -DEFINE_ERROR(OB_BACKUP_FORMAT_FILE_NOT_EXIST, -9080, -1, "HY000", "the format file does not exist under the destination"); -DEFINE_ERROR(OB_BACKUP_FORMAT_FILE_NOT_MATCH, -9081, -1, "HY000", "the content of the format file at the destination does not match"); +DEFINE_ERROR_EXT_DEP(OB_BACKUP_FORMAT_FILE_NOT_EXIST, -9080, -1, "HY000", "format file does not exist", "format file does not exist%s"); +DEFINE_ERROR_EXT_DEP(OB_BACKUP_FORMAT_FILE_NOT_MATCH, -9081, -1, "HY000", "format file does not match", "format file does not match%s"); DEFINE_ERROR_DEP(OB_BACKUP_DEVICE_OUT_OF_SPACE, -9082, -1, "HY000", "backup device out of space"); DEFINE_ERROR_DEP(OB_BACKUP_PWRITE_OFFSET_NOT_MATCH, -9083, -1, "HY000", "the pwrite offset of the object storage is inconsistent"); DEFINE_ERROR_DEP(OB_BACKUP_PWRITE_CONTENT_NOT_MATCH, -9084, -1, "HY000", "the contents of pwrite are inconsistent"); diff --git a/src/share/ob_errno.h b/src/share/ob_errno.h index a279172317..cfde2c04cb 100644 --- a/src/share/ob_errno.h +++ b/src/share/ob_errno.h @@ -1537,8 +1537,6 @@ constexpr int OB_ESI_IO_ERROR = -9075; constexpr int OB_ARCHIVE_ROUND_NOT_CONTINUOUS = -9077; constexpr int OB_ARCHIVE_LOG_TO_END = -9078; constexpr int OB_ARCHIVE_LOG_RECYCLED = -9079; -constexpr int OB_BACKUP_FORMAT_FILE_NOT_EXIST = -9080; -constexpr int OB_BACKUP_FORMAT_FILE_NOT_MATCH = -9081; constexpr int OB_BACKUP_MAJOR_NOT_COVER_MINOR = -9085; constexpr int OB_BACKUP_ADVANCE_CHECKPOINT_TIMEOUT = -9086; constexpr int OB_CLOG_RECYCLE_BEFORE_ARCHIVE = -9087; @@ -3746,8 +3744,8 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219; #define OB_ARCHIVE_ROUND_NOT_CONTINUOUS__USER_ERROR_MSG "log discontinuous between two archive rounds" #define OB_ARCHIVE_LOG_TO_END__USER_ERROR_MSG "archive log is to end" #define OB_ARCHIVE_LOG_RECYCLED__USER_ERROR_MSG "archive log had been recycled" -#define OB_BACKUP_FORMAT_FILE_NOT_EXIST__USER_ERROR_MSG "the format file does not exist under the destination" -#define OB_BACKUP_FORMAT_FILE_NOT_MATCH__USER_ERROR_MSG "the content of the format file at the destination does not match" +#define OB_BACKUP_FORMAT_FILE_NOT_EXIST__USER_ERROR_MSG "format file does not exist%s" +#define OB_BACKUP_FORMAT_FILE_NOT_MATCH__USER_ERROR_MSG "format file does not match%s" #define OB_BACKUP_DEVICE_OUT_OF_SPACE__USER_ERROR_MSG "backup device out of space" #define OB_BACKUP_PWRITE_OFFSET_NOT_MATCH__USER_ERROR_MSG "the pwrite offset of the object storage is inconsistent" #define OB_BACKUP_PWRITE_CONTENT_NOT_MATCH__USER_ERROR_MSG "the contents of pwrite are inconsistent" @@ -5970,8 +5968,8 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219; #define OB_ARCHIVE_ROUND_NOT_CONTINUOUS__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -9077, log discontinuous between two archive rounds" #define OB_ARCHIVE_LOG_TO_END__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -9078, archive log is to end" #define OB_ARCHIVE_LOG_RECYCLED__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -9079, archive log had been recycled" -#define OB_BACKUP_FORMAT_FILE_NOT_EXIST__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -9080, the format file does not exist under the destination" -#define OB_BACKUP_FORMAT_FILE_NOT_MATCH__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -9081, the content of the format file at the destination does not match" +#define OB_BACKUP_FORMAT_FILE_NOT_EXIST__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -9080, format file does not exist%s" +#define OB_BACKUP_FORMAT_FILE_NOT_MATCH__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -9081, format file does not match%s" #define OB_BACKUP_DEVICE_OUT_OF_SPACE__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -9082, backup device out of space" #define OB_BACKUP_PWRITE_OFFSET_NOT_MATCH__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -9083, the pwrite offset of the object storage is inconsistent" #define OB_BACKUP_PWRITE_CONTENT_NOT_MATCH__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -9084, the contents of pwrite are inconsistent"