]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/PGMonitor: EOPNOTSUPP for old pgmon commands 16300/head
authorSage Weil <sage@redhat.com>
Thu, 13 Jul 2017 17:59:26 +0000 (13:59 -0400)
committerSage Weil <sage@redhat.com>
Thu, 13 Jul 2017 17:59:26 +0000 (13:59 -0400)
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 <sage@redhat.com>
src/mon/PGMonitor.cc

index 7fdb5bd6357a786afbc30ed4acb8625d5c78078d..37324608be5ad7cd3ad3e644f1df3cfbf632e9ba 100644 (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;