From 34e2ce5852389fc54241fb09d55254b3f446c1ed Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 13 Jul 2017 13:59:26 -0400 Subject: [PATCH] mon/PGMonitor: EOPNOTSUPP for old pgmon commands This includes 'pg set_full_ratio', which we have only for the upgrade, but goes away afterwards. Also, return true to either swallow the request or indicate it has been processed. Fixes: http://tracker.ceph.com/issues/20600 Signed-off-by: Sage Weil --- src/mon/PGMonitor.cc | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc index 7fdb5bd6357..37324608be5 100644 --- a/src/mon/PGMonitor.cc +++ b/src/mon/PGMonitor.cc @@ -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(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; -- 2.39.5