Merge pull request from liewegas/wip-20600

mon: fix hang on deprecated/removed 'pg set_*full_ratio' commands

Reviewed-by: Greg Farnum <gfarnum@redhat.com>
This commit is contained in:
Sage Weil 2017-07-13 22:16:39 -05:00 committed by GitHub
commit 7e287a4408
2 changed files with 18 additions and 11 deletions

View File

@ -125,11 +125,13 @@
// note: this should be replaced shortly!
COMMAND("pg force_create_pg name=pgid,type=CephPgid", \
"force creation of pg <pgid>", "pg", "rw", "cli,rest")
COMMAND("pg set_full_ratio name=ratio,type=CephFloat,range=0.0|1.0", \
"set ratio at which pgs are considered full", "pg", "rw", "cli,rest")
COMMAND("pg set_nearfull_ratio name=ratio,type=CephFloat,range=0.0|1.0", \
"set ratio at which pgs are considered nearly full", \
"pg", "rw", "cli,rest")
COMMAND_WITH_FLAG("pg set_full_ratio name=ratio,type=CephFloat,range=0.0|1.0", \
"set ratio at which pgs are considered full", \
"pg", "rw", "cli,rest", FLAG(DEPRECATED))
COMMAND_WITH_FLAG("pg set_nearfull_ratio " \
"name=ratio,type=CephFloat,range=0.0|1.0", \
"set ratio at which pgs are considered nearly full", \
"pg", "rw", "cli,rest", FLAG(DEPRECATED))
COMMAND("pg map name=pgid,type=CephPgid", "show mapping of pg to osds", \
"pg", "r", "cli,rest")

View File

@ -558,21 +558,26 @@ version_t PGMonitor::get_trim_to()
bool PGMonitor::preprocess_query(MonOpRequestRef op)
{
if (mon->osdmon()->osdmap.require_osd_release >= CEPH_RELEASE_LUMINOUS) {
return false;
}
op->mark_pgmon_event(__func__);
PaxosServiceMessage *m = static_cast<PaxosServiceMessage*>(op->get_req());
dout(10) << "preprocess_query " << *m << " from " << m->get_orig_source_inst() << dendl;
dout(10) << "preprocess_query " << *m
<< " from " << m->get_orig_source_inst() << dendl;
switch (m->get_type()) {
case MSG_PGSTATS:
if (mon->osdmon()->osdmap.require_osd_release >= CEPH_RELEASE_LUMINOUS) {
return true;
}
return preprocess_pg_stats(op);
case MSG_MON_COMMAND:
if (mon->osdmon()->osdmap.require_osd_release >= CEPH_RELEASE_LUMINOUS) {
bufferlist rdata;
mon->reply_command(op, -EOPNOTSUPP, "this command is obsolete", rdata,
get_last_committed());
return true;
}
return preprocess_command(op);
default:
ceph_abort();
return true;