]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: set epoch barrier on transition to active
authorJohn Spray <john.spray@redhat.com>
Mon, 27 Oct 2014 13:27:30 +0000 (13:27 +0000)
committerJohn Spray <john.spray@redhat.com>
Tue, 16 Dec 2014 20:51:49 +0000 (20:51 +0000)
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 <john.spray@redhat.com>
src/mds/MDS.cc

index e568adece1a43f3880411bb2a96c8596f9c858ad..01b5cf8b6f45cb8ef15861c00b5ec15a0a3fca26 100644 (file)
@@ -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);