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

curvefs/client: Clarify val #2059

Merged
merged 5 commits into from
Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from 3 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
31 changes: 16 additions & 15 deletions curvefs/conf/client.conf
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ spaceserver.rpcTimeoutMs=1000

#### bdev
# curve client's config file
bdev.confpath=/etc/curve/client.conf
bdev.confPath=/etc/curve/client.conf

#### extentManager
extentManager.preAllocSize=65536
Expand All @@ -86,12 +86,12 @@ fuseClient.dCacheLruSize=1000000
fuseClient.enableICacheMetrics=true
fuseClient.enableDCacheMetrics=true
fuseClient.cto=true
# you shoudle enable it when mount one filesystem to multi mountpoints,
# it gurantee the consistent of file after rename, otherwise you should
# you should enable it when mount one filesystem to multi mount points,
# it guarantee the consistent of file after rename, otherwise you should
# disable it for performance.
fuseClient.enableMultiMountPointRename=true
# splice will bring higher performance in some cases
# but there're might be a kernel issue that will cause kernel panic when enabling it
# but there might be a kernel issue that will cause kernel panic when enabling it
# see https://lore.kernel.org/all/CAAmZXrsGg2xsP1CK+cbuEMumtrqdvD-NKnWzhNcvn71RV3c1yw@mail.gmail.com/
# until this issue has been fixed, splice should be disabled
fuseClient.enableSplice=false
Expand All @@ -109,39 +109,38 @@ volume.bigFileSize=1048576
volume.volBlockSize=4096
volume.fsBlockSize=4096

# alloator type, supported {bitmap}
# allocator type, supported {bitmap}
volume.allocator.type=bitmap

## for bitmap allocator
# size of each bit, default is 4MiB
volume.bitmapallocator.size_per_bit=4194304
volume.bitmapAllocator.size_per_bit=4194304

# small allocation proportion [0-1]
volume.bitmapallocator.small_alloc_proportion=0.2
volume.bitmapAllocator.small_alloc_proportion=0.2
shentupenghui marked this conversation as resolved.
Show resolved Hide resolved

# number of block groups that allocated once
volume.blockgroup.allocate_once=4
volume.blockGroup.allocate_once=4

#### s3
# this is for test. if s3.fakeS3=true, all data will be discarded
s3.fakeS3=false
# the max size that fuse send
s3.fuseMaxSize=131072
s3.pagesize=65536
s3.pageSize=65536
# prefetch blocks that disk cache use
s3.prefetchBlocks=1
# prefetch threads
s3.prefetchExecQueueNum=1
# start sleep when mem cache use ratio is greater than nearfullRatio,
# sleep time increase follow with mem cache use raito, baseSleepUs is baseline.
# sleep time increase follow with mem cache use ratio, baseSleepUs is baseline.
s3.nearfullRatio=70
s3.baseSleepUs=500

# TODO(huyao): use more meaningfull name
# background thread schedule time
s3.intervalSec=3
s3.threadScheduleInterval=3
# data cache flush wait time
s3.flushIntervalSec=5
s3.cacheFlushIntervalSec=5
s3.writeCacheMaxByte=838860800
s3.readCacheMaxByte=209715200
# http = 0, https = 1
Expand Down Expand Up @@ -173,7 +172,9 @@ s3.maxReadRetryIntervalMs = 1000
s3.readRetryIntervalMs = 100
# TODO(hongsong): limit bytes、iops/bps
#### disk cache options
# 0:not enable disk cache 1:onlyread 2:read/write
# 0:not enable disk cache
# 1:readonly
# 2:read/write
diskCache.diskCacheType=2 # __ANSIBLE_TEMPLATE__ {{ client_disk_cache_type | default('2') }} __ANSIBLE_TEMPLATE__
# the file system writes files use flush or not
diskCache.forceFlush=true
Expand Down Expand Up @@ -213,4 +214,4 @@ client.common.logDir=/data/logs/curvefs # __CURVEADM_TEMPLATE__ /curvefs/client
# we have loglevel: {0,3,6,9}
# as the number increases, it becomes more and more detailed
client.loglevel=0
client.dummyserver.startport=9000
client.dummyServer.startPort=9000
14 changes: 7 additions & 7 deletions curvefs/src/client/common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void InitExcutorOption(Configuration *conf, ExcutorOpt *opts, bool internal) {

void InitBlockDeviceOption(Configuration *conf,
BlockDeviceClientOptions *bdevOpt) {
conf->GetValueFatalIfFail("bdev.confpath", &bdevOpt->configPath);
conf->GetValueFatalIfFail("bdev.confPath", &bdevOpt->configPath);
}

void InitDiskCacheOption(Configuration *conf,
Expand Down Expand Up @@ -158,15 +158,15 @@ void InitS3Option(Configuration *conf, S3Option *s3Opt) {
conf->GetValueFatalIfFail("s3.fakeS3", &FLAGS_useFakeS3);
conf->GetValueFatalIfFail("s3.fuseMaxSize",
&s3Opt->s3ClientAdaptorOpt.fuseMaxSize);
conf->GetValueFatalIfFail("s3.pagesize",
conf->GetValueFatalIfFail("s3.pageSize",
&s3Opt->s3ClientAdaptorOpt.pageSize);
conf->GetValueFatalIfFail("s3.prefetchBlocks",
&s3Opt->s3ClientAdaptorOpt.prefetchBlocks);
conf->GetValueFatalIfFail("s3.prefetchExecQueueNum",
&s3Opt->s3ClientAdaptorOpt.prefetchExecQueueNum);
conf->GetValueFatalIfFail("s3.intervalSec",
conf->GetValueFatalIfFail("s3.threadScheduleInterval",
&s3Opt->s3ClientAdaptorOpt.intervalSec);
conf->GetValueFatalIfFail("s3.flushIntervalSec",
conf->GetValueFatalIfFail("s3.cacheFlushIntervalSec",
&s3Opt->s3ClientAdaptorOpt.flushIntervalSec);
conf->GetValueFatalIfFail("s3.chunkFlushThreads",
&s3Opt->s3ClientAdaptorOpt.chunkFlushThreads);
Expand Down Expand Up @@ -196,12 +196,12 @@ void InitVolumeOption(Configuration *conf, VolumeOption *volumeOpt) {
&volumeOpt->allocatorOption.type);

conf->GetValueFatalIfFail(
"volume.blockgroup.allocate_once",
"volume.blockGroup.allocate_once",
&volumeOpt->allocatorOption.blockGroupOption.allocateOnce);

if (volumeOpt->allocatorOption.type == "bitmap") {
conf->GetValueFatalIfFail(
"volume.bitmapallocator.size_per_bit",
"volume.bitmapAllocator.size_per_bit",
shentupenghui marked this conversation as resolved.
Show resolved Hide resolved
&volumeOpt->allocatorOption.bitmapAllocatorOption.sizePerBit);
conf->GetValueFatalIfFail(
"volume.bitmapallocator.small_alloc_proportion",
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor

Choose a reason for hiding this comment

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

conf->GetValueFatalIfFail(
"volume.bitmapallocator.small_alloc_proportion",

Copy link
Contributor Author

Choose a reason for hiding this comment

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

im sry for missing one unchanged

Copy link
Contributor Author

Choose a reason for hiding this comment

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

conf->GetValueFatalIfFail( "volume.bitmapallocator.small_alloc_proportion",

done

Copy link
Contributor

Choose a reason for hiding this comment

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

good job, lets us wait the ci finished

Copy link
Contributor Author

Choose a reason for hiding this comment

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

CI still running, is there some failure occured?

Copy link
Contributor

Choose a reason for hiding this comment

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

CI still running, is there some failure occured?

http://59.111.91.248:8080/job/opencurve_multijob/6935/

as you can see, there is running the failover test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the failover test log shows:

------------------------------------------------------------------------------
test loop mount umount                                                | FAIL |
mount/umount error
------------------------------------------------------------------------------

Expand Down Expand Up @@ -272,7 +272,7 @@ void InitFuseClientOption(Configuration *conf, FuseClientOption *clientOption) {
&clientOption->enableICacheMetrics);
conf->GetValueFatalIfFail("fuseClient.enableDCacheMetrics",
&clientOption->enableDCacheMetrics);
conf->GetValueFatalIfFail("client.dummyserver.startport",
conf->GetValueFatalIfFail("client.dummyServer.startPort",
&clientOption->dummyServerStartPort);
conf->GetValueFatalIfFail("fuseClient.enableMultiMountPointRename",
&clientOption->enableMultiMountPointRename);
Expand Down
12 changes: 6 additions & 6 deletions curvefs/test/client/common/test_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ TEST(TestInitVolumeOption, Common) {
conf.SetUInt64Value("volume.bigFileSize", 1ULL * 1024 * 1024);
conf.SetUInt64Value("volume.volBlockSize", 4096);
conf.SetUInt64Value("volume.fsBlockSize", 4096);
conf.SetUInt32Value("volume.blockgroup.allocate_once", 4);
conf.SetUInt32Value("volume.blockGroup.allocate_once", 4);
shentupenghui marked this conversation as resolved.
Show resolved Hide resolved
conf.SetStringValue("volume.allocator.type", "bitmap");
conf.SetUInt64Value("volume.bitmapallocator.size_per_bit",
conf.SetUInt64Value("volume.bitmapAllocator.size_per_bit",
shentupenghui marked this conversation as resolved.
Show resolved Hide resolved
4ULL * 1024 * 1024);
conf.SetDoubleValue("volume.bitmapallocator.small_alloc_proportion", 0.0);
conf.SetDoubleValue("volume.bitmapAllocator.small_alloc_proportion", 0.0);
shentupenghui marked this conversation as resolved.
Show resolved Hide resolved

ASSERT_NO_FATAL_FAILURE({ InitVolumeOption(&conf, &volopt); });
}
Expand All @@ -55,11 +55,11 @@ TEST(TestInitVolumeOption, TypeError) {
conf.SetUInt64Value("volume.bigFileSize", 1ULL * 1024 * 1024);
conf.SetUInt64Value("volume.volBlockSize", 4096);
conf.SetUInt64Value("volume.fsBlockSize", 4096);
conf.SetUInt32Value("volume.blockgroup.allocate_once", 4);
conf.SetUInt32Value("volume.blockGroup.allocate_once", 4);
shentupenghui marked this conversation as resolved.
Show resolved Hide resolved
conf.SetStringValue("volume.allocator.type", "xxx");
conf.SetUInt64Value("volume.bitmapallocator.size_per_bit",
conf.SetUInt64Value("volume.bitmapAllocator.size_per_bit",
shentupenghui marked this conversation as resolved.
Show resolved Hide resolved
4ULL * 1024 * 1024);
conf.SetDoubleValue("volume.bitmapallocator.small_alloc_proportion", 0.0);
conf.SetDoubleValue("volume.bitmapAllocator.small_alloc_proportion", 0.0);
shentupenghui marked this conversation as resolved.
Show resolved Hide resolved

ASSERT_DEATH({ InitVolumeOption(&conf, &volopt); }, "");
}
Expand Down