From c1c539f1efc8f2fe448bf3c4cbbed8f6401ab24d Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 29 Nov 2017 15:20:59 -0600 Subject: [PATCH] mon/Monitor: fix statfs handling before luminous switchover happens 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 --- src/mon/Monitor.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index af3683f67e1e7..ce2ab39167d96 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -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; -- 2.39.5