Skip to content

Commit

Permalink
3
Browse files Browse the repository at this point in the history
  • Loading branch information
Yukang-Lian committed Feb 12, 2025
1 parent 66d7771 commit 33e03ad
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
2 changes: 1 addition & 1 deletion cloud/src/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,5 +252,5 @@ CONF_Bool(enable_check_instance_id, "true");

// Check if ip eq 127.0.0.1, ms/recycler exit
CONF_Bool(enable_loopback_address_for_ms, "false");
CONF_Strings(valid_s3_vault_endpoints, "");
CONF_Strings(valid_vault_name_set, "");
} // namespace doris::cloud::config
36 changes: 17 additions & 19 deletions cloud/src/recycler/recycler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,23 @@ int InstanceRecycler::init_storage_vault_accessors() {
}
TEST_SYNC_POINT_CALLBACK("InstanceRecycler::init_storage_vault_accessors.mock_vault",
&accessor_map_, &vault);

if (!config::valid_vault_name_set.empty()) {
if (auto it = std::find(config::valid_vault_name_set.begin(),
config::valid_vault_name_set.end(), vault.name());
it == config::valid_vault_name_set.end()) {
std::string valid_vault_name_set = accumulate(
config::valid_vault_name_set.begin(), config::valid_vault_name_set.end(),
std::string(), [](std::string a, std::string b) {
return a + (a.empty() ? "" : ",") + b;
});
LOG_WARNING(
"failed to init accessor for vault because this vault is not in "
"config::valid_vault_name_set. ")
.tag(" vault name:", vault.name())
.tag(" config::valid_vault_name_set:", valid_vault_name_set);
continue;
}
}
if (vault.has_hdfs_info()) {
auto accessor = std::make_shared<HdfsAccessor>(vault.hdfs_info());
int ret = accessor->init();
Expand Down Expand Up @@ -568,24 +584,6 @@ int InstanceRecycler::init_storage_vault_accessors() {
<< " s3_vault=" << encryt_sk(vault.obj_info().ShortDebugString());
continue;
}
if (!config::valid_s3_vault_endpoints.empty()) {
if (auto it = std::find(config::valid_s3_vault_endpoints.begin(),
config::valid_s3_vault_endpoints.end(), s3_conf->endpoint);
it == config::valid_s3_vault_endpoints.end()) {
std::string valid_s3_vault_endpoints =
accumulate(config::valid_s3_vault_endpoints.begin(),
config::valid_s3_vault_endpoints.end(), std::string(),
[](std::string a, std::string b) {
return a + (a.empty() ? "" : " ") + b;
});
LOG_WARNING(
"failed to init s3 accessor because the endpoint is not in "
"config::valid_s3_vault_endpoints!")
.tag("[s3 accessor end point]:", s3_conf->endpoint)
.tag("[config::valid_s3_vault_endpoints]:", valid_s3_vault_endpoints);
continue;
}
}
LOG(INFO) << "succeed to init s3 accessor. instance_id=" << instance_id_
<< " resource_id=" << vault.id() << " name=" << vault.name() << " ret=" << ret
<< " s3_vault=" << encryt_sk(vault.obj_info().ShortDebugString());
Expand Down

0 comments on commit 33e03ad

Please sign in to comment.