Improve Error Messaging for NFS/OSS/COS Interfaces
This commit is contained in:
50
deps/oblib/src/lib/restore/ob_storage_file.cpp
vendored
50
deps/oblib/src/lib/restore/ob_storage_file.cpp
vendored
@ -33,7 +33,7 @@ static void convert_io_error(const int sys_err, int &ob_error_code)
|
|||||||
ob_error_code = OB_BACKUP_FILE_NOT_EXIST;
|
ob_error_code = OB_BACKUP_FILE_NOT_EXIST;
|
||||||
} else if (EPERM == sys_err) {
|
} else if (EPERM == sys_err) {
|
||||||
ob_error_code = OB_BACKUP_PERMISSION_DENIED;
|
ob_error_code = OB_BACKUP_PERMISSION_DENIED;
|
||||||
} else if (ENOSPC == sys_err) {
|
} else if (ENOSPC == sys_err || EDQUOT == sys_err) {
|
||||||
ob_error_code = OB_BACKUP_DEVICE_OUT_OF_SPACE;
|
ob_error_code = OB_BACKUP_DEVICE_OUT_OF_SPACE;
|
||||||
} else {
|
} else {
|
||||||
ob_error_code = OB_IO_ERROR;
|
ob_error_code = OB_IO_ERROR;
|
||||||
@ -76,7 +76,7 @@ int lock_file(int fd)
|
|||||||
ret = OB_INVALID_ARGUMENT;
|
ret = OB_INVALID_ARGUMENT;
|
||||||
STORAGE_LOG(WARN, "invalid fd", K(ret), K(fd));
|
STORAGE_LOG(WARN, "invalid fd", K(ret), K(fd));
|
||||||
} else if (0 != fcntl(fd, F_SETLK, &lock)) {
|
} else if (0 != fcntl(fd, F_SETLK, &lock)) {
|
||||||
ret = OB_IO_ERROR;
|
convert_io_error(errno, ret);
|
||||||
STORAGE_LOG(WARN, "failed to lock file",
|
STORAGE_LOG(WARN, "failed to lock file",
|
||||||
K(ret), K(fd), K(errno), "errno", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
K(ret), K(fd), K(errno), "errno", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
||||||
}
|
}
|
||||||
@ -99,7 +99,7 @@ int unlock_file(int fd)
|
|||||||
ret = OB_INVALID_ARGUMENT;
|
ret = OB_INVALID_ARGUMENT;
|
||||||
STORAGE_LOG(WARN, "invalid fd", K(ret), K(fd));
|
STORAGE_LOG(WARN, "invalid fd", K(ret), K(fd));
|
||||||
} else if (0 != fcntl(fd, F_SETLK, &lock)) {
|
} else if (0 != fcntl(fd, F_SETLK, &lock)) {
|
||||||
ret = OB_IO_ERROR;
|
convert_io_error(errno, ret);
|
||||||
STORAGE_LOG(WARN, "failed to lock file",
|
STORAGE_LOG(WARN, "failed to lock file",
|
||||||
K(ret), K(fd), K(errno), "errno", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
K(ret), K(fd), K(errno), "errno", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
||||||
}
|
}
|
||||||
@ -132,7 +132,7 @@ int ObStorageFileUtil::is_exist(const common::ObString &uri, bool &exist)
|
|||||||
} else if (0 == ::access(path, F_OK)) {
|
} else if (0 == ::access(path, F_OK)) {
|
||||||
exist = true;
|
exist = true;
|
||||||
} else if (ENOENT != errno && ENOTDIR != errno) {
|
} else if (ENOENT != errno && ENOTDIR != errno) {
|
||||||
ret = OB_IO_ERROR;
|
convert_io_error(errno, ret);
|
||||||
STORAGE_LOG(WARN, "failed to stat file",
|
STORAGE_LOG(WARN, "failed to stat file",
|
||||||
K(ret), KCSTRING(path), K(errno), "errno", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
K(ret), KCSTRING(path), K(errno), "errno", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
||||||
}
|
}
|
||||||
@ -213,7 +213,7 @@ int ObStorageFileUtil::del_file(const common::ObString &uri)
|
|||||||
} else if (OB_FAIL(get_file_path(uri, path, sizeof(path)))) {
|
} else if (OB_FAIL(get_file_path(uri, path, sizeof(path)))) {
|
||||||
STORAGE_LOG(WARN, "failed to fill path", K(ret), K(uri));
|
STORAGE_LOG(WARN, "failed to fill path", K(ret), K(uri));
|
||||||
} else if (0 != ::unlink(path)) {
|
} else if (0 != ::unlink(path)) {
|
||||||
ret = OB_IO_ERROR;
|
convert_io_error(errno, ret);
|
||||||
STORAGE_LOG(WARN, "failed to del file",
|
STORAGE_LOG(WARN, "failed to del file",
|
||||||
K(ret), KCSTRING(path), K(errno), "errno", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
K(ret), KCSTRING(path), K(errno), "errno", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
||||||
}
|
}
|
||||||
@ -272,7 +272,7 @@ int ObStorageFileUtil::mkdir(const common::ObString &uri)
|
|||||||
STORAGE_LOG(WARN, "already exist the same name file", K(ret), KCSTRING(path),
|
STORAGE_LOG(WARN, "already exist the same name file", K(ret), KCSTRING(path),
|
||||||
K(errno), "errno", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
K(errno), "errno", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
||||||
} else if (ENOENT != errno) {
|
} else if (ENOENT != errno) {
|
||||||
ret = OB_IO_ERROR;
|
convert_io_error(errno, ret);
|
||||||
STORAGE_LOG(WARN, "check is parent dir exist",
|
STORAGE_LOG(WARN, "check is parent dir exist",
|
||||||
K(ret), KCSTRING(path), K(errno), "errno", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
K(ret), KCSTRING(path), K(errno), "errno", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
||||||
}
|
}
|
||||||
@ -294,7 +294,7 @@ int ObStorageFileUtil::mkdir(const common::ObString &uri)
|
|||||||
if (0 != ::mkdir(path, S_IRWXU)) {
|
if (0 != ::mkdir(path, S_IRWXU)) {
|
||||||
if (EEXIST == errno) {
|
if (EEXIST == errno) {
|
||||||
if (0 != ::access(path, F_OK)) {
|
if (0 != ::access(path, F_OK)) {
|
||||||
ret = OB_IO_ERROR;
|
convert_io_error(errno, ret);
|
||||||
STORAGE_LOG(WARN, "parent dir is not exist",
|
STORAGE_LOG(WARN, "parent dir is not exist",
|
||||||
K(ret), KCSTRING(path), K(errno), "errno", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
K(ret), KCSTRING(path), K(errno), "errno", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
||||||
}
|
}
|
||||||
@ -307,7 +307,7 @@ int ObStorageFileUtil::mkdir(const common::ObString &uri)
|
|||||||
STORAGE_LOG(INFO, "succeed to create parent dir", KCSTRING(path), K(uri));
|
STORAGE_LOG(INFO, "succeed to create parent dir", KCSTRING(path), K(uri));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ret = OB_IO_ERROR;
|
convert_io_error(errno, ret);
|
||||||
STORAGE_LOG(WARN, "check is parent dir exist",
|
STORAGE_LOG(WARN, "check is parent dir exist",
|
||||||
K(ret), KCSTRING(path), K(errno), "errno", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
K(ret), KCSTRING(path), K(errno), "errno", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
||||||
}
|
}
|
||||||
@ -341,7 +341,7 @@ int ObStorageFileUtil::list_files(const common::ObString &uri, common::ObBaseDir
|
|||||||
STORAGE_LOG(WARN, "failed to fill path", K(ret), K(uri));
|
STORAGE_LOG(WARN, "failed to fill path", K(ret), K(uri));
|
||||||
} else if (OB_ISNULL(open_dir = ::opendir(dir_path))) {
|
} else if (OB_ISNULL(open_dir = ::opendir(dir_path))) {
|
||||||
if (ENOENT != errno) {
|
if (ENOENT != errno) {
|
||||||
ret = OB_IO_ERROR;
|
convert_io_error(errno, ret);
|
||||||
OB_LOG(WARN, "fail to open dir", K(ret), KCSTRING(dir_path),
|
OB_LOG(WARN, "fail to open dir", K(ret), KCSTRING(dir_path),
|
||||||
KCSTRING(strerror_r(errno, errno_buf, sizeof(errno_buf))));
|
KCSTRING(strerror_r(errno, errno_buf, sizeof(errno_buf))));
|
||||||
}
|
}
|
||||||
@ -352,7 +352,7 @@ int ObStorageFileUtil::list_files(const common::ObString &uri, common::ObBaseDir
|
|||||||
is_file = false;
|
is_file = false;
|
||||||
size = 0;
|
size = 0;
|
||||||
if (0 != ::readdir_r(open_dir, &entry, &result)) {
|
if (0 != ::readdir_r(open_dir, &entry, &result)) {
|
||||||
ret = OB_IO_ERROR;
|
convert_io_error(errno, ret);
|
||||||
OB_LOG(WARN, "read dir error", K(ret),
|
OB_LOG(WARN, "read dir error", K(ret),
|
||||||
KCSTRING(strerror_r(errno, errno_buf, sizeof(errno_buf))));
|
KCSTRING(strerror_r(errno, errno_buf, sizeof(errno_buf))));
|
||||||
} else if (NULL != result) {
|
} else if (NULL != result) {
|
||||||
@ -368,7 +368,7 @@ int ObStorageFileUtil::list_files(const common::ObString &uri, common::ObBaseDir
|
|||||||
} else {
|
} else {
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
if (-1 == ::stat(sub_dir_path, &sb)) {
|
if (-1 == ::stat(sub_dir_path, &sb)) {
|
||||||
ret = OB_IO_ERROR;
|
convert_io_error(errno, ret);
|
||||||
OB_LOG(WARN, "stat fail", K(ret),
|
OB_LOG(WARN, "stat fail", K(ret),
|
||||||
KCSTRING(strerror_r(errno, errno_buf, sizeof(errno_buf))));
|
KCSTRING(strerror_r(errno, errno_buf, sizeof(errno_buf))));
|
||||||
} else if (!S_ISREG(sb.st_mode)) {
|
} else if (!S_ISREG(sb.st_mode)) {
|
||||||
@ -425,7 +425,7 @@ int ObStorageFileUtil::list_files(const common::ObString &uri, ObStorageListCtxB
|
|||||||
if (!list_ctx.already_open_dir_) {
|
if (!list_ctx.already_open_dir_) {
|
||||||
if (OB_ISNULL(list_ctx.open_dir_ = ::opendir(dir_path))) {
|
if (OB_ISNULL(list_ctx.open_dir_ = ::opendir(dir_path))) {
|
||||||
if (ENOENT != errno) {
|
if (ENOENT != errno) {
|
||||||
ret = OB_IO_ERROR;
|
convert_io_error(errno, ret);
|
||||||
OB_LOG(WARN, "fail to open dir", K(ret), KCSTRING(dir_path),
|
OB_LOG(WARN, "fail to open dir", K(ret), KCSTRING(dir_path),
|
||||||
KCSTRING(strerror_r(errno, errno_buf, sizeof(errno_buf))));
|
KCSTRING(strerror_r(errno, errno_buf, sizeof(errno_buf))));
|
||||||
}
|
}
|
||||||
@ -445,7 +445,7 @@ int ObStorageFileUtil::list_files(const common::ObString &uri, ObStorageListCtxB
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (0 != ::readdir_r(list_ctx.open_dir_, &(list_ctx.next_entry_), &result)) {
|
if (0 != ::readdir_r(list_ctx.open_dir_, &(list_ctx.next_entry_), &result)) {
|
||||||
ret = OB_IO_ERROR;
|
convert_io_error(errno, ret);
|
||||||
OB_LOG(WARN, "read dir error", K(ret),
|
OB_LOG(WARN, "read dir error", K(ret),
|
||||||
KCSTRING(strerror_r(errno, errno_buf, sizeof(errno_buf))));
|
KCSTRING(strerror_r(errno, errno_buf, sizeof(errno_buf))));
|
||||||
} else if (NULL != result) {
|
} else if (NULL != result) {
|
||||||
@ -467,7 +467,7 @@ int ObStorageFileUtil::list_files(const common::ObString &uri, ObStorageListCtxB
|
|||||||
} else {
|
} else {
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
if (-1 == ::stat(sub_dir_path, &sb)) {
|
if (-1 == ::stat(sub_dir_path, &sb)) {
|
||||||
ret = OB_IO_ERROR;
|
convert_io_error(errno, ret);
|
||||||
OB_LOG(WARN, "stat fail", K(ret), KCSTRING(strerror_r(errno, errno_buf, sizeof(errno_buf))));
|
OB_LOG(WARN, "stat fail", K(ret), KCSTRING(strerror_r(errno, errno_buf, sizeof(errno_buf))));
|
||||||
} else if (!S_ISREG(sb.st_mode)) {
|
} else if (!S_ISREG(sb.st_mode)) {
|
||||||
// not a file
|
// not a file
|
||||||
@ -558,7 +558,7 @@ int ObStorageFileUtil::del_dir(const common::ObString &uri)
|
|||||||
STORAGE_LOG(INFO, "dir do not exist", KCSTRING(dir_path),
|
STORAGE_LOG(INFO, "dir do not exist", KCSTRING(dir_path),
|
||||||
"errono_str", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
"errono_str", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
||||||
} else {
|
} else {
|
||||||
ret = OB_IO_ERROR;
|
convert_io_error(errno, ret);
|
||||||
STORAGE_LOG(WARN, "failed to ls stat dir", K(ret),
|
STORAGE_LOG(WARN, "failed to ls stat dir", K(ret),
|
||||||
KCSTRING(dir_path), "errono_str", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
KCSTRING(dir_path), "errono_str", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
||||||
}
|
}
|
||||||
@ -567,14 +567,14 @@ int ObStorageFileUtil::del_dir(const common::ObString &uri)
|
|||||||
STORAGE_LOG(WARN, "path is not to dir", K(ret), KCSTRING(dir_path));
|
STORAGE_LOG(WARN, "path is not to dir", K(ret), KCSTRING(dir_path));
|
||||||
} else if (OB_ISNULL(open_dir = ::opendir(dir_path))) {
|
} else if (OB_ISNULL(open_dir = ::opendir(dir_path))) {
|
||||||
if (ENOENT != errno) {
|
if (ENOENT != errno) {
|
||||||
ret = OB_IO_ERROR;
|
convert_io_error(errno, ret);
|
||||||
OB_LOG(WARN, "fail to open dir", K(ret), KCSTRING(dir_path),
|
OB_LOG(WARN, "fail to open dir", K(ret), KCSTRING(dir_path),
|
||||||
KCSTRING(strerror_r(errno, errno_buf, sizeof(errno_buf))));
|
KCSTRING(strerror_r(errno, errno_buf, sizeof(errno_buf))));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
while (OB_SUCC(ret) && NULL != open_dir && 0 == dir_file_count) {
|
while (OB_SUCC(ret) && NULL != open_dir && 0 == dir_file_count) {
|
||||||
if (0 != ::readdir_r(open_dir, &entry, &result)) {
|
if (0 != ::readdir_r(open_dir, &entry, &result)) {
|
||||||
ret = OB_IO_ERROR;
|
convert_io_error(errno, ret);
|
||||||
OB_LOG(WARN, "read dir error", K(ret),
|
OB_LOG(WARN, "read dir error", K(ret),
|
||||||
KCSTRING(strerror_r(errno, errno_buf, sizeof(errno_buf))));
|
KCSTRING(strerror_r(errno, errno_buf, sizeof(errno_buf))));
|
||||||
} else if (NULL != result
|
} else if (NULL != result
|
||||||
@ -588,7 +588,7 @@ int ObStorageFileUtil::del_dir(const common::ObString &uri)
|
|||||||
}
|
}
|
||||||
if (OB_SUCC(ret) && 0 == dir_file_count) {
|
if (OB_SUCC(ret) && 0 == dir_file_count) {
|
||||||
if (0 != ::rmdir(dir_path)) {
|
if (0 != ::rmdir(dir_path)) {
|
||||||
ret = OB_IO_ERROR;
|
convert_io_error(errno, ret);
|
||||||
STORAGE_LOG(WARN, "failed to del file",
|
STORAGE_LOG(WARN, "failed to del file",
|
||||||
K(ret), KCSTRING(dir_path), "errno", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
K(ret), KCSTRING(dir_path), "errno", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
||||||
}
|
}
|
||||||
@ -623,7 +623,7 @@ int ObStorageFileUtil::list_directories(
|
|||||||
STORAGE_LOG(WARN, "failed to fill path", K(ret), K(uri));
|
STORAGE_LOG(WARN, "failed to fill path", K(ret), K(uri));
|
||||||
} else if (OB_ISNULL(open_dir = ::opendir(dir_path))) {
|
} else if (OB_ISNULL(open_dir = ::opendir(dir_path))) {
|
||||||
if (ENOENT != errno) {
|
if (ENOENT != errno) {
|
||||||
ret = OB_IO_ERROR;
|
convert_io_error(errno, ret);
|
||||||
OB_LOG(WARN, "fail to open dir", K(ret), KCSTRING(dir_path),
|
OB_LOG(WARN, "fail to open dir", K(ret), KCSTRING(dir_path),
|
||||||
KCSTRING(strerror_r(errno, errno_buf, sizeof(errno_buf))));
|
KCSTRING(strerror_r(errno, errno_buf, sizeof(errno_buf))));
|
||||||
}
|
}
|
||||||
@ -635,7 +635,7 @@ int ObStorageFileUtil::list_directories(
|
|||||||
directory_name.reset();
|
directory_name.reset();
|
||||||
is_directory = false;
|
is_directory = false;
|
||||||
if (0 != ::readdir_r(open_dir, &entry, &result)) {
|
if (0 != ::readdir_r(open_dir, &entry, &result)) {
|
||||||
ret = OB_IO_ERROR;
|
convert_io_error(errno, ret);
|
||||||
OB_LOG(WARN, "read dir error", K(ret),
|
OB_LOG(WARN, "read dir error", K(ret),
|
||||||
KCSTRING(strerror_r(errno, errno_buf, sizeof(errno_buf))));
|
KCSTRING(strerror_r(errno, errno_buf, sizeof(errno_buf))));
|
||||||
} else if (NULL != result) {
|
} else if (NULL != result) {
|
||||||
@ -652,7 +652,7 @@ int ObStorageFileUtil::list_directories(
|
|||||||
} else {
|
} else {
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
if (-1 == stat(sub_dir_path, &sb)) {
|
if (-1 == stat(sub_dir_path, &sb)) {
|
||||||
ret = OB_IO_ERROR;
|
convert_io_error(errno, ret);
|
||||||
OB_LOG(WARN, "read dir path error", K(ret),
|
OB_LOG(WARN, "read dir path error", K(ret),
|
||||||
KCSTRING(strerror_r(errno, errno_buf, sizeof(errno_buf))));
|
KCSTRING(strerror_r(errno, errno_buf, sizeof(errno_buf))));
|
||||||
} else if (!S_ISDIR(sb.st_mode)) {
|
} else if (!S_ISDIR(sb.st_mode)) {
|
||||||
@ -782,7 +782,7 @@ int ObStorageFileReader::pread(
|
|||||||
if (0 == one_read_size) {
|
if (0 == one_read_size) {
|
||||||
break;
|
break;
|
||||||
} else if (one_read_size < 0) {
|
} else if (one_read_size < 0) {
|
||||||
ret = OB_IO_ERROR;
|
convert_io_error(errno, ret);
|
||||||
STORAGE_LOG(WARN, "failed to read file",
|
STORAGE_LOG(WARN, "failed to read file",
|
||||||
K(ret), K(read_size), K(buf_size),
|
K(ret), K(read_size), K(buf_size),
|
||||||
KCSTRING(path_), K(errno), "errno", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
KCSTRING(path_), K(errno), "errno", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
||||||
@ -842,7 +842,7 @@ int ObStorageFileBaseWriter::open(const int flags)
|
|||||||
ret = OB_INVALID_ARGUMENT;
|
ret = OB_INVALID_ARGUMENT;
|
||||||
STORAGE_LOG(WARN, "invalid path", K(ret), KCSTRING(path_));
|
STORAGE_LOG(WARN, "invalid path", K(ret), KCSTRING(path_));
|
||||||
} else if (-1 == (fd_ = ::open(path_, flags, S_IRUSR | S_IWUSR))) {
|
} else if (-1 == (fd_ = ::open(path_, flags, S_IRUSR | S_IWUSR))) {
|
||||||
ret = OB_IO_ERROR;
|
convert_io_error(errno, ret);
|
||||||
STORAGE_LOG(WARN, "failed to open write file",
|
STORAGE_LOG(WARN, "failed to open write file",
|
||||||
K(ret), KCSTRING(path_), K(errno), "errno", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
K(ret), KCSTRING(path_), K(errno), "errno", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
||||||
} else {
|
} else {
|
||||||
@ -958,7 +958,7 @@ int ObStorageFileBaseWriter::close()
|
|||||||
ret = OB_NOT_INIT;
|
ret = OB_NOT_INIT;
|
||||||
STORAGE_LOG(WARN, "not opened", K(ret), K(fd_));
|
STORAGE_LOG(WARN, "not opened", K(ret), K(fd_));
|
||||||
} else if (0 != ::close(fd_)) {
|
} else if (0 != ::close(fd_)) {
|
||||||
ret = OB_IO_ERROR;
|
convert_io_error(errno, ret);
|
||||||
STORAGE_LOG(WARN, "failed to close write file",
|
STORAGE_LOG(WARN, "failed to close write file",
|
||||||
K(ret), K(fd_), KCSTRING(path_), K(errno), "errno", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
K(ret), K(fd_), KCSTRING(path_), K(errno), "errno", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
||||||
} else {
|
} else {
|
||||||
@ -1042,7 +1042,7 @@ int ObStorageFileWriter::close()
|
|||||||
K(errno), "errno", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
K(errno), "errno", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
||||||
}
|
}
|
||||||
} else if (0 != ::rename(path_, real_path_)) {
|
} else if (0 != ::rename(path_, real_path_)) {
|
||||||
ret = OB_IO_ERROR;
|
convert_io_error(errno, ret);
|
||||||
STORAGE_LOG(WARN, "failed to rename meta file",
|
STORAGE_LOG(WARN, "failed to rename meta file",
|
||||||
K(ret), KCSTRING(real_path_), KCSTRING(path_), K(errno), "errno", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
K(ret), KCSTRING(real_path_), KCSTRING(path_), K(errno), "errno", strerror_r(errno, errno_buf, sizeof(errno_buf)));
|
||||||
//rename failed ,try delete file
|
//rename failed ,try delete file
|
||||||
|
|||||||
@ -725,7 +725,7 @@ int ObStorageOssMultiPartWriter::open(const ObString &uri, common::ObObjectStora
|
|||||||
} else if (NULL == (aos_ret = oss_init_multipart_upload(oss_option_, &bucket, &object, &upload_id_,
|
} else if (NULL == (aos_ret = oss_init_multipart_upload(oss_option_, &bucket, &object, &upload_id_,
|
||||||
headers, &resp_headers))
|
headers, &resp_headers))
|
||||||
|| !aos_status_is_ok(aos_ret)) {
|
|| !aos_status_is_ok(aos_ret)) {
|
||||||
ret = OB_OSS_ERROR;
|
convert_io_error(aos_ret, ret);
|
||||||
OB_LOG(WARN, "oss init multipart upload error", K(uri), K(ret));
|
OB_LOG(WARN, "oss init multipart upload error", K(uri), K(ret));
|
||||||
print_oss_info(resp_headers, aos_ret, ret);
|
print_oss_info(resp_headers, aos_ret, ret);
|
||||||
} else {
|
} else {
|
||||||
@ -863,7 +863,7 @@ int ObStorageOssMultiPartWriter::write_single_part()
|
|||||||
&upload_id_, partnum_, &buffer, nullptr,
|
&upload_id_, partnum_, &buffer, nullptr,
|
||||||
headers, nullptr, &resp_headers, nullptr))
|
headers, nullptr, &resp_headers, nullptr))
|
||||||
|| !aos_status_is_ok(aos_ret)) {
|
|| !aos_status_is_ok(aos_ret)) {
|
||||||
ret = OB_OSS_ERROR;
|
convert_io_error(aos_ret, ret);
|
||||||
OB_LOG(WARN, "fail to upload one part from buffer",
|
OB_LOG(WARN, "fail to upload one part from buffer",
|
||||||
K_(base_buf_pos), K_(bucket), K_(object), K(ret));
|
K_(base_buf_pos), K_(bucket), K_(object), K(ret));
|
||||||
print_oss_info(resp_headers, aos_ret, ret);
|
print_oss_info(resp_headers, aos_ret, ret);
|
||||||
@ -1021,7 +1021,7 @@ int ObStorageOssMultiPartWriter::cleanup()
|
|||||||
|
|
||||||
if (OB_ISNULL(aos_ret = oss_abort_multipart_upload(oss_option_, &bucket, &object,
|
if (OB_ISNULL(aos_ret = oss_abort_multipart_upload(oss_option_, &bucket, &object,
|
||||||
&upload_id_, &resp_headers)) || !aos_status_is_ok(aos_ret)) {
|
&upload_id_, &resp_headers)) || !aos_status_is_ok(aos_ret)) {
|
||||||
ret = OB_OSS_ERROR;
|
convert_io_error(aos_ret, ret);
|
||||||
OB_LOG(WARN, "Abort the multipart error", K(bucket_), K(object_), K(ret));
|
OB_LOG(WARN, "Abort the multipart error", K(bucket_), K(object_), K(ret));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2119,7 +2119,7 @@ int ObStorageOssAppendWriter::do_write(const char *buf, const int64_t size, cons
|
|||||||
aos_list_add_tail(&content->node, &buffer);
|
aos_list_add_tail(&content->node, &buffer);
|
||||||
aos_ret = oss_append_object_from_buffer(oss_option_, &bucket, &object, position, &buffer,
|
aos_ret = oss_append_object_from_buffer(oss_option_, &bucket, &object, position, &buffer,
|
||||||
headers2, &resp_headers);
|
headers2, &resp_headers);
|
||||||
if (0 != aos_status_is_ok(aos_ret)) { // != 0 means ok
|
if (OB_NOT_NULL(aos_ret) && 0 != aos_status_is_ok(aos_ret)) { // != 0 means ok
|
||||||
file_length_ += size;
|
file_length_ += size;
|
||||||
} else {
|
} else {
|
||||||
print_oss_info(resp_headers, aos_ret, ret);
|
print_oss_info(resp_headers, aos_ret, ret);
|
||||||
|
|||||||
Reference in New Issue
Block a user