gavinchou commented on code in PR #32910:
URL: https://github.com/apache/doris/pull/32910#discussion_r1545737402
##########
be/src/cloud/cloud_storage_engine.cpp:
##########
@@ -136,9 +137,11 @@ Status CloudStorageEngine::open() {
LOG(WARNING) << "failed to get vault info, retry after 5s, err=" << st;
std::this_thread::sleep_for(5s);
- } while (true);
-
- CHECK(!vault_infos.empty()) << "no vault infos";
+ retry_time--;
+ } while (vault_infos.empty() || retry_time > 0);
Review Comment:
we should keep trying to get vault info until sucess
##########
cloud/src/meta-service/meta_service.cpp:
##########
@@ -543,20 +544,50 @@ void
MetaServiceImpl::create_tablets(::google::protobuf::RpcController* controll
if (c0 != TxnErrorCode::TXN_OK) {
code = cast_as<ErrCategory::READ>(err);
msg = fmt::format("failed to get instance, info={}", m0);
+ return;
+ }
+
+ std::string_view name = request->storage_vault_name();
+
+ // Try to use the default vault name if user doesn't specify the vault
name
+ // for correspoding table
+ if (name.empty()) {
+ if (!instance.has_default_storage_vault_name()) {
+ code = MetaServiceCode::INVALID_ARGUMENT;
+ msg = fmt::format("You must supply at least one default
vault");
+ return;
+ }
+ name = instance.default_storage_vault_name();
}
auto vault_name = std::find_if(
instance.storage_vault_names().begin(),
instance.storage_vault_names().end(),
- [&](const auto& name) { return name ==
request->storage_vault_name(); });
+ [&](const auto& candidate_name) { return candidate_name ==
name; });
if (vault_name != instance.storage_vault_names().end()) {
auto idx = vault_name - instance.storage_vault_names().begin();
response->set_storage_vault_id(instance.resource_ids().at(idx));
- } else {
- code = cast_as<ErrCategory::READ>(err);
- msg = fmt::format("failed to get vault id, vault name={}",
- request->storage_vault_name());
- return;
+ response->set_storage_vault_name(*vault_name);
+ break;
+ }
+
+ // The S3 vault would be stored inside the instance.obj_info
+ auto s3_obj = std::find_if(instance.obj_info().begin(),
instance.obj_info().end(),
+ [&](const ObjectStoreInfoPB& obj) {
+ if (!obj.has_vault_name()) {
+ return false;
+ }
+ return obj.vault_name() == name;
+ });
+
+ if (s3_obj != instance.obj_info().end()) {
+ response->set_storage_vault_id(s3_obj->id());
Review Comment:
should we also just set storage_vault_id in tablet meta?
##########
cloud/src/meta-service/meta_service_resource.cpp:
##########
@@ -399,13 +408,22 @@ void
MetaServiceImpl::alter_obj_store_info(google::protobuf::RpcController* cont
};
} break;
case AlterObjStoreInfoRequest::ADD_HDFS_INFO:
+ case AlterObjStoreInfoRequest::ADD_BUILT_IN_HDFS_INFO:
Review Comment:
the builtin storage vault can also be an object storage service (S3 or
minIO) ?
ADD_BUILT_IN_HDFS_INFO seems limited to an HDFS
CC @platoneko
--
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]