Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cloud/src/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,6 @@ CONF_String(kerberos_ccache_path, "");
// set krb5.conf path, use "/etc/krb5.conf" by default
CONF_String(kerberos_krb5_conf_path, "/etc/krb5.conf");

CONF_mBool(enable_distinguish_hdfs_path, "true");

} // namespace doris::cloud::config
10 changes: 10 additions & 0 deletions cloud/src/meta-service/meta_service_resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
// under the License.

#include <brpc/channel.h>
Comment thread
ByteYue marked this conversation as resolved.
#include <butil/guid.h>
#include <fmt/core.h>
#include <gen_cpp/cloud.pb.h>

Expand Down Expand Up @@ -387,6 +388,15 @@ static int add_hdfs_storage_vault(InstanceInfoPB& instance, Transaction* txn,
msg = fmt::format("invalid prefix: ", *prefix);
return -1;
}
if (config::enable_distinguish_hdfs_path) {
auto uuid_suffix = butil::GenerateGUID();
if (uuid_suffix.empty()) [[unlikely]] {
code = MetaServiceCode::UNDEFINED_ERR;
msg = fmt::format("failed to generate one suffix for hdfs prefix");
return -1;
}
*prefix = fmt::format("{}_{}", *prefix, uuid_suffix);
}

auto* fs_name = hdfs_param.mutable_hdfs_info()->mutable_build_conf()->mutable_fs_name();
if (!normalize_hdfs_fs_name(*fs_name)) {
Expand Down