gavinchou commented on code in PR #60903:
URL: https://github.com/apache/doris/pull/60903#discussion_r2878539397
##########
be/src/util/s3_util.cpp:
##########
@@ -313,14 +313,9 @@ std::shared_ptr<io::ObjStorageClient>
S3ClientFactory::_create_azure_client(
std::make_shared<Azure::Storage::StorageSharedKeyCredential>(s3_conf.ak,
s3_conf.sk);
const std::string container_name = s3_conf.bucket;
- std::string uri;
- if (config::force_azure_blob_global_endpoint) {
- uri = fmt::format("https://{}.blob.core.windows.net/{}", s3_conf.ak,
container_name);
- } else {
- uri = fmt::format("{}/{}", s3_conf.endpoint, container_name);
- if (s3_conf.endpoint.find("://") == std::string::npos) {
- uri = "https://" + uri;
- }
+ std::string uri = fmt::format("{}/{}", s3_conf.endpoint, container_name);
Review Comment:
strip the trailing / of the URI to increase robustness
##########
cloud/src/recycler/s3_accessor.cpp:
##########
@@ -372,13 +372,9 @@ int S3Accessor::init() {
options.Retry.MaxRetries = config::max_s3_client_retry;
auto cred =
std::make_shared<Azure::Storage::StorageSharedKeyCredential>(conf_.ak,
conf_.sk);
- if (config::force_azure_blob_global_endpoint) {
- uri_ = fmt::format("https://{}.blob.core.windows.net/{}",
conf_.ak, conf_.bucket);
- } else {
- uri_ = fmt::format("{}/{}", conf_.endpoint, conf_.bucket);
- if (uri_.find("://") == std::string::npos) {
- uri_ = "https://" + uri_;
- }
+ uri_ = fmt::format("{}/{}", conf_.endpoint, conf_.bucket);
Review Comment:
ditto
##########
fe/fe-common/src/main/java/org/apache/doris/common/Config.java:
##########
@@ -3544,13 +3544,27 @@ public static int metaServiceRpcRetryTimes() {
public static int s3_head_request_max_paths = 100;
@ConfField(mutable = true, description = {
- "此参数控制是否强制使用 Azure global endpoint。默认值为 false,系统将使用用户指定的 endpoint。"
- + "如果设置为 true,系统将强制使用 {account}.blob.core.windows.net。",
- "This parameter controls whether to force the use of the Azure
global endpoint. "
- + "The default is false, meaning the system will use the
user-specified endpoint. "
- + "If set to true, the system will force the use of
{account}.blob.core.windows.net."
+ "指定 Azure endpoint 域名后缀白名单(包含 blob 与 dfs),多个值使用逗号分隔。"
+ + "默认值为 .blob.core.windows.net,.dfs.core.windows.net,"
+ + ".blob.core.chinacloudapi.cn,.dfs.core.chinacloudapi.cn,"
+ +
".blob.core.usgovcloudapi.net,.dfs.core.usgovcloudapi.net,"
+ + ".blob.core.cloudapi.de,.dfs.core.cloudapi.de。",
+ "The host suffix whitelist for Azure endpoints (both blob and
dfs), separated by commas. "
+ + "The default value is
.blob.core.windows.net,.dfs.core.windows.net,"
+ + ".blob.core.chinacloudapi.cn,.dfs.core.chinacloudapi.cn,"
+ +
".blob.core.usgovcloudapi.net,.dfs.core.usgovcloudapi.net,"
+ + ".blob.core.cloudapi.de,.dfs.core.cloudapi.de."
})
- public static boolean force_azure_blob_global_endpoint = false;
+ public static String[] azure_blob_host_suffixes = {
+ ".blob.core.windows.net",
Review Comment:
do we need to keep both
.dfs and .blob?
why not sth like just core.winodows.com?
--
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]