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 startup parameters for chunkserver #314

Merged
merged 1 commit into from
Oct 28, 2023
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
6 changes: 6 additions & 0 deletions internal/configure/topology/dc_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ func (dc *DeployConfig) GetListenDummyPort() int { return dc.getInt(CONFIG_L
func (dc *DeployConfig) GetListenProxyPort() int { return dc.getInt(CONFIG_LISTEN_PROXY_PORT) }
func (dc *DeployConfig) GetListenExternalIp() string { return dc.getString(CONFIG_LISTEN_EXTERNAL_IP) }
func (dc *DeployConfig) GetCopysets() int { return dc.getInt(CONFIG_COPYSETS) }
func (dc *DeployConfig) GetChunkFilePoolAllocatedPercent() int {
return dc.getInt(CONFIG_CHUNK_FILE_POOL_ALLOCATED_PERCENT)
}
func (dc *DeployConfig) GetChunkFormatThreadNum() int {
return dc.getInt(CONFIG_CHUNK_FORMAT_THREAD_NUM)
}
func (dc *DeployConfig) GetS3AccessKey() string { return dc.getString(CONFIG_S3_ACCESS_KEY) }
func (dc *DeployConfig) GetS3SecretKey() string { return dc.getString(CONFIG_S3_SECRET_KEY) }
func (dc *DeployConfig) GetS3Address() string { return dc.getString(CONFIG_S3_ADDRESS) }
Expand Down
14 changes: 14 additions & 0 deletions internal/configure/topology/dc_item.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,20 @@ var (
},
)

CONFIG_CHUNK_FILE_POOL_ALLOCATED_PERCENT = itemset.insert(
"chunkfilepool.allocated_percent",
REQUIRE_POSITIVE_INTEGER,
true,
nil,
)

CONFIG_CHUNK_FORMAT_THREAD_NUM = itemset.insert(
"chunkfilepool.format_thread_num",
REQUIRE_POSITIVE_INTEGER,
true,
nil,
)

CONFIG_S3_ACCESS_KEY = itemset.insert(
"s3.ak",
REQUIRE_STRING,
Expand Down
8 changes: 7 additions & 1 deletion internal/task/task/common/create_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func getArguments(dc *topology.DeployConfig) string {
"enableExternalServer": dc.GetEnableExternalServer(),
"chunkServerExternalIp": dc.GetListenExternalIp(),
"chunkServerPort": dc.GetListenPort(),
"chunkFilePoolDir": dataDir,
"chunkFilePoolDir": fmt.Sprintf("%s/chunks", dataDir),
"chunkFilePoolMetaPath": fmt.Sprintf("%s/chunkfilepool.meta", dataDir),
"walFilePoolDir": dataDir,
"walFilePoolMetaPath": fmt.Sprintf("%s/walfilepool.meta", dataDir),
Expand All @@ -139,6 +139,12 @@ func getArguments(dc *topology.DeployConfig) string {
"raft_max_install_snapshot_tasks_num": 1,
"raft_use_fsync_rather_than_fdatasync": false,
}
if dc.GetChunkFilePoolAllocatedPercent() != 0 {
chunkserverArguments["chunkFilePoolAllocatedPercent"] = dc.GetChunkFilePoolAllocatedPercent()
}
if dc.GetChunkFormatThreadNum() != 0 {
chunkserverArguments["chunkFormatThreadNum"] = dc.GetChunkFormatThreadNum()
}

arguments := []string{}
for k, v := range chunkserverArguments {
Expand Down
2 changes: 1 addition & 1 deletion internal/task/task/playground/script/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function start_service() {
-raft_sync_segments=true \
-raft_max_install_snapshot_tasks_num=1 \
-chunkServerIp=127.0.0.1 \
-chunkFilePoolDir="${data_dir}" \
-chunkFilePoolDir="${data_dir}"/chunks \
-walFilePoolDir="${data_dir}" \
-raft_sync=true \
-raft_max_segment_size=8388608 \
Expand Down