Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add s3.useVirtualAddressing config #1253

Merged
merged 1 commit into from
Apr 12, 2022
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
1 change: 1 addition & 0 deletions conf/s3.conf
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ s3.throttle.iopsWriteLimit=5000
s3.throttle.bpsTotalMB=1280
s3.throttle.bpsReadMB=1280
s3.throttle.bpsWriteMB=1280
s3.useVirtualAddressing=false
1 change: 1 addition & 0 deletions curvefs/conf/client.conf
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ s3.throttle.iopsWriteLimit=0
s3.throttle.bpsTotalMB=0
s3.throttle.bpsReadMB=0
s3.throttle.bpsWriteMB=0
s3.useVirtualAddressing=false

# TODO(hongsong): limit bytes、iops/bps
#### disk cache options
Expand Down
1 change: 1 addition & 0 deletions curvefs/conf/mds.conf
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,4 @@ s3.throttle.iopsWriteLimit=0
s3.throttle.bpsTotalMB=0
s3.throttle.bpsReadMB=0
s3.throttle.bpsWriteMB=0
s3.useVirtualAddressing=false
1 change: 1 addition & 0 deletions curvefs/conf/metaserver.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ s3.throttle.iopsWriteLimit=0
s3.throttle.bpsTotalMB=0
s3.throttle.bpsReadMB=0
s3.throttle.bpsWriteMB=0
s3.useVirtualAddressing=false
# s3 workqueue
s3compactwq.enable=True
s3compactwq.thread_num=2
Expand Down
1 change: 1 addition & 0 deletions curvefs/conf/tools.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ s3.endpoint=endpoint
s3.bucket_name=bucket
s3.blocksize=4194304
s3.chunksize=67108864
s3.useVirtualAddressing=false
# statistic info in xattr, hardlink will not be supported when enable
enableSumInDir=true
36 changes: 4 additions & 32 deletions src/common/s3_adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,41 +69,11 @@ Aws::String GetObjectRequestRange(uint64_t offset, uint64_t len) {
} // namespace

void InitS3AdaptorOption(Configuration* conf, S3AdapterOption* s3Opt) {
LOG_IF(FATAL, !conf->GetIntValue("s3.loglevel", &s3Opt->loglevel));
LOG_IF(FATAL, !conf->GetStringValue("s3.logPrefix", &s3Opt->logPrefix));
InitS3AdaptorOptionExceptS3InfoOption(conf, s3Opt);
LOG_IF(FATAL, !conf->GetStringValue("s3.endpoint", &s3Opt->s3Address));
LOG_IF(FATAL, !conf->GetStringValue("s3.ak", &s3Opt->ak));
LOG_IF(FATAL, !conf->GetStringValue("s3.sk", &s3Opt->sk));
LOG_IF(FATAL, !conf->GetStringValue("s3.bucket_name", &s3Opt->bucketName));
LOG_IF(FATAL, !conf->GetIntValue("s3.http_scheme", &s3Opt->scheme));
LOG_IF(FATAL, !conf->GetBoolValue("s3.verify_SSL", &s3Opt->verifySsl));
LOG_IF(FATAL,
!conf->GetIntValue("s3.max_connections", &s3Opt->maxConnections));
LOG_IF(FATAL,
!conf->GetIntValue("s3.connect_timeout", &s3Opt->connectTimeout));
LOG_IF(FATAL,
!conf->GetIntValue("s3.request_timeout", &s3Opt->requestTimeout));
LOG_IF(FATAL,
!conf->GetIntValue("s3.async_thread_num", &s3Opt->asyncThreadNum));
LOG_IF(FATAL, !conf->GetUInt64Value("s3.throttle.iopsTotalLimit",
&s3Opt->iopsTotalLimit));
LOG_IF(FATAL, !conf->GetUInt64Value("s3.throttle.iopsReadLimit",
&s3Opt->iopsReadLimit));
LOG_IF(FATAL, !conf->GetUInt64Value("s3.throttle.iopsWriteLimit",
&s3Opt->iopsWriteLimit));
LOG_IF(FATAL,
!conf->GetUInt64Value("s3.throttle.bpsTotalMB", &s3Opt->bpsTotalMB));
LOG_IF(FATAL,
!conf->GetUInt64Value("s3.throttle.bpsReadMB", &s3Opt->bpsReadMB));
LOG_IF(FATAL,
!conf->GetUInt64Value("s3.throttle.bpsWriteMB", &s3Opt->bpsWriteMB));

if (!conf->GetUInt64Value("s3.max_async_request_inflight_bytes",
&s3Opt->maxAsyncRequestInflightBytes)) {
LOG(WARNING)
<< "Not found s3.max_async_request_inflight_bytes in conf ";
s3Opt->maxAsyncRequestInflightBytes = 0;
}
}

void InitS3AdaptorOptionExceptS3InfoOption(Configuration* conf,
Expand Down Expand Up @@ -132,6 +102,8 @@ void InitS3AdaptorOptionExceptS3InfoOption(Configuration* conf,
&s3Opt->bpsReadMB));
LOG_IF(FATAL, !conf->GetUInt64Value("s3.throttle.bpsWriteMB",
&s3Opt->bpsWriteMB));
LOG_IF(FATAL, !conf->GetBoolValue("s3.useVirtualAddressing",
&s3Opt->useVirtualAddressing));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also need add this config in func InitS3AdaptorOption?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InitS3AdaptorOption will reuse InitS3AdaptorOptionExceptS3InfoOption


if (!conf->GetUInt64Value("s3.max_async_request_inflight_bytes",
&s3Opt->maxAsyncRequestInflightBytes)) {
Expand Down Expand Up @@ -191,7 +163,7 @@ void S3Adapter::Init(const S3AdapterOption &option) {
Aws::Auth::AWSCredentials(s3Ak_, s3Sk_),
*clientCfg_,
Aws::Client::AWSAuthV4Signer::PayloadSigningPolicy::Never,
false);
option.useVirtualAddressing);

ReadWriteThrottleParams params;
params.iopsTotal.limit = option.iopsTotalLimit;
Expand Down
1 change: 1 addition & 0 deletions src/common/s3_adapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ struct S3AdapterOption {
uint64_t bpsTotalMB;
uint64_t bpsReadMB;
uint64_t bpsWriteMB;
bool useVirtualAddressing;
};

struct S3InfoOption {
Expand Down