]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/Monitor: fix statfs handling before luminous switchover happens 19243/head
authorSage Weil <sage@redhat.com>
Wed, 29 Nov 2017 21:20:59 +0000 (15:20 -0600)
committerSage Weil <sage@redhat.com>
Wed, 29 Nov 2017 22:03:31 +0000 (16:03 -0600)
After the mons are luminous but before we switch over to using the
MgrStatMonitor's new info, the version on mgrstat will generally be <<
than that of pgmon, and the client will send that version with the
request.  This means that the statfs message will perpetually appear to be
in the future and fail the is_readable() check.

Fix this with any ugly hack that resets the version to 1 if we haven't
completed the luminous upgrade yet.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/Monitor.cc

index af3683f67e1e7a540a9c3abc76a1014c6baaf993..ce2ab39167d96732479677feaf975a58e58bfd09 100644 (file)
@@ -45,6 +45,7 @@
 #include "messages/MMonPaxos.h"
 #include "messages/MRoute.h"
 #include "messages/MForward.h"
+#include "messages/MStatfs.h"
 
 #include "messages/MMonSubscribe.h"
 #include "messages/MMonSubscribeAck.h"
@@ -4274,8 +4275,16 @@ void Monitor::dispatch_op(MonOpRequestRef op)
       break;
 
     // MgrStat
-    case MSG_MON_MGR_REPORT:
     case CEPH_MSG_STATFS:
+      // this is an ugly hack, sorry!  force the version to 1 so that we do
+      // not run afoul of the is_readable() paxos check.  the client is going
+      // by the pgmonitor version and the MgrStatMonitor version will lag behind
+      // that until we complete the upgrade.  The paxos ordering crap really
+      // doesn't matter for statfs results, so just kludge around it here.
+      if (osdmon()->osdmap.require_osd_release < CEPH_RELEASE_LUMINOUS) {
+       ((MStatfs*)op->get_req())->version = 1;
+      }
+    case MSG_MON_MGR_REPORT:
     case MSG_GETPOOLSTATS:
       paxos_service[PAXOS_MGRSTAT]->dispatch(op);
       break;