From: John Spray Date: Mon, 27 Oct 2014 13:27:30 +0000 (+0000) Subject: mds: set epoch barrier on transition to active X-Git-Tag: v0.91~47^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fcc64f3849c9da72f164704c3ddc76dbbff409ef;p=ceph.git mds: set epoch barrier on transition to active To handle case where MDSs restart after experiencing a barrier-inducing operation: rather than persisting OSD barrier somewhere, just have the MDSs always barrier on latest OSD epoch at startup. Effect is that after restart, MDS cap issues will be delayed in (compliant) clients until the client sees the latest OSD map. Signed-off-by: John Spray --- diff --git a/src/mds/MDS.cc b/src/mds/MDS.cc index e568adece1a4..01b5cf8b6f45 100644 --- a/src/mds/MDS.cc +++ b/src/mds/MDS.cc @@ -1639,6 +1639,16 @@ void MDS::handle_mds_map(MMDSMap *m) } } + if (is_active()) { + // Before going active, set OSD epoch barrier to latest (so that + // we don't risk handing out caps to clients with old OSD maps that + // might not include barriers from the previous incarnation of this MDS) + const OSDMap *osdmap = objecter->get_osdmap_read(); + const epoch_t osd_epoch = osdmap->get_epoch(); + objecter->put_osdmap_read(); + set_osd_epoch_barrier(osd_epoch); + } + out: beacon.notify_mdsmap(mdsmap);