Skip to content

Commit f3c04e3

Browse files
committed
change crc config to ture
- fix the coding style of cpp - align the config file with the paramtable code Signed-off-by: yangxuan <xuan.yang@zilliz.com>
1 parent 7a9bf25 commit f3c04e3

6 files changed

Lines changed: 12 additions & 18 deletions

File tree

configs/milvus.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ minio:
124124
# We recommend using version 1.2 and above.
125125
tlsMinVersion: default
126126
# Whether to use CRC32C checksum for data integrity validation on MinIO/S3 PutObject requests.
127-
useCRC32C: false
127+
useCRC32C: true
128128
# Name of the bucket where Milvus stores data in MinIO or S3.
129129
# Milvus 2.0.0 does not support storing data in multiple buckets.
130130
# Bucket with this name will be created if it does not exist. If the bucket already exists and is accessible, it will be used directly. Otherwise, there will be an error.

internal/core/src/storage/ChunkManager.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ AwsChunkManager::AwsChunkManager(const StorageConfig& storage_config) {
8282
remote_root_path_ = storage_config.root_path;
8383
use_crc32c_checksum_ = storage_config.use_crc32c_checksum;
8484

85-
InitSDKAPIDefault(storage_config.log_level,
86-
storage_config.tls_min_version);
85+
InitSDKAPIDefault(storage_config.log_level, storage_config.tls_min_version);
8786

8887
Aws::Client::ClientConfiguration config = generateConfig(storage_config);
8988
if (storage_config.useIAM) {
@@ -136,8 +135,7 @@ GcpChunkManager::GcpChunkManager(const StorageConfig& storage_config) {
136135
};
137136
}
138137

139-
InitSDKAPIDefault(storage_config.log_level,
140-
storage_config.tls_min_version);
138+
InitSDKAPIDefault(storage_config.log_level, storage_config.tls_min_version);
141139

142140
Aws::Client::ClientConfiguration config = generateConfig(storage_config);
143141
if (storage_config.useIAM) {
@@ -170,8 +168,7 @@ AliyunChunkManager::AliyunChunkManager(const StorageConfig& storage_config) {
170168
remote_root_path_ = storage_config.root_path;
171169
use_crc32c_checksum_ = storage_config.use_crc32c_checksum;
172170

173-
InitSDKAPIDefault(storage_config.log_level,
174-
storage_config.tls_min_version);
171+
InitSDKAPIDefault(storage_config.log_level, storage_config.tls_min_version);
175172

176173
Aws::Client::ClientConfiguration config = generateConfig(storage_config);
177174

@@ -218,8 +215,7 @@ TencentCloudChunkManager::TencentCloudChunkManager(
218215
remote_root_path_ = storage_config.root_path;
219216
use_crc32c_checksum_ = storage_config.use_crc32c_checksum;
220217

221-
InitSDKAPIDefault(storage_config.log_level,
222-
storage_config.tls_min_version);
218+
InitSDKAPIDefault(storage_config.log_level, storage_config.tls_min_version);
223219

224220
Aws::Client::ClientConfiguration config = generateConfig(storage_config);
225221

@@ -265,8 +261,7 @@ HuaweiCloudChunkManager::HuaweiCloudChunkManager(
265261
default_bucket_name_ = storage_config.bucket_name;
266262
remote_root_path_ = storage_config.root_path;
267263
use_crc32c_checksum_ = storage_config.use_crc32c_checksum;
268-
InitSDKAPIDefault(storage_config.log_level,
269-
storage_config.tls_min_version);
264+
InitSDKAPIDefault(storage_config.log_level, storage_config.tls_min_version);
270265
Aws::Client::ClientConfiguration config = generateConfig(storage_config);
271266
StorageConfig mutable_config = storage_config;
272267
mutable_config.useVirtualHost = true;

internal/core/src/storage/MinioChunkManager.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,8 +607,7 @@ MinioChunkManager::PutObjectBuffer(const std::string& bucket_name,
607607
request.SetBucket(bucket_name.c_str());
608608
request.SetKey(object_name.c_str());
609609
if (use_crc32c_checksum_) {
610-
request.SetChecksumAlgorithm(
611-
Aws::S3::Model::ChecksumAlgorithm::CRC32C);
610+
request.SetChecksumAlgorithm(Aws::S3::Model::ChecksumAlgorithm::CRC32C);
612611
}
613612

614613
const std::shared_ptr<Aws::IOStream> input_data =

internal/core/src/storage/MinioChunkManager.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,8 @@ class TlsHttpClientFactory : public Aws::Http::HttpClientFactory {
353353
}
354354

355355
std::shared_ptr<Aws::Http::HttpClient>
356-
CreateHttpClient(const Aws::Client::ClientConfiguration& config)
357-
const override {
356+
CreateHttpClient(
357+
const Aws::Client::ClientConfiguration& config) const override {
358358
return Aws::MakeShared<TlsCurlHttpClient>(
359359
TLS_FACTORY_ALLOCATION_TAG, config, tls_min_version_);
360360
}

internal/core/src/storage/Types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ struct StorageConfig {
123123
<< ", maxConnections=" << max_connections
124124
<< ", gcp_native_without_auth=" << std::boolalpha
125125
<< gcp_native_without_auth << ", tls_min_version=" << tls_min_version
126-
<< ", use_crc32c_checksum=" << std::boolalpha
127-
<< use_crc32c_checksum << "]";
126+
<< ", use_crc32c_checksum=" << std::boolalpha << use_crc32c_checksum
127+
<< "]";
128128

129129
return ss.str();
130130
}

pkg/util/paramtable/service_param.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1630,7 +1630,7 @@ Leave it empty if you want to use AWS default endpoint`,
16301630
p.UseCRC32C = ParamItem{
16311631
Key: "minio.ssl.useCRC32C",
16321632
Version: "2.6.11",
1633-
DefaultValue: "false",
1633+
DefaultValue: "true",
16341634
Doc: "Whether to use CRC32C checksum for data integrity validation on MinIO/S3 PutObject requests.",
16351635
Export: true,
16361636
}

0 commit comments

Comments
 (0)