Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

replica-server: support remote command useless-dir-reserve-seconds #215

Merged
merged 2 commits into from
Jan 10, 2019

Conversation

qinzuoyan
Copy link
Member

@qinzuoyan qinzuoyan commented Jan 10, 2019

to dynamically change gc_disk_error_replica_interval_seconds and gc_disk_garbage_replica_interval_seconds.

for the reason, please refer to: 垃圾文件夹管理

hycdong
hycdong previously approved these changes Jan 10, 2019
"gc_disk_garbage_replica_interval_seconds",
[this](const std::vector<std::string> &args) {
std::string result("OK");
if (args.size() <= 0) {
Copy link
Member

Choose a reason for hiding this comment

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

这里用empty()

Copy link
Member Author

Choose a reason for hiding this comment

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

done

[this](const std::vector<std::string> &args) {
std::string result("OK");
if (args.size() <= 0) {
result = "error(" + std::to_string(_gc_disk_error_replica_interval_seconds) +
Copy link
Member

Choose a reason for hiding this comment

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

这个错误信息太简洁了,不够明确

Copy link
Member Author

Choose a reason for hiding this comment

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

这不是错误信息,这是返回现在的值,我改一下吧

_gc_disk_garbage_replica_interval_seconds =
_options.gc_disk_garbage_replica_interval_seconds;
} else {
int v = atoi(args[0].c_str());
Copy link
Member

Choose a reason for hiding this comment

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

atoi不够健壮,用buf2int32

Copy link
Member Author

Choose a reason for hiding this comment

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

done


_garbage_dir_reserve_seconds_command = dsn::command_manager::instance().register_app_command(
{"garbage-dir-reserve-seconds"},
"garbage-dir-reserve-seconds [num | DEFAULT]",
Copy link
Member

Choose a reason for hiding this comment

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

从命令名字上看不出原来是同时控制两个变量的

Copy link
Member Author

Choose a reason for hiding this comment

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

改成useless-dir-reserve-seconds

@qinzuoyan qinzuoyan changed the title replica-server: support remote command garbage-dir-reserve-seconds replica-server: support remote command useless-dir-reserve-seconds Jan 10, 2019
@qinzuoyan qinzuoyan merged commit a173cbc into master Jan 10, 2019
@qinzuoyan qinzuoyan deleted the qinzuoyan branch January 10, 2019 10:11
vagetablechicken pushed a commit to vagetablechicken/rdsn that referenced this pull request Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants