github-actions[bot] commented on code in PR #66350:
URL: https://github.com/apache/doris/pull/66350#discussion_r3706713448
##########
cloud/src/recycler/s3_accessor.cpp:
##########
@@ -503,29 +553,30 @@ int S3Accessor::delete_files(const
std::vector<std::string>& paths) {
keys.emplace_back(get_key(path));
}
- return obj_client_->delete_objects(conf_.bucket, std::move(keys),
{.executor = worker_pool})
- .ret;
+ return obj_client_->delete_objects({.bucket = conf_.bucket},
std::move(keys)).status.code;
}
int S3Accessor::delete_file(const std::string& path) {
LOG_INFO("delete file").tag("uri", to_uri(path));
- int ret = obj_client_->delete_object({.bucket = conf_.bucket, .key =
get_key(path)}).ret;
- static_assert(ObjectStorageResponse::OK == 0);
- if (ret == ObjectStorageResponse::OK || ret ==
ObjectStorageResponse::NOT_FOUND) {
+ int ret =
+ obj_client_->delete_object({.bucket = conf_.bucket, .key =
get_key(path)}).status.code;
+ static_assert(ObjectStorageStatus::OK == 0);
+ if (ret == ObjectStorageStatus::OK || ret ==
ObjectStorageStatus::NOT_FOUND) {
return 0;
}
return ret;
}
int S3Accessor::put_file(const std::string& path, const std::string& content) {
- return obj_client_->put_object({.bucket = conf_.bucket, .key =
get_key(path)}, content).ret;
+ return obj_client_->put_object({.bucket = conf_.bucket, .key =
get_key(path)}, content)
+ .status.code;
}
int S3Accessor::list_prefix(const std::string& path_prefix,
std::unique_ptr<ListIterator>* res) {
- size_t prefix_length = conf_.prefix.empty() ? 0 : conf_.prefix.length() +
1;
*res = std::make_unique<S3ListIterator>(
- obj_client_->list_objects({.bucket = conf_.bucket, .key =
get_key(path_prefix)}),
- prefix_length);
+ obj_client_,
Review Comment:
Anchor correction: the affected S3Accessor::exists return is the new
.resp.status.code at line 600.
##########
cloud/src/recycler/s3_accessor.cpp:
##########
@@ -567,11 +618,11 @@ int S3Accessor::abort_multipart_upload(const std::string&
path, const std::strin
}
int S3Accessor::get_life_cycle(int64_t* expiration_days) {
- return obj_client_->get_life_cycle(conf_.bucket, expiration_days).ret;
Review Comment:
Anchor correction: the value-semantic iterator is declared at line 636, and
the stale pointer-style use is at line 678.
##########
cloud/src/recycler/s3_accessor.cpp:
##########
@@ -207,18 +220,28 @@ std::optional<S3Conf> S3Conf::from_obj_store_info(const
ObjectStoreInfoPB& obj_i
s3_conf.provider = S3Conf::AZURE;
break;
default:
- LOG_WARNING("unknown provider type {}").tag("obj_info",
proto_to_json(obj_info));
+ LOG_WARNING("unknown object storage provider")
+ .tag("provider", obj_info.provider())
+ .tag("bucket", obj_info.bucket());
return std::nullopt;
}
if (!skip_aksk) {
+ if (obj_info.ak().empty() != obj_info.sk().empty()) {
+ LOG_WARNING("access key and secret key must be provided together")
+ .tag("provider", obj_info.provider())
+ .tag("bucket", obj_info.bucket());
+ return std::nullopt;
+ }
if (!obj_info.ak().empty() && !obj_info.sk().empty()) {
if (obj_info.has_encryption_info()) {
AkSkPair plain_ak_sk_pair;
int ret = decrypt_ak_sk_helper(obj_info.ak(), obj_info.sk(),
obj_info.encryption_info(),
&plain_ak_sk_pair);
if (ret != 0) {
- LOG_WARNING("fail to decrypt ak sk").tag("obj_info",
proto_to_json(obj_info));
+ LOG_WARNING("fail to decrypt ak sk")
+ .tag("provider", obj_info.provider())
+ .tag("bucket", obj_info.bucket());
return std::nullopt;
} else {
Review Comment:
Anchor correction: the newly added Recycler token read is at line 255; the
broader issue spans the FE DDL and meta-service paths named above.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]