From 8d3069b1dbb00c7f5f262d1133e9b2ed68869eae Mon Sep 17 00:00:00 2001 From: PowderLi <135960789+PowderLi@users.noreply.github.com> Date: Sun, 8 Oct 2023 19:17:31 +0800 Subject: [PATCH] update openssl to 3.1.2 (#27399) deal with root path's normalization Signed-off-by: PowderLi --- Makefile | 1 - internal/core/conanfile.py | 2 +- internal/core/src/storage/AzureChunkManager.cpp | 2 +- internal/core/src/storage/ChunkManagers.cpp | 12 +++++++++--- internal/core/src/storage/MinioChunkManager.cpp | 5 +++-- .../azure-blob-storage/AzureBlobChunkManager.cpp | 2 +- pkg/util/paramtable/service_param.go | 11 +++++++++-- 7 files changed, 24 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index acf6b673be9f1..f578eea8710ed 100644 --- a/Makefile +++ b/Makefile @@ -49,7 +49,6 @@ index_engine = knowhere export GIT_BRANCH=master -ENABLE_AZURE = false AZURE_OPTION := "" ifeq (${ENABLE_AZURE}, false) AZURE_OPTION := -Z diff --git a/internal/core/conanfile.py b/internal/core/conanfile.py index bf288b89137bc..fb1cdbc9e276d 100644 --- a/internal/core/conanfile.py +++ b/internal/core/conanfile.py @@ -13,7 +13,7 @@ class MilvusConan(ConanFile): "snappy/1.1.9", "lzo/2.10", "arrow/11.0.0", - "openssl/1.1.1q", + "openssl/3.1.2", "s2n/1.3.31@milvus/dev", "aws-c-common/0.8.2@milvus/dev", "aws-c-compression/0.2.15@milvus/dev", diff --git a/internal/core/src/storage/AzureChunkManager.cpp b/internal/core/src/storage/AzureChunkManager.cpp index dcb33bd77ae22..ff100f32734ae 100644 --- a/internal/core/src/storage/AzureChunkManager.cpp +++ b/internal/core/src/storage/AzureChunkManager.cpp @@ -59,7 +59,7 @@ uint64_t AzureChunkManager::Read(const std::string& filepath, void* buf, uint64_t size) { if (!ObjectExists(default_bucket_name_, filepath)) { std::stringstream err_msg; - err_msg << "object('" << default_bucket_name_ << "', " << filepath + err_msg << "object('" << default_bucket_name_ << "', '" << filepath << "') not exists"; throw SegcoreError(ObjectNotExist, err_msg.str()); } diff --git a/internal/core/src/storage/ChunkManagers.cpp b/internal/core/src/storage/ChunkManagers.cpp index b6f844f1a3d44..57562964ae5eb 100644 --- a/internal/core/src/storage/ChunkManagers.cpp +++ b/internal/core/src/storage/ChunkManagers.cpp @@ -66,6 +66,7 @@ generateConfig(const StorageConfig& storage_config) { AwsChunkManager::AwsChunkManager(const StorageConfig& storage_config) { default_bucket_name_ = storage_config.bucket_name; + remote_root_path_ = storage_config.root_path; InitSDKAPIDefault(storage_config.log_level); @@ -92,12 +93,14 @@ AwsChunkManager::AwsChunkManager(const StorageConfig& storage_config) { LOG_SEGCORE_INFO_ << "init AwsChunkManager with parameter[endpoint: '" << storage_config.address << "', default_bucket_name:'" - << storage_config.bucket_name << "', use_secure:'" + << storage_config.bucket_name << "', root_path:'" + << storage_config.root_path << "', use_secure:'" << std::boolalpha << storage_config.useSSL << "']"; } GcpChunkManager::GcpChunkManager(const StorageConfig& storage_config) { default_bucket_name_ = storage_config.bucket_name; + remote_root_path_ = storage_config.root_path; if (storage_config.useIAM) { sdk_options_.httpOptions.httpClientFactory_create_fn = []() { @@ -124,12 +127,14 @@ GcpChunkManager::GcpChunkManager(const StorageConfig& storage_config) { LOG_SEGCORE_INFO_ << "init GcpChunkManager with parameter[endpoint: '" << storage_config.address << "', default_bucket_name:'" - << storage_config.bucket_name << "', use_secure:'" + << storage_config.bucket_name << "', root_path:'" + << storage_config.root_path << "', use_secure:'" << std::boolalpha << storage_config.useSSL << "']"; } AliyunChunkManager::AliyunChunkManager(const StorageConfig& storage_config) { default_bucket_name_ = storage_config.bucket_name; + remote_root_path_ = storage_config.root_path; InitSDKAPIDefault(storage_config.log_level); @@ -156,7 +161,8 @@ AliyunChunkManager::AliyunChunkManager(const StorageConfig& storage_config) { LOG_SEGCORE_INFO_ << "init AliyunChunkManager with parameter[endpoint: '" << storage_config.address << "', default_bucket_name:'" - << storage_config.bucket_name << "', use_secure:'" + << storage_config.bucket_name << "', root_path:'" + << storage_config.root_path << "', use_secure:'" << std::boolalpha << storage_config.useSSL << "']"; } diff --git a/internal/core/src/storage/MinioChunkManager.cpp b/internal/core/src/storage/MinioChunkManager.cpp index 2be1cbd80e758..13170ea1f9c33 100644 --- a/internal/core/src/storage/MinioChunkManager.cpp +++ b/internal/core/src/storage/MinioChunkManager.cpp @@ -327,7 +327,8 @@ MinioChunkManager::MinioChunkManager(const StorageConfig& storage_config) LOG_SEGCORE_INFO_ << "init MinioChunkManager with parameter[endpoint: '" << storage_config.address << "', default_bucket_name:'" - << storage_config.bucket_name << "', use_secure:'" + << storage_config.bucket_name << "', root_path:'" + << storage_config.root_path << "', use_secure:'" << std::boolalpha << storage_config.useSSL << "']"; } @@ -360,7 +361,7 @@ uint64_t MinioChunkManager::Read(const std::string& filepath, void* buf, uint64_t size) { if (!ObjectExists(default_bucket_name_, filepath)) { std::stringstream err_msg; - err_msg << "object('" << default_bucket_name_ << "', " << filepath + err_msg << "object('" << default_bucket_name_ << "', '" << filepath << "') not exists"; throw SegcoreError(ObjectNotExist, err_msg.str()); } diff --git a/internal/core/src/storage/azure-blob-storage/AzureBlobChunkManager.cpp b/internal/core/src/storage/azure-blob-storage/AzureBlobChunkManager.cpp index f29120de04d5a..10b6ef1da32b7 100644 --- a/internal/core/src/storage/azure-blob-storage/AzureBlobChunkManager.cpp +++ b/internal/core/src/storage/azure-blob-storage/AzureBlobChunkManager.cpp @@ -139,7 +139,7 @@ AzureBlobChunkManager::GetObjectSize(const std::string& bucket_name, } } std::stringstream err_msg; - err_msg << "object('" << bucket_name << "', " << object_name + err_msg << "object('" << bucket_name << "', '" << object_name << "') not exists"; throw std::runtime_error(err_msg.str()); } diff --git a/pkg/util/paramtable/service_param.go b/pkg/util/paramtable/service_param.go index 5953a713893b7..72ab8ef1d1916 100644 --- a/pkg/util/paramtable/service_param.go +++ b/pkg/util/paramtable/service_param.go @@ -1017,8 +1017,15 @@ func (p *MinioConfig) Init(base *BaseTable) { p.BucketName.Init(base.mgr) p.RootPath = ParamItem{ - Key: "minio.rootPath", - Version: "2.0.0", + Key: "minio.rootPath", + Version: "2.0.0", + Formatter: func(rootPath string) string { + if rootPath == "" { + return "" + } + rootPath = strings.TrimLeft(rootPath, "/") + return path.Clean(rootPath) + }, PanicIfEmpty: false, Doc: "The root path where the message is stored in MinIO/S3", Export: true,