mirror of
https://github.com/ceph/ceph
synced 2025-01-12 06:00:46 +00:00
Merge pull request #22395 from liewegas/wip-24408
osd,mds: make 'config rm ...' idempotent Reviewed-by: Erwan Velu <erwan@redhat.com>
This commit is contained in:
commit
3270f26672
@ -74,6 +74,7 @@ do
|
||||
done
|
||||
ceph config show osd.0 | grep debug_xio | grep 'override mon'
|
||||
ceph tell osd.0 config unset debug_xio
|
||||
ceph tell osd.0 config unset debug_xio
|
||||
|
||||
ceph config rm osd.0 debug_xio
|
||||
while ceph config show osd.0 | grep debug_xio | grep mon
|
||||
|
@ -441,7 +441,7 @@ void CephContext::do_command(std::string_view command, const cmdmap_t& cmdmap,
|
||||
f->dump_string("error", "syntax error: 'config unset <var>'");
|
||||
} else {
|
||||
int r = _conf->rm_val(var.c_str());
|
||||
if (r < 0) {
|
||||
if (r < 0 && r != -ENOENT) {
|
||||
f->dump_stream("error") << "error unsetting '" << var << "': "
|
||||
<< cpp_strerror(r);
|
||||
} else {
|
||||
|
@ -1413,6 +1413,9 @@ void md_config_t::_refresh(const Option& opt)
|
||||
|
||||
int md_config_t::_rm_val(const std::string& key, int level)
|
||||
{
|
||||
if (schema.count(key) == 0) {
|
||||
return -EINVAL;
|
||||
}
|
||||
auto i = values.find(key);
|
||||
if (i == values.end()) {
|
||||
return -ENOENT;
|
||||
|
@ -794,6 +794,9 @@ int MDSDaemon::_handle_command(
|
||||
if (r == 0) {
|
||||
cct->_conf->apply_changes(nullptr);
|
||||
}
|
||||
if (r == -ENOENT) {
|
||||
r = 0; // idempotent
|
||||
}
|
||||
} else if (prefix == "exit") {
|
||||
// We will send response before executing
|
||||
ss << "Exiting...";
|
||||
|
@ -5828,6 +5828,9 @@ void OSD::do_command(Connection *con, ceph_tid_t tid, vector<string>& cmd, buffe
|
||||
if (r == 0) {
|
||||
cct->_conf->apply_changes(nullptr);
|
||||
}
|
||||
if (r == -ENOENT) {
|
||||
r = 0; // make command idempotent
|
||||
}
|
||||
osd_lock.Lock();
|
||||
}
|
||||
else if (prefix == "cluster_log") {
|
||||
|
Loading…
Reference in New Issue
Block a user