From: John Spray Date: Mon, 18 May 2015 21:56:44 +0000 (+0100) Subject: mds: fix DAMAGED beacons from rejoin X-Git-Tag: v9.0.3~132^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=81b51bae452fcb9cf29a84a4d75e684c0cccae20;p=ceph.git mds: fix DAMAGED beacons from rejoin In certain cases, the beacon was emitted from within handle_mds_map (via MDCache::rejoin_start and the "No subtrees found for root MDS rank!" error handler. This was happening before Beacon::notify_mdsmap had been called with the new epoch, so the DAMAGED beacon had the old epoch set, and was consequently ignored by the MDSMonitor. The symptom would be that MDS ranks with metadata damaged in this particular way would flap instead of gracefully going damaged. Signed-off-by: John Spray --- diff --git a/src/mds/MDS.cc b/src/mds/MDS.cc index 7462c82129b..4f78af193dc 100644 --- a/src/mds/MDS.cc +++ b/src/mds/MDS.cc @@ -1552,6 +1552,10 @@ void MDS::handle_mds_map(MMDSMap *m) monc->sub_got("mdsmap", mdsmap->get_epoch()); + // Update Beacon early, so that if any of the below code for handling + // state changes wants to send a beacon, it reflects the latest epoch. + beacon.notify_mdsmap(mdsmap); + // verify compatset CompatSet mdsmap_compat(get_mdsmap_compat_set_all()); dout(10) << " my compat " << mdsmap_compat << dendl; @@ -1863,8 +1867,6 @@ void MDS::handle_mds_map(MMDSMap *m) mdcache->notify_mdsmap_changed(); out: - beacon.notify_mdsmap(mdsmap); - m->put(); delete oldmap; }