]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix DAMAGED beacons from rejoin
authorJohn Spray <john.spray@redhat.com>
Mon, 18 May 2015 21:56:44 +0000 (22:56 +0100)
committerJohn Spray <john.spray@redhat.com>
Thu, 18 Jun 2015 10:19:44 +0000 (11:19 +0100)
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 <john.spray@redhat.com>
src/mds/MDS.cc

index 7462c82129bc0bc13335e9a011443bc0c93c9f4d..4f78af193dc2479bfa6af7970478aae93e0b28c8 100644 (file)
@@ -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;
 }