-
Notifications
You must be signed in to change notification settings - Fork 58
replica-server: support remote command useless-dir-reserve-seconds #215
Conversation
"gc_disk_garbage_replica_interval_seconds", | ||
[this](const std::vector<std::string> &args) { | ||
std::string result("OK"); | ||
if (args.size() <= 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里用empty()
吧
There was a problem hiding this comment.
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) + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个错误信息太简洁了,不够明确
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
atoi
不够健壮,用buf2int32
吧
There was a problem hiding this comment.
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]", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
从命令名字上看不出原来是同时控制两个变量的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改成useless-dir-reserve-seconds
to dynamically change
gc_disk_error_replica_interval_seconds
andgc_disk_garbage_replica_interval_seconds
.for the reason, please refer to: 垃圾文件夹管理