fsck will warn but not fail on legacy stores, and repair will
convert to per-pool stats.
+* The disaster-recovery related 'ceph mon sync force' command has been
+ replaced with 'ceph daemon <...> sync_force'.
+
* The ``osd_recovery_max_active`` option now has
``osd_recovery_max_active_hdd`` and ``osd_recovery_max_active_ssd``
variants, each with different default values for HDD and SSD-backed
ceph status
-sync force
-----------
-
-Forces sync of and clear monitor store.
-
-Usage::
-
- ceph sync force {--yes-i-really-mean-it} {--i-know-what-i-am-doing}
-
-
tell
----
Thrash the monitor specified.
:param mon: monitor to thrash
"""
- addr = self.ctx.ceph['ceph'].mons['mon.%s' % mon]
- self.log('thrashing mon.{id}@{addr} store'.format(id=mon, addr=addr))
- out = self.manager.raw_cluster_cmd('-m', addr, 'sync', 'force',
- '--yes-i-really-mean-it',
- '--i-know-what-i-am-doing')
+ self.log('thrashing mon.{id} store'.format(id=mon))
+ out = self.manager.raw_cluster_cmd(
+ 'tell', 'mon.%s' % mon, 'sync_force',
+ '--yes-i-really-mean-it')
j = json.loads(out)
assert j['ret'] == 0, \
'error forcing store sync on mon.{id}:\n{ret}'.format(
# current DEPRECATED commands are:
# ceph compact
# ceph scrub
- # ceph sync force
#
# Testing should be accomplished by setting
# 'mon_debug_deprecated_as_obsolete = true' and expecting ENOTSUP for
expect_false ceph tell mon.a scrub 2> $TMPFILE
check_response "\(EOPNOTSUPP\|ENOTSUP\): command is obsolete"
- expect_false ceph tell mon.a sync force 2> $TMPFILE
- check_response "\(EOPNOTSUPP\|ENOTSUP\): command is obsolete"
-
ceph tell mon.a injectargs '--no-mon-debug-deprecated-as-obsolete'
}
if (force_sync) {
derr << "flagging a forced sync ..." << dendl;
ostringstream oss;
- mon->sync_force(NULL, oss);
- if (oss.tellp())
- derr << oss.str() << dendl;
+ JSONFormatter jf(true);
+ mon->sync_force(&jf);
+ derr << "out:\n";
+ jf.flush(*_dout);
+ *_dout << dendl;
}
err = mon->preinit();
"check whether removing the specified mon would break quorum",
"mon", "r")
-COMMAND_WITH_FLAG("sync force " \
- "name=yes_i_really_mean_it,type=CephBool,req=false " \
- "name=i_know_what_i_am_doing,type=CephBool,req=false", \
- "force sync of and clear monitor store", \
- "mon", "rw", \
- FLAG(NOFORWARD)|FLAG(DEPRECATED))
COMMAND_WITH_FLAG("heap " \
"name=heapcmd,type=CephChoices,strings=dump|start_profiler|stop_profiler|release|stats", \
"show heap usage info (available only if compiled with tcmalloc)", \
"scrub the monitor stores", \
"mon", "rw", \
FLAG(NONE))
-COMMAND_WITH_FLAG("mon sync force " \
- "name=yes_i_really_mean_it,type=CephBool,req=false " \
- "name=i_know_what_i_am_doing,type=CephBool,req=false", \
- "force sync of and clear monitor store", \
- "mon", "rw", \
- FLAG(NOFORWARD))
COMMAND("mon metadata name=id,type=CephString,req=false",
"fetch metadata for mon <id>",
"mon", "r")
err << "are you SURE? this will mean the monitor store will be erased "
"the next time the monitor is restarted. pass "
"'--yes-i-really-mean-it' if you really do.";
+ r = -EPERM;
goto abort;
}
- sync_force(f, out);
+ sync_force(f);
} else if (command.compare(0, 23, "add_bootstrap_peer_hint") == 0 ||
command.compare(0, 24, "add_bootstrap_peer_hintv") == 0) {
if (!_add_bootstrap_peer_hint(command, cmdmap, out))
r = admin_socket->register_command("quorum_status",
admin_hook, "show current quorum status");
ceph_assert(r == 0);
- r = admin_socket->register_command("sync_force name=validate,"
- "type=CephChoices,"
- "strings=--yes-i-really-mean-it",
- admin_hook,
- "force sync of and clear monitor store");
+ r = admin_socket->register_command(
+ "sync_force "
+ //"name=yes_i_really_mean_it,type=CephBool,req=false",
+ "name=validate,type=CephChoices,strings=--yes-i-really-mean-it,req=false",
+ admin_hook,
+ "force sync of and clear monitor store");
ceph_assert(r == 0);
r = admin_socket->register_command("add_bootstrap_peer_hint name=addr,"
"type=CephIPAddr",
}
}
-void Monitor::sync_force(Formatter *f, ostream& ss)
+void Monitor::sync_force(Formatter *f)
{
- bool free_formatter = false;
-
- if (!f) {
- // louzy/lazy hack: default to json if no formatter has been defined
- f = new JSONFormatter();
- free_formatter = true;
- }
-
auto tx(std::make_shared<MonitorDBStore::Transaction>());
sync_stash_critical_state(tx);
tx->put("mon_sync", "force_sync", 1);
f->dump_int("ret", 0);
f->dump_stream("msg") << "forcing store sync the next time the monitor starts";
f->close_section(); // sync_force
- f->flush(ss);
- if (free_formatter)
- delete f;
}
void Monitor::_quorum_status(Formatter *f, ostream& ss)
/* Let the Monitor class handle the following commands:
* 'mon compact'
* 'mon scrub'
- * 'mon sync force'
*/
prefix != "mon compact" &&
prefix != "mon scrub" &&
- prefix != "mon sync force" &&
prefix != "mon metadata" &&
prefix != "mon versions" &&
prefix != "mon count-metadata" &&
}
r = 0;
rs = "safe to remove mon." + id;
- } else if (prefix == "sync force" ||
- prefix == "mon sync force") {
- bool validate1 = false;
- cmd_getval(g_ceph_context, cmdmap, "yes_i_really_mean_it", validate1);
- bool validate2 = false;
- cmd_getval(g_ceph_context, cmdmap, "i_know_what_i_am_doing", validate2);
-
- if (!validate1 || !validate2) {
- r = -EINVAL;
- rs = "are you SURE? this will mean the monitor store will be "
- "erased. pass '--yes-i-really-mean-it "
- "--i-know-what-i-am-doing' if you really do.";
- goto out;
- }
- sync_force(f.get(), ds);
- rs = ds.str();
- r = 0;
} else if (prefix == "heap") {
if (!ceph_using_tcmalloc())
rs = "tcmalloc not enabled, can't use heap profiler commands\n";
/**
* force a sync on next mon restart
*/
- void sync_force(Formatter *f, ostream& ss);
+ void sync_force(Formatter *f);
private:
/**