handle io limit

This commit is contained in:
wxhwang 2023-11-08 15:43:29 +00:00 committed by ob-robot
parent 8228be3770
commit f683905fcd
3 changed files with 23 additions and 7 deletions

View File

@ -222,6 +222,11 @@ static void convert_io_error(aos_status_t *aos_ret, int &ob_errcode)
break;
}
case OSS_LIMIT_EXCEEDED: {
ob_errcode = OB_IO_LIMIT;
break;
}
default: {
ob_errcode = OB_OSS_ERROR;
}
@ -1924,11 +1929,16 @@ int ObStorageOssAppendWriter::do_write(const char *buf, const int64_t size, cons
OB_LOG(WARN, "oss object must be appendable", K(ret), KCSTRING(object_type));
} else {
char *next_append_position = (char*)(apr_table_get(resp_headers, OSS_NEXT_APPEND_POSITION));
position = aos_atoi64(next_append_position);
if (0 > position) {
ObString tmp_position_string(next_append_position);
if (OB_ISNULL(next_append_position)) {
ret = OB_OSS_ERROR;
OB_LOG(WARN, "invalid append position", K(ret), K(position), K(tmp_position_string));
OB_LOG(WARN, "next_append_position is not found", K(ret), K_(bucket), K_(object));
} else {
position = aos_atoi64(next_append_position);
if (0 > position) {
ObString tmp_position_string(next_append_position);
ret = OB_OSS_ERROR;
OB_LOG(WARN, "invalid append position", K(ret), K(position), K(tmp_position_string));
}
}
}
}
@ -1962,8 +1972,12 @@ int ObStorageOssAppendWriter::do_write(const char *buf, const int64_t size, cons
if(OB_NOT_NULL(aos_ret = oss_head_object(oss_option_, &bucket, &object, headers3, &resp_headers))) {
if ((0 != aos_status_is_ok(aos_ret))) {
char *append_pos_str = (char*)(apr_table_get(resp_headers, OSS_NEXT_APPEND_POSITION));
int64_t cur_pos = aos_atoi64(append_pos_str);
OB_LOG(WARN, "after append fail, we got the object meta", K(cur_pos));
if (OB_ISNULL(append_pos_str)) {
OB_LOG(WARN, "after append fail, current append pos is not found");
} else {
int64_t cur_pos = aos_atoi64(append_pos_str);
OB_LOG(WARN, "after append fail, we got the object meta", K(cur_pos));
}
}
}
}

View File

@ -40,6 +40,7 @@ namespace common
static const int OSS_OBJECT_NOT_EXIST = 404;
static const int OSS_PERMISSION_DENIED = 403;
static const int OSS_OBJECT_PWRITE_OFFSET_NOT_MATH = 409;
static const int OSS_LIMIT_EXCEEDED = 503;
static const int MD5_STR_LENGTH = 32;//md5 buffer length
static const char OSS_META_MD5[] = "x-oss-meta-md5";
const static int64_t AOS_TABLE_INIT_SIZE = 1;

View File

@ -2881,7 +2881,8 @@ void ObLSRestoreResultMgr::set_result(const int result, const share::ObTaskId &t
// 1. result_ is OB_SUCCESS;
// 2. result_ is retrieable err, but input result is non retrieable err.
lib::ObMutexGuard guard(mtx_);
if (OB_EAGAIN == result) {
if (OB_EAGAIN == result
|| OB_IO_LIMIT == result) {
} else {
if (retry_cnt_ >= OB_MAX_RESTORE_RETRY_TIMES) { // avoiding overwrite error code
} else if ((!can_retrieable_err(result) && can_retrieable_err(result_))